diff options
| author | Kai Pastor <dg0yt@darc.de> | 2021-09-03 02:54:14 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-02 17:54:14 -0700 |
| commit | 080bd7537fdffc5662f3329bf7436b5a7675f4e4 (patch) | |
| tree | a77ddf18ac77bdf2d8171f8e596582843a13c7c9 /ports/librttopo | |
| parent | 76b6e770a85de59f5dd5e6121dade7b054aa0e1d (diff) | |
| download | vcpkg-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/librttopo')
| -rw-r--r-- | ports/librttopo/CONTROL | 5 | ||||
| -rw-r--r-- | ports/librttopo/fix-geoconfig.patch | 37 | ||||
| -rw-r--r-- | ports/librttopo/fix-pc-file.patch | 9 | ||||
| -rw-r--r-- | ports/librttopo/geos-config.patch | 25 | ||||
| -rw-r--r-- | ports/librttopo/portfile.cmake | 50 | ||||
| -rw-r--r-- | ports/librttopo/vcpkg.json | 10 |
6 files changed, 67 insertions, 69 deletions
diff --git a/ports/librttopo/CONTROL b/ports/librttopo/CONTROL deleted file mode 100644 index c54f902b1..000000000 --- a/ports/librttopo/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: librttopo -Version: 1.1.0-3 -Homepage: https://git.osgeo.org/gitea/rttopo/librttopo -Description: The RT Topology Library exposes an API to create and manage standard (ISO 13249 aka SQL/MM) topologies using user-provided [data stores] (doc/DATASTORES.md) and released under the GNU GPL license (version 2 or later). -Build-Depends: geos diff --git a/ports/librttopo/fix-geoconfig.patch b/ports/librttopo/fix-geoconfig.patch deleted file mode 100644 index db6910c88..000000000 --- a/ports/librttopo/fix-geoconfig.patch +++ /dev/null @@ -1,37 +0,0 @@ -diff --git a/configure.ac b/configure.ac -index a9561069c..7adef1bf5 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -87,6 +87,7 @@ AC_CONFIG_FILES([Makefile \ - #----------------------------------------------------------------------- - # --with-geosconfig - # -+if 0; then - AC_ARG_WITH([geosconfig], - [AS_HELP_STRING([--with-geosconfig=FILE], [specify an alternative geos-config file])], - [GEOSCONFIG="$withval"], [GEOSCONFIG=""]) -@@ -112,6 +113,7 @@ fi - # Extract the linker and include flags - GEOS_LDFLAGS=`$GEOSCONFIG --ldflags` - GEOS_CFLAGS=-I`$GEOSCONFIG --includes` -+fi - AC_SUBST([GEOS_LDFLAGS]) - AC_SUBST([GEOS_CFLAGS]) - # Ensure that we can parse geos_c.h -@@ -120,6 +122,7 @@ CPPFLAGS="$GEOS_CFLAGS" - AC_CHECK_HEADERS([geos_c.h],, [AC_MSG_ERROR([could not find geos_c.h - you may need to specify the directory of a geos-config file using --with-geosconfig])]) - CPPFLAGS="$CPPFLAGS_SAVE" - # Ensure we can link against libgeos_c -+if 0; then - LIBS_SAVE="$LIBS" - LIBS="$GEOS_LDFLAGS" - AC_SEARCH_LIBS(GEOSContext_setErrorMessageHandler_r,geos_c,,AC_MSG_ERROR([could not find libgeos_c (or obsolete 'libgeos_c' < v.3.5.0 found) - you may need to specify the directory of a geos-config file using --with-geosconfig])) -@@ -127,6 +130,8 @@ LIBS="$LIBS_SAVE" - LIBS="$LIBS $GEOS_LDFLAGS -lgeos_c" - GEOS_MAJOR_VERSION=`$GEOSCONFIG --version | cut -d. -f1 | sed 's/[[^0-9]]//g'` - GEOS_MINOR_VERSION=`$GEOSCONFIG --version | cut -d. -f2 | sed 's/[[^0-9]]//g'` -+fi -+LIBS="$LIBS $GEOS_LDFLAGS" - RTGEOM_GEOS_VERSION="$GEOS_MAJOR_VERSION$GEOS_MINOR_VERSION" - AC_DEFINE_UNQUOTED([RTGEOM_GEOS_VERSION], [$RTGEOM_GEOS_VERSION], [GEOS library version]) - AC_SUBST([RTGEOM_GEOS_VERSION]) diff --git a/ports/librttopo/fix-pc-file.patch b/ports/librttopo/fix-pc-file.patch new file mode 100644 index 000000000..12483781b --- /dev/null +++ b/ports/librttopo/fix-pc-file.patch @@ -0,0 +1,9 @@ +diff --git a/rttopo.pc.in b/rttopo.pc.in +index 86c71dc..4064506 100644 +--- a/rttopo.pc.in ++++ b/rttopo.pc.in +@@ -10,3 +10,4 @@ Description: the RT Topology library + Version: @VERSION@ + Libs: -L${libdir} -lrttopo -lm + Cflags: -I${includedir} ++Requires.private: geos diff --git a/ports/librttopo/geos-config.patch b/ports/librttopo/geos-config.patch new file mode 100644 index 000000000..eb6b90506 --- /dev/null +++ b/ports/librttopo/geos-config.patch @@ -0,0 +1,25 @@ +diff --git a/configure.ac b/configure.ac +index a956106..739ee88 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -110,7 +110,7 @@ else + fi + fi + # Extract the linker and include flags +-GEOS_LDFLAGS=`$GEOSCONFIG --ldflags` ++GEOS_LDFLAGS=`$GEOSCONFIG --clibs` + GEOS_CFLAGS=-I`$GEOSCONFIG --includes` + AC_SUBST([GEOS_LDFLAGS]) + AC_SUBST([GEOS_CFLAGS]) +@@ -122,9 +122,9 @@ CPPFLAGS="$CPPFLAGS_SAVE" + # Ensure we can link against libgeos_c + LIBS_SAVE="$LIBS" + LIBS="$GEOS_LDFLAGS" +-AC_SEARCH_LIBS(GEOSContext_setErrorMessageHandler_r,geos_c,,AC_MSG_ERROR([could not find libgeos_c (or obsolete 'libgeos_c' < v.3.5.0 found) - you may need to specify the directory of a geos-config file using --with-geosconfig])) ++AC_SEARCH_LIBS(GEOSContext_setErrorMessageHandler_r,,,AC_MSG_ERROR([could not find libgeos_c (or obsolete 'libgeos_c' < v.3.5.0 found) - you may need to specify the directory of a geos-config file using --with-geosconfig])) + LIBS="$LIBS_SAVE" +-LIBS="$LIBS $GEOS_LDFLAGS -lgeos_c" ++LIBS="$LIBS $GEOS_LDFLAGS" + GEOS_MAJOR_VERSION=`$GEOSCONFIG --version | cut -d. -f1 | sed 's/[[^0-9]]//g'` + GEOS_MINOR_VERSION=`$GEOSCONFIG --version | cut -d. -f2 | sed 's/[[^0-9]]//g'` + RTGEOM_GEOS_VERSION="$GEOS_MAJOR_VERSION$GEOS_MINOR_VERSION" diff --git a/ports/librttopo/portfile.cmake b/ports/librttopo/portfile.cmake index a689b0043..a1939b863 100644 --- a/ports/librttopo/portfile.cmake +++ b/ports/librttopo/portfile.cmake @@ -1,54 +1,50 @@ -vcpkg_check_linkage(ONLY_STATIC_LIBRARY) - # NOTE: update the version and checksum for new LIBRTTOPO release -set(LIBRTTOPO_VERSION_STR "1.1.0-2") -set(LIBRTTOPO_PACKAGE_SUM "cc2f646dd9ac3099c77e621984cdd2baa676ed1d8e6aaa9642afe2855e6fdef585603cc052ca09084204a1325e38bb626133072fbb5080e8adc369cc4854c40e") +set(LIBRTTOPO_VERSION_STR "1.1.0") +set(LIBRTTOPO_PACKAGE_SUM "d9c2f4db1261cc942152d348abb7f03e6053a63b6966e081c5381d40bbebd3c7ca1963224487355f384d7562a90287fb24d7af9e7eda4a1e230ee6441cef5de9") vcpkg_download_distfile(ARCHIVE - URLS "https://salsa.debian.org/debian-gis-team/librttopo/-/archive/debian/${LIBRTTOPO_VERSION_STR}/librttopo-debian-${LIBRTTOPO_VERSION_STR}.tar.gz" - FILENAME "librttopo${LIBRTTOPO_VERSION_STR}.zip" + URLS "https://download.osgeo.org/librttopo/src/librttopo-${LIBRTTOPO_VERSION_STR}.tar.gz" + FILENAME "librttopo-${LIBRTTOPO_VERSION_STR}.tar.gz" SHA512 ${LIBRTTOPO_PACKAGE_SUM} ) vcpkg_extract_source_archive_ex( - ARCHIVE ${ARCHIVE} + ARCHIVE "${ARCHIVE}" OUT_SOURCE_PATH SOURCE_PATH PATCHES fix-makefiles.patch - fix-geoconfig.patch + geos-config.patch + fix-pc-file.patch ) -if (VCPKG_TARGET_IS_WINDOWS) - set(SRID_MAX 999999) - set(SRID_USR_MAX 998999) - configure_file(${CMAKE_CURRENT_LIST_DIR}/rttopo_config.h.in ${SOURCE_PATH}/src/rttopo_config.h @ONLY) - configure_file(${SOURCE_PATH}/headers/librttopo_geom.h.in ${SOURCE_PATH}/headers/librttopo_geom.h @ONLY) +if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + + file(REMOVE "${SOURCE_PATH}/src/rttopo_config.h") + configure_file("${CMAKE_CURRENT_LIST_DIR}/rttopo_config.h.in" "${SOURCE_PATH}/src/rttopo_config.h" @ONLY) vcpkg_build_nmake( - SOURCE_PATH ${SOURCE_PATH} + SOURCE_PATH "${SOURCE_PATH}" TARGET librttopo.lib ) - file(GLOB LIBRTTOPO_INCLUDE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/headers/*.h) - file(COPY ${LIBRTTOPO_INCLUDE} DESTINATION ${CURRENT_PACKAGES_DIR}/include) + file(GLOB LIBRTTOPO_INCLUDE "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/headers/*.h") + file(COPY ${LIBRTTOPO_INCLUDE} DESTINATION "${CURRENT_PACKAGES_DIR}/include") - file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/librttopo.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) - file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/librttopo.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) -else () # Build in UNIX + file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/librttopo.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib") + file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/librttopo.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib") +else() # Build in UNIX vcpkg_configure_make( - SOURCE_PATH ${SOURCE_PATH} + SOURCE_PATH "${SOURCE_PATH}" AUTOCONFIG - OPTIONS - "GEOS_MAJOR_VERSION=3" - "GEOS_MINOR_VERSION=8" OPTIONS_DEBUG - "GEOS_LDFLAGS=-lgeos_cd -lgeosd -lm" + "--with-geosconfig=${CURRENT_INSTALLED_DIR}/tools/geos/debug/bin/geos-config" OPTIONS_RELEASE - "GEOS_LDFLAGS=-lgeos_c -lgeos -lm" + "--with-geosconfig=${CURRENT_INSTALLED_DIR}/tools/geos/bin/geos-config" ) - vcpkg_install_make() + vcpkg_fixup_pkgconfig() endif() # Handle copyright -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/librttopo/vcpkg.json b/ports/librttopo/vcpkg.json new file mode 100644 index 000000000..16e12134e --- /dev/null +++ b/ports/librttopo/vcpkg.json @@ -0,0 +1,10 @@ +{ + "name": "librttopo", + "version": "1.1.0", + "port-version": 4, + "description": "The RT Topology Library exposes an API to create and manage standard (ISO 13249 aka SQL/MM) topologies using user-provided data stores.", + "homepage": "https://git.osgeo.org/gitea/rttopo/librttopo", + "dependencies": [ + "geos" + ] +} |
