diff options
| author | Kai Pastor <dg0yt@darc.de> | 2021-10-12 05:51:03 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-11 20:51:03 -0700 |
| commit | 1c91b14312fe00f93e8de55db2b07d25342661c5 (patch) | |
| tree | 9b7b8f79b7cfcf81f4dfd3f12fbfbeb3f448d3fb | |
| parent | 9deacd9e5b92fa94b2dd1e33b2a2dac1a01b8b64 (diff) | |
| download | vcpkg-1c91b14312fe00f93e8de55db2b07d25342661c5.tar.gz vcpkg-1c91b14312fe00f93e8de55db2b07d25342661c5.zip | |
[librttopo] Revise windows build (#20584)
* Use common indentation of 4 spaces
* Minimize makefiles patch
* Fix single-config build
* Install pc file for windows
* Update versions
| -rw-r--r-- | ports/librttopo/fix-makefiles.patch | 26 | ||||
| -rw-r--r-- | ports/librttopo/portfile.cmake | 78 | ||||
| -rw-r--r-- | ports/librttopo/vcpkg.json | 2 | ||||
| -rw-r--r-- | versions/baseline.json | 2 | ||||
| -rw-r--r-- | versions/l-/librttopo.json | 5 |
5 files changed, 61 insertions, 52 deletions
diff --git a/ports/librttopo/fix-makefiles.patch b/ports/librttopo/fix-makefiles.patch index 41c6c8f92..f86d35dd7 100644 --- a/ports/librttopo/fix-makefiles.patch +++ b/ports/librttopo/fix-makefiles.patch @@ -1,8 +1,8 @@ diff --git a/makefile.vc b/makefile.vc -index 1f790f0de..2f7e00f7b 100644 +index 1f790f0..f78d0c9 100644 --- a/makefile.vc +++ b/makefile.vc -@@ -17,11 +17,11 @@ LIBOBJ = src\box2d.obj src\bytebuffer.obj src\g_box.obj \ +@@ -17,7 +17,7 @@ LIBOBJ = src\box2d.obj src\bytebuffer.obj src\g_box.obj \ src\rtout_kml.obj src\rtout_svg.obj src\rtout_twkb.obj src\rtout_wkb.obj \ src\rtout_wkt.obj src\rtout_x3d.obj src\rtpoint.obj src\rtpoly.obj src\rtprint.obj \ src\rtpsurface.obj src\rtspheroid.obj src\rtstroke.obj src\rttin.obj src\rttree.obj \ @@ -11,25 +11,3 @@ index 1f790f0de..2f7e00f7b 100644 LIBRTTOPO_DLL = librttopo$(VERSION).dll --CFLAGS = /nologo -IC:\OSGeo4W\include -I. -Iheaders $(OPTFLAGS) -+CFLAGS = /nologo -I. -Iheaders $(OPTFLAGS) - - default: all - - -diff --git a/nmake.opt b/nmake.opt -index 938979df1..ea80dab00 100644 ---- a/nmake.opt -+++ b/nmake.opt -@@ -1,9 +1,8 @@ - # Directory tree where RTTOPO will be installed. --INSTDIR=C:\OSGeo4W -+INSTDIR=$(INSTALLDIR) - - # Uncomment the first for an optimized build, or the second for debug. --OPTFLAGS= /nologo /Ox /fp:precise /W4 /MD /D_CRT_SECURE_NO_WARNINGS \ -- /DDLL_EXPORT -+OPTFLAGS= /nologo /fp:precise /W4 $(CL_FLAGS) /D_CRT_SECURE_NO_WARNINGS - #OPTFLAGS= /nologo /Zi /MD /Fdlibrttopo.pdb /DDLL_EXPORT - - # Set the version number for the DLL. Normally we leave this blank since diff --git a/ports/librttopo/portfile.cmake b/ports/librttopo/portfile.cmake index a1939b863..1024f3af5 100644 --- a/ports/librttopo/portfile.cmake +++ b/ports/librttopo/portfile.cmake @@ -18,33 +18,59 @@ vcpkg_extract_source_archive_ex( ) 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}" - 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(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}" - AUTOCONFIG - OPTIONS_DEBUG - "--with-geosconfig=${CURRENT_INSTALLED_DIR}/tools/geos/debug/bin/geos-config" - OPTIONS_RELEASE - "--with-geosconfig=${CURRENT_INSTALLED_DIR}/tools/geos/bin/geos-config" - ) - vcpkg_install_make() - vcpkg_fixup_pkgconfig() + 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) + + set(OPTFLAGS "/nologo /fp:precise /W4 /D_CRT_SECURE_NO_WARNINGS /DDLL_EXPORT") + vcpkg_build_nmake( + SOURCE_PATH "${SOURCE_PATH}" + TARGET librttopo.lib + OPTIONS + "OPTFLAGS=${OPTFLAGS}" + "CFLAGS=-I. -Iheaders ${OPTFLAGS}" + ) + + file(GLOB LIBRTTOPO_INCLUDE "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/headers/*.h") + file(COPY ${LIBRTTOPO_INCLUDE} DESTINATION "${CURRENT_PACKAGES_DIR}/include") + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin") + file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/librttopo.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib") + endif() + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin") + file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/librttopo.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib") + endif() + + set(VERSION "${LIBRTTOPO_VERSION_STR}") + set(libdir [[${prefix}/lib]]) + set(exec_prefix [[${prefix}]]) + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + set(includedir [[${prefix}/include]]) + set(outfile "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/rttopo.pc") + configure_file("${SOURCE_PATH}/rttopo.pc.in" "${outfile}" @ONLY) + vcpkg_replace_string("${outfile}" " -lrttopo -lm" " -llibrttopo") + endif() + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + set(includedir [[${prefix}/../include]]) + set(outfile "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/rttopo.pc") + configure_file("${SOURCE_PATH}/rttopo.pc.in" "${outfile}" @ONLY) + vcpkg_replace_string("${outfile}" " -lrttopo -lm" " -llibrttopo") + endif() +else() + vcpkg_configure_make( + SOURCE_PATH "${SOURCE_PATH}" + AUTOCONFIG + OPTIONS_DEBUG + "--with-geosconfig=${CURRENT_INSTALLED_DIR}/tools/geos/debug/bin/geos-config" + OPTIONS_RELEASE + "--with-geosconfig=${CURRENT_INSTALLED_DIR}/tools/geos/bin/geos-config" + ) + vcpkg_install_make() endif() +vcpkg_fixup_pkgconfig() # Handle 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 index 16e12134e..73e72959b 100644 --- a/ports/librttopo/vcpkg.json +++ b/ports/librttopo/vcpkg.json @@ -1,7 +1,7 @@ { "name": "librttopo", "version": "1.1.0", - "port-version": 4, + "port-version": 5, "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": [ diff --git a/versions/baseline.json b/versions/baseline.json index 0d6cb9e7c..1cb4341f3 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -3750,7 +3750,7 @@ }, "librttopo": { "baseline": "1.1.0", - "port-version": 4 + "port-version": 5 }, "libsamplerate": { "baseline": "0.2.2", diff --git a/versions/l-/librttopo.json b/versions/l-/librttopo.json index 88bbabc82..5c3773f05 100644 --- a/versions/l-/librttopo.json +++ b/versions/l-/librttopo.json @@ -1,6 +1,11 @@ { "versions": [ { + "git-tree": "d747c88d429ff781b11627623d0958967f912a41", + "version": "1.1.0", + "port-version": 5 + }, + { "git-tree": "fae3fefb29d1972caa2643351ebf83ca47f7d04a", "version": "1.1.0", "port-version": 4 |
