From f02ff1b9f8ebfc434faa7e9e509e3e85c8eeb5e5 Mon Sep 17 00:00:00 2001 From: Simon Urbanek Date: Sat, 8 Feb 2025 16:58:37 +1300 Subject: [PATCH] work around broken flag detections in gdal --- recipes/gdal | 2 ++ recipes/gdal.patch | 14 ++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 recipes/gdal.patch diff --git a/recipes/gdal b/recipes/gdal index f843e70..f4aa3f5 100644 --- a/recipes/gdal +++ b/recipes/gdal @@ -4,3 +4,5 @@ Depends: pkgconfig, xz, libpq, proj, openjpeg, libwebp, libgeotiff, freexl, sqli Source-URL: https://github.com/OSGeo/gdal/releases/download/v${ver}/gdal-${ver}.tar.gz Source-SHA256: b1c739256d074be42d67c6c3d33eee94c90a490ebb02fcb7fc21c569a6fc78bd Build-system: cmake +#Note: their CFLAGS/LIBS detection is broken as usual, requires flags to be manually passed from pkg-config +Configure: -DCMAKE_EXE_LINKER_FLAGS="`pkg-config --static --libs libpq libwebp blosc netcdf` -liconv" -DCMAKE_C_FLAGS="`pkg-config --cflags libpq libwebp blosc netcdf`" -DCMAKE_CXX_FLAGS="`pkg-config --cflags libpq libwebp blosc netcdf`" -DGDAL_ENABLE_HDF5_GLOBAL_LOCK=NO diff --git a/recipes/gdal.patch b/recipes/gdal.patch new file mode 100644 index 0000000..4031f2f --- /dev/null +++ b/recipes/gdal.patch @@ -0,0 +1,14 @@ +diff -ru gdal-3.10.1/frmts/hdf5/CMakeLists.txt gdal-3.10.1-1/frmts/hdf5/CMakeLists.txt +--- gdal-3.10.1/frmts/hdf5/CMakeLists.txt 2025-01-09 03:54:06 ++++ gdal-3.10.1-1/frmts/hdf5/CMakeLists.txt 2025-02-08 16:48:03 +@@ -94,7 +94,9 @@ + target_compile_definitions(gdal_HDF5 PRIVATE -DWIN32) + endif () + target_include_directories(gdal_HDF5 SYSTEM PRIVATE ${HDF5_INCLUDE_DIRS}) +-gdal_target_link_libraries(gdal_HDF5 PRIVATE ${HDF5_C_LIBRARIES}) ++if (DEFINED HDF5_C_LIBRARIES) ++ gdal_target_link_libraries(gdal_HDF5 PRIVATE ${HDF5_C_LIBRARIES}) ++endif () + + if (HDF5_BUILD_SHARED_LIBS) + target_compile_definitions(gdal_HDF5 PRIVATE -DH5_BUILT_AS_DYNAMIC_LIB)