aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/geos/fix-exported-config.patch
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/geos/fix-exported-config.patch
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/geos/fix-exported-config.patch')
-rw-r--r--vcpkg/ports/geos/fix-exported-config.patch80
1 files changed, 80 insertions, 0 deletions
diff --git a/vcpkg/ports/geos/fix-exported-config.patch b/vcpkg/ports/geos/fix-exported-config.patch
new file mode 100644
index 0000000..2e05f83
--- /dev/null
+++ b/vcpkg/ports/geos/fix-exported-config.patch
@@ -0,0 +1,80 @@
+diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
+index a8c034fb2..a5cd14c13 100644
+--- a/tools/CMakeLists.txt
++++ b/tools/CMakeLists.txt
+@@ -61,11 +61,22 @@ function(configure_install_geos_pc)
+ set(libdir "$\{exec_prefix\}/${CMAKE_INSTALL_LIBDIR}")
+ endif()
+ set(VERSION ${GEOS_VERSION})
+- set(EXTRA_LIBS "-lstdc++")
++ set(EXTRA_LIBS "")
++ foreach(lib IN LISTS CMAKE_CXX_IMPLICIT_LINK_LIBRARIES)
++ if(lib IN_LIST CMAKE_C_IMPLICIT_LINK_LIBRARIES)
++ continue()
++ elseif(EXISTS "${lib}")
++ list(APPEND EXTRA_LIBS "${lib}")
++ else()
++ list(APPEND EXTRA_LIBS "-l${lib}")
++ endif()
++ endforeach()
+ if(HAVE_LIBM)
++ list(REMOVE_ITEM EXTRA_LIBS "-lm")
+ list(APPEND EXTRA_LIBS "-lm")
+ endif()
+ list(JOIN EXTRA_LIBS " " EXTRA_LIBS)
++ set(EXTRA_LIBS "${EXTRA_LIBS}" PARENT_SCOPE) # for geos-config
+
+ configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/geos.pc.in
+@@ -77,9 +88,9 @@ function(configure_install_geos_pc)
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+ endfunction()
+
++configure_install_geos_pc()
+ if(NOT MSVC)
+ configure_install_geos_config()
+- configure_install_geos_pc()
+ endif()
+
+ option(BUILD_ASTYLE "Build astyle (Artistic Style) tool" OFF)
+diff --git a/tools/geos-config.in b/tools/geos-config.in
+index 6eff1eb14..8827f6ac6 100644
+--- a/tools/geos-config.in
++++ b/tools/geos-config.in
+@@ -1,9 +1,11 @@
+ #!/bin/sh
+
+-prefix=@prefix@
+-exec_prefix=@exec_prefix@
+-includedir=@includedir@
+-libdir=@libdir@
++DIRNAME=$(dirname $0)
++TOOLS=$(dirname $DIRNAME)
++prefix=$(CDPATH= cd -- "${DIRNAME%/tools/geos/*}" && pwd -P)
++exec_prefix=${prefix}
++includedir=${prefix}/include
++libdir=${prefix}${TOOLS##*/geos}/lib
+
+ usage()
+ {
+@@ -47,16 +49,16 @@ while test $# -gt 0; do
+ echo -L${libdir} -lgeos
+ ;;
+ --clibs)
+- echo -L${libdir} -lgeos_c
++ echo -L${libdir} -lgeos_c $(if test "@BUILD_SHARED_LIBS@" != "ON"; then echo "-lgeos @EXTRA_LIBS@"; fi)
+ ;;
+ --cclibs)
+- echo -L${libdir} -lgeos
++ echo -L${libdir} -lgeos $(if test "@BUILD_SHARED_LIBS@" != "ON"; then echo "@EXTRA_LIBS@"; fi)
+ ;;
+ --static-clibs)
+- echo -L${libdir} -lgeos_c -lgeos -lstdc++ -lm
++ echo -L${libdir} -lgeos_c -lgeos @EXTRA_LIBS@
+ ;;
+ --static-cclibs)
+- echo -L${libdir} -lgeos -lstdc++ -lm
++ echo -L${libdir} -lgeos @EXTRA_LIBS@
+ ;;
+ --cflags)
+ echo -I${includedir}