git: 1972bd9d1ffd - main - misc/sdformat: unbreak

From: Adriaan de Groot <adridg_at_FreeBSD.org>
Date: Sun, 26 Mar 2023 21:35:22 UTC
The branch main has been updated by adridg:

URL: https://cgit.FreeBSD.org/ports/commit/?id=1972bd9d1ffd7069b1081269e5bbad01af73e4c0

commit 1972bd9d1ffd7069b1081269e5bbad01af73e4c0
Author:     Adriaan de Groot <adridg@FreeBSD.org>
AuthorDate: 2023-03-23 19:31:13 +0000
Commit:     Adriaan de Groot <adridg@FreeBSD.org>
CommitDate: 2023-03-26 21:31:32 +0000

    misc/sdformat: unbreak
    
    Because we have separate directories with urdf (libraries and headers)
    the consumer that assumes they live in one place falls over because
    the headers are not found.
---
 misc/sdformat/Makefile                               |  2 --
 misc/sdformat/files/patch-cmake_SearchForStuff.cmake | 19 ++++++++++++++++++-
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/misc/sdformat/Makefile b/misc/sdformat/Makefile
index 8a30e28ce09f..f9a963002b84 100644
--- a/misc/sdformat/Makefile
+++ b/misc/sdformat/Makefile
@@ -10,8 +10,6 @@ WWW=		https://bitbucket.org/osrf/sdformat/src/default/
 
 LICENSE=	APACHE20
 
-BROKEN=		does not build: src/parser_urdf.cc:30:10: fatal error: 'urdf_model/model.h' file not found
-
 BUILD_DEPENDS=	ignition-cmake==2:devel/ignition-cmake \
 		ignition-tools>0:devel/ignition-tools \
 		rubygem-rexml>0:textproc/rubygem-rexml
diff --git a/misc/sdformat/files/patch-cmake_SearchForStuff.cmake b/misc/sdformat/files/patch-cmake_SearchForStuff.cmake
index f302a1ebac69..39fe56827f33 100644
--- a/misc/sdformat/files/patch-cmake_SearchForStuff.cmake
+++ b/misc/sdformat/files/patch-cmake_SearchForStuff.cmake
@@ -1,4 +1,4 @@
---- cmake/SearchForStuff.cmake.orig	2018-11-21 00:19:13 UTC
+--- cmake/SearchForStuff.cmake.orig	2018-11-14 23:55:43 UTC
 +++ cmake/SearchForStuff.cmake
 @@ -9,24 +9,24 @@ if (USE_EXTERNAL_TINYXML)
    #################################################
@@ -32,3 +32,20 @@
    endif()
  else()
    # Needed in WIN32 since in UNIX the flag is added in the code installed
+@@ -55,6 +55,7 @@ endif()
+ if (NOT DEFINED USE_INTERNAL_URDF OR NOT USE_INTERNAL_URDF)
+   # check for urdfdom with pkg-config
+   pkg_check_modules(URDF urdfdom>=1.0)
++  pkg_check_modules(URDF_h urdfdom_headers>=1.0)
+ 
+   if (NOT URDF_FOUND)
+     if (NOT DEFINED USE_INTERNAL_URDF)
+@@ -65,7 +66,7 @@ if (NOT DEFINED USE_INTERNAL_URDF OR NOT USE_INTERNAL_
+     endif()
+   else()
+     # what am I doing here? pkg-config and cmake
+-    set(URDF_INCLUDE_DIRS ${URDF_INCLUDEDIR})
++    set(URDF_INCLUDE_DIRS ${URDF_INCLUDEDIR} ${URDF_h_INCLUDEDIR})
+     set(URDF_LIBRARY_DIRS ${URDF_LIBDIR})
+   endif()
+ endif()