aboutsummaryrefslogtreecommitdiff
path: root/ports/geos
diff options
context:
space:
mode:
authorKai Pastor <dg0yt@darc.de>2021-09-03 02:54:14 +0200
committerGitHub <noreply@github.com>2021-09-02 17:54:14 -0700
commit080bd7537fdffc5662f3329bf7436b5a7675f4e4 (patch)
treea77ddf18ac77bdf2d8171f8e596582843a13c7c9 /ports/geos
parent76b6e770a85de59f5dd5e6121dade7b054aa0e1d (diff)
downloadvcpkg-080bd7537fdffc5662f3329bf7436b5a7675f4e4.tar.gz
vcpkg-080bd7537fdffc5662f3329bf7436b5a7675f4e4.zip
[geos,librttopo] Fix linkage and other quirks (#19492)
* [geos] Minor portfile maintenance * [geos] Export implicit C++ lib dependencies * [geos] x-add-version * [librttopo] New port version, format manifest * [librttopo] Modernize portfile * [librttopo] Fix mingw build * [librttopo] Use geos-config, allow dynamic linkage for non-windows * [librttopo] Fix pc file * [librttopo] Use pristine download from osgeo.org * [librttopo] x-add-version
Diffstat (limited to 'ports/geos')
-rw-r--r--ports/geos/fix-static-deps.patch68
-rw-r--r--ports/geos/portfile.cmake3
-rw-r--r--ports/geos/vcpkg.json2
3 files changed, 70 insertions, 3 deletions
diff --git a/ports/geos/fix-static-deps.patch b/ports/geos/fix-static-deps.patch
new file mode 100644
index 000000000..680e185eb
--- /dev/null
+++ b/ports/geos/fix-static-deps.patch
@@ -0,0 +1,68 @@
+diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
+index 8a81a2a..724a68c 100644
+--- a/tools/CMakeLists.txt
++++ b/tools/CMakeLists.txt
+@@ -13,6 +13,15 @@
+
+
+ if(NOT MSVC)
++ # C++ libraries needed even for the C API, for geos-config and geos.pc.
++ set(cxx_libs "")
++ foreach(lib IN ITEMS stdc++ c++)
++ if(lib IN_LIST CMAKE_CXX_IMPLICIT_LINK_LIBRARIES)
++ string(APPEND cxx_libs "-l${lib} ")
++ break()
++ endif()
++ endforeach()
++
+ # Consider CMAKE_INSTALL_PREFIX with spaces
+ string(REPLACE " " "\\ " ESCAPED_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
+ configure_file(
+diff --git a/tools/geos-config.cmake b/tools/geos-config.cmake
+index 4c546b5..4bdbc47 100644
+--- a/tools/geos-config.cmake
++++ b/tools/geos-config.cmake
+@@ -29,6 +29,12 @@ if test $# -eq 0; then
+ usage 1 1>&2
+ fi
+
++if test "@BUILD_SHARED_LIBS@" = "ON"; then
++ extra_libs=
++else
++ extra_libs="-lgeos -lm @cxx_libs@"
++fi
++
+ while test $# -gt 0; do
+ case "$1" in
+ -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+@@ -47,16 +53,16 @@ while test $# -gt 0; do
+ echo -L${libdir} -lgeos-@GEOS_VERSION_MAJOR@
+ ;;
+ --clibs)
+- echo -L${libdir} -lgeos_c
++ echo -L${libdir} -lgeos_c ${extra_libs}
+ ;;
+ --cclibs)
+- echo -L${libdir} -lgeos
++ echo -L${libdir} -lgeos ${extra_libs#-lgeos }
+ ;;
+ --static-clibs)
+- echo -L${libdir} -lgeos_c -lgeos -lm
++ echo -L${libdir} -lgeos_c -lgeos -lm @cxx_libs@
+ ;;
+ --static-cclibs)
+- echo -L${libdir} -lgeos -lm
++ echo -L${libdir} -lgeos -lm @cxx_libs@
+ ;;
+ --cflags)
+ echo -I${prefix}/include
+diff --git a/tools/geos.pc.cmake b/tools/geos.pc.cmake
+index 53f43d9..0ebd4d5 100644
+--- a/tools/geos.pc.cmake
++++ b/tools/geos.pc.cmake
+@@ -9,4 +9,4 @@ Requires:
+ Version: @GEOS_VERSION@
+ Cflags: -I${includedir}
+ Libs: -L${libdir} -lgeos_c
+-Libs.private: -lgeos
++Libs.private: -lgeos @cxx_libs@
diff --git a/ports/geos/portfile.cmake b/ports/geos/portfile.cmake
index a2793f94c..017db4953 100644
--- a/ports/geos/portfile.cmake
+++ b/ports/geos/portfile.cmake
@@ -14,6 +14,7 @@ vcpkg_extract_source_archive_ex(
dont-build-astyle.patch
pc-file-libs-private.patch
make-geos-config-relocatable.patch
+ fix-static-deps.patch
)
# NOTE: GEOS provides CMake as optional build configuration, it might not be actively
@@ -27,7 +28,6 @@ endif()
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
- PREFER_NINJA
OPTIONS
-DCMAKE_DEBUG_POSTFIX=d
-DBUILD_TESTING=OFF
@@ -57,7 +57,6 @@ if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/bin/geos-config")
endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
-file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") # vcpkg-cmake-config quirk, cf. GH-18063
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static" OR NOT VCPKG_TARGET_IS_WINDOWS)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()
diff --git a/ports/geos/vcpkg.json b/ports/geos/vcpkg.json
index f22f38558..0df73d3c4 100644
--- a/ports/geos/vcpkg.json
+++ b/ports/geos/vcpkg.json
@@ -1,7 +1,7 @@
{
"name": "geos",
"version": "3.9.1",
- "port-version": 1,
+ "port-version": 2,
"description": "Geometry Engine Open Source",
"homepage": "https://www.osgeo.org/projects/geos/",
"dependencies": [