summaryrefslogtreecommitdiff
path: root/graphics/libopendrive
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/libopendrive')
-rw-r--r--graphics/libopendrive/Makefile31
-rw-r--r--graphics/libopendrive/distinfo3
-rw-r--r--graphics/libopendrive/files/patch-CMakeLists.txt62
-rw-r--r--graphics/libopendrive/pkg-descr6
-rw-r--r--graphics/libopendrive/pkg-plist29
5 files changed, 131 insertions, 0 deletions
diff --git a/graphics/libopendrive/Makefile b/graphics/libopendrive/Makefile
new file mode 100644
index 000000000000..e0aff6c9efeb
--- /dev/null
+++ b/graphics/libopendrive/Makefile
@@ -0,0 +1,31 @@
+PORTNAME= libopendrive
+PORTVERSION= 0.6.0
+PORTREVISION= 1
+CATEGORIES= graphics
+
+MAINTAINER= sunpoet@FreeBSD.org
+COMMENT= Small, lightweight C++ library for handling OpenDRIVE files
+WWW= https://github.com/pageldev/libOpenDRIVE
+
+LICENSE= APACHE20
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+BUILD_DEPENDS= catch2>=3.4.0:devel/catch2 \
+ pugixml>=1.14:textproc/pugixml
+LIB_DEPENDS= libpugixml.so:textproc/pugixml
+
+USES= cmake compiler:c++17-lang
+
+CMAKE_ON= BUILD_SHARED_LIBS
+
+USE_GITHUB= yes
+GH_ACCOUNT= pageldev
+GH_PROJECT= libOpenDRIVE
+GH_TAGNAME= 82c2dd9
+
+post-patch:
+ @${MKDIR} ${WRKSRC}/pugixml/
+ @${LN} -s ${LOCALBASE}/include/pugixml.hpp ${WRKSRC}/pugixml/pugixml.hpp
+ @${LN} -s ${LOCALBASE}/include/pugiconfig.hpp ${WRKSRC}/pugixml/pugiconfig.hpp
+
+.include <bsd.port.mk>
diff --git a/graphics/libopendrive/distinfo b/graphics/libopendrive/distinfo
new file mode 100644
index 000000000000..156664e687d5
--- /dev/null
+++ b/graphics/libopendrive/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1751375029
+SHA256 (pageldev-libOpenDRIVE-0.6.0-82c2dd9_GH0.tar.gz) = 366063848456c376b1a1e499b9f262bc0c024f579dae300ee190882900615cf5
+SIZE (pageldev-libOpenDRIVE-0.6.0-82c2dd9_GH0.tar.gz) = 152194
diff --git a/graphics/libopendrive/files/patch-CMakeLists.txt b/graphics/libopendrive/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..32b6609c0b7b
--- /dev/null
+++ b/graphics/libopendrive/files/patch-CMakeLists.txt
@@ -0,0 +1,62 @@
+--- CMakeLists.txt.orig 2025-07-04 08:27:24 UTC
++++ CMakeLists.txt
+@@ -20,22 +20,10 @@ include(CTest)
+ endif()
+
+ include(CTest)
+-include(FetchContent)
+ include(GNUInstallDirs)
+
+-FetchContent_Declare(
+- pugixml
+- GIT_REPOSITORY https://github.com/zeux/pugixml.git
+- GIT_TAG v1.14
+-)
+-FetchContent_MakeAvailable(pugixml)
+-
+-FetchContent_Declare(
+- Catch2
+- GIT_REPOSITORY https://github.com/catchorg/Catch2.git
+- GIT_TAG v3.4.0
+-)
+-FetchContent_MakeAvailable(Catch2)
++find_package(pugixml 1.14 REQUIRED)
++find_package(Catch2 3.4.0 REQUIRED)
+ include(Catch)
+
+ set(SOURCES
+@@ -59,19 +47,18 @@ set(SOURCES
+ src/RoadObject.cpp
+ src/RoadSignal.cpp
+ src/RoutingGraph.cpp
+- ${pugixml_SOURCE_DIR}/src/pugixml.cpp
+ )
+
+ add_library(OpenDrive ${SOURCES})
+ target_include_directories(
+ OpenDrive PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
++ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/pugixml>
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
+- $<BUILD_INTERFACE:${pugixml_SOURCE_DIR}/src>
+ )
+
+ add_executable(tests tests/test.cpp)
+-target_link_libraries(tests PRIVATE OpenDrive Catch2::Catch2WithMain)
++target_link_libraries(tests PRIVATE OpenDrive pugixml::pugixml Catch2::Catch2WithMain)
+ catch_discover_tests(tests WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests)
+
+ install(
+@@ -80,12 +67,6 @@ install(
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+-)
+-install(
+- FILES
+- ${pugixml_SOURCE_DIR}/src/pugixml.hpp
+- ${pugixml_SOURCE_DIR}/src/pugiconfig.hpp
+- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+ )
+ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+ install(TARGETS OpenDrive EXPORT OpenDriveConfig)
diff --git a/graphics/libopendrive/pkg-descr b/graphics/libopendrive/pkg-descr
new file mode 100644
index 000000000000..f4b23eb472f2
--- /dev/null
+++ b/graphics/libopendrive/pkg-descr
@@ -0,0 +1,6 @@
+libOpenDRIVE is a lightweight, dependency-free, fast C++ library providing
+OpenDRIVE file parsing and 3D model generation.
+
+It's small and can be easily integrated in other projects. A core function is
+the parsing of OpenDRIVE files and the generation of 3D models. The library
+targets OpenDRIVE version 1.4.
diff --git a/graphics/libopendrive/pkg-plist b/graphics/libopendrive/pkg-plist
new file mode 100644
index 000000000000..b94183fd63c1
--- /dev/null
+++ b/graphics/libopendrive/pkg-plist
@@ -0,0 +1,29 @@
+cmake/OpenDriveConfig-%%CMAKE_BUILD_TYPE%%.cmake
+cmake/OpenDriveConfig.cmake
+include/CubicBezier.hpp
+include/Geometries/Arc.h
+include/Geometries/CubicSpline.h
+include/Geometries/Line.h
+include/Geometries/ParamPoly3.h
+include/Geometries/RoadGeometry.h
+include/Geometries/Spiral.h
+include/Geometries/Spiral/odrSpiral.h
+include/Junction.h
+include/Lane.h
+include/LaneSection.h
+include/LaneValidityRecord.h
+include/Log.h
+include/Math.hpp
+include/Mesh.h
+include/OpenDriveMap.h
+include/RefLine.h
+include/Road.h
+include/RoadMark.h
+include/RoadNetworkMesh.h
+include/RoadObject.h
+include/RoadSignal.h
+include/RoutingGraph.h
+include/Utils.hpp
+include/XmlNode.h
+include/earcut.hpp
+lib/libOpenDrive.so