git: fc5745d2f621 - main - math/saga: fix build against pdal 2.6.3

From: Loïc Bartoletti <lbartoletti_at_FreeBSD.org>
Date: Sat, 24 Feb 2024 05:24:13 UTC
The branch main has been updated by lbartoletti:

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

commit fc5745d2f621970d9b80e5b05e7fe215378d4e1e
Author:     Loïc Bartoletti <lbartoletti@FreeBSD.org>
AuthorDate: 2024-02-22 21:07:14 +0000
Commit:     Loïc Bartoletti <lbartoletti@FreeBSD.org>
CommitDate: 2024-02-24 05:23:53 +0000

    math/saga: fix build against pdal 2.6.3
---
 math/saga/Makefile                                 |  3 ++-
 math/saga/files/patch-cmake_modules_FindPDAL.cmake | 23 ++++++++++++++++++++++
 .../patch-src_tools_io_io__pdal_CMakeLists.txt     | 17 ++++++++++++++++
 3 files changed, 42 insertions(+), 1 deletion(-)

diff --git a/math/saga/Makefile b/math/saga/Makefile
index 1704cf419f6c..0e68194b13aa 100644
--- a/math/saga/Makefile
+++ b/math/saga/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	saga
 PORTVERSION=	9.3.1
+PORTREVISION=	1
 CATEGORIES=	math
 MASTER_SITES=	SF/saga-gis/SAGA%20-%20${PORTVERSION:C/\.[[:digit:]]\.[[:digit:]]*$//}/SAGA%20-%20${PORTVERSION}
 
@@ -22,7 +23,7 @@ LIB_DEPENDS=	libcurl.so:ftp/curl \
 		libhpdf.so:print/libharu \
 		libodbc.so:databases/unixODBC \
 		libopencv_core.so:graphics/opencv \
-		libpdal_base.so:math/pdal \
+		libpdalcpp.so:math/pdal \
 		libproj.so:graphics/proj \
 		libsvm.so:science/libsvm \
 		libsz.so:science/libaec \
diff --git a/math/saga/files/patch-cmake_modules_FindPDAL.cmake b/math/saga/files/patch-cmake_modules_FindPDAL.cmake
new file mode 100644
index 000000000000..e6879b50383c
--- /dev/null
+++ b/math/saga/files/patch-cmake_modules_FindPDAL.cmake
@@ -0,0 +1,23 @@
+--- cmake/modules/FindPDAL.cmake.orig	2024-02-22 20:36:47 UTC
++++ cmake/modules/FindPDAL.cmake
+@@ -35,17 +35,10 @@ FIND_LIBRARY(PDAL_CPP_LIBRARY NAMES pdalcpp libpdalcpp
+   )
+ FIND_LIBRARY(PDAL_CPP_LIBRARY NAMES pdalcpp libpdalcpp)
+ 
+-FIND_LIBRARY(PDAL_UTIL_LIBRARY NAMES pdal_util libpdal_util PATHS
+-  "$ENV{LIB_DIR}/lib"
+-  c:/msys/local/lib
+-  NO_DEFAULT_PATH
+-  )
+-FIND_LIBRARY(PDAL_UTIL_LIBRARY NAMES pdal_util libpdal_util)
+-
+-IF (PDAL_INCLUDE_DIR AND PDAL_CPP_LIBRARY AND PDAL_UTIL_LIBRARY)
++IF (PDAL_INCLUDE_DIR AND PDAL_CPP_LIBRARY)
+    SET(PDAL_FOUND TRUE)
+-   SET(PDAL_LIBRARIES ${PDAL_CPP_LIBRARY} ${PDAL_UTIL_LIBRARY})
+-ENDIF (PDAL_INCLUDE_DIR AND PDAL_CPP_LIBRARY AND PDAL_UTIL_LIBRARY)
++   SET(PDAL_LIBRARIES ${PDAL_CPP_LIBRARY})
++ENDIF (PDAL_INCLUDE_DIR AND PDAL_CPP_LIBRARY)
+ 
+ IF (PDAL_FOUND)
+    IF (NOT PDAL_FIND_QUIETLY)
diff --git a/math/saga/files/patch-src_tools_io_io__pdal_CMakeLists.txt b/math/saga/files/patch-src_tools_io_io__pdal_CMakeLists.txt
new file mode 100644
index 000000000000..bda10dfd1e8d
--- /dev/null
+++ b/math/saga/files/patch-src_tools_io_io__pdal_CMakeLists.txt
@@ -0,0 +1,17 @@
+--- src/tools/io/io_pdal/CMakeLists.txt.orig	2024-02-22 20:37:05 UTC
++++ src/tools/io/io_pdal/CMakeLists.txt
+@@ -9,11 +9,10 @@ if(WITH_TOOLS_PDAL)
+ 		endif()
+ 		find_path   (PDAL_INCLUDE_DIR  NAMES pdal/pdal.hpp          PATHS "${LIB4SAGA}/include")
+ 		find_library(PDAL_LIBRARY_CPP  NAMES pdalcpp libpdalcpp     PATHS "${LIB4SAGA}/lib")
+-		find_library(PDAL_LIBRARY_UTIL NAMES pdal_util libpdal_util PATHS "${LIB4SAGA}/lib")
+-		mark_as_advanced(PDAL_INCLUDE_DIR PDAL_LIBRARY_CPP PDAL_LIBRARY_UTIL)
++		mark_as_advanced(PDAL_INCLUDE_DIR PDAL_LIBRARY_CPP)
+ 		include(FindPackageHandleStandardArgs)
+-		FIND_PACKAGE_HANDLE_STANDARD_ARGS(PDAL REQUIRED_VARS PDAL_LIBRARY_UTIL PDAL_LIBRARY_CPP PDAL_INCLUDE_DIR)
+-		set(PDAL_LIBRARIES ${PDAL_LIBRARY_CPP} ${PDAL_LIBRARY_UTIL} ws2_32)
++		FIND_PACKAGE_HANDLE_STANDARD_ARGS(PDAL REQUIRED_VARS PDAL_LIBRARY_CPP PDAL_INCLUDE_DIR)
++		set(PDAL_LIBRARIES ${PDAL_LIBRARY_CPP} ws2_32)
+ 	endif()
+ 	if(NOT PDAL_FOUND)
+ 		find_package(PDAL QUIET)	# link PDAL library