[proj4] Update to 8.1.1, revise features and dependencies (#20443)

* Update to 8.1.1, cleanup patches

* Patch and use pc file installation from upstream

* Simplify dependency fixup

* Remove obsolete VCPKG_BUILD_SHARED_LIBS

* Revise feature and dependency interface

* Update versions

* Use all libs from proj.pc for gdal

* Set CMP0012 for dependency control

* Update versions

* Update versions

* Fix missing user32.lib when using libcrypto

* Update versions

* Fix missing user32.lib when using libcrypto

* Update versions
This commit is contained in:
Kai Pastor 2021-12-10 03:18:18 +01:00 committed by GitHub
parent 45a8674e1d
commit a4f322c567
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 163 additions and 124 deletions

View File

@ -1,9 +1,4 @@
macro(find_dependency_win)
# Setup proj4 libraries + include path
set(PROJ_INCLUDE_DIR "${CURRENT_INSTALLED_DIR}/include")
set(PROJ_LIBRARY_REL "${CURRENT_INSTALLED_DIR}/lib/proj.lib")
set(PROJ_LIBRARY_DBG "${CURRENT_INSTALLED_DIR}/debug/lib/proj_d.lib")
# Setup libpng libraries + include path
set(PNG_INCLUDE_DIR "${CURRENT_INSTALLED_DIR}/include")
set(PNG_LIBRARY_REL "${CURRENT_INSTALLED_DIR}/lib/libpng16.lib" )

View File

@ -29,6 +29,8 @@ if (VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
set(NMAKE_OPTIONS_REL "")
set(NMAKE_OPTIONS_DBG "")
x_vcpkg_pkgconfig_get_modules(PREFIX PROJ MODULES --msvc-syntax proj INCLUDE_DIRS LIBS)
include("${CMAKE_CURRENT_LIST_DIR}/dependency_win.cmake")
find_dependency_win()
@ -43,7 +45,7 @@ if (VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
"HTMLDIR=${NATIVE_HTML_DIR}"
"GEOS_DIR=${GEOS_INCLUDE_DIR}"
"GEOS_CFLAGS=-I${GEOS_INCLUDE_DIR} -DHAVE_GEOS"
"PROJ_INCLUDE=-I${PROJ_INCLUDE_DIR}"
"PROJ_INCLUDE=${PROJ_INCLUDE_DIRS}"
"EXPAT_DIR=${EXPAT_INCLUDE_DIR}"
"EXPAT_INCLUDE=-I${EXPAT_INCLUDE_DIR}"
"CURL_INC=-I${CURL_INCLUDE_DIR}"
@ -86,7 +88,7 @@ if (VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
${NMAKE_OPTIONS}
"GDAL_HOME=${CURRENT_PACKAGES_DIR}"
"CXX_CRT_FLAGS=${LINKAGE_FLAGS}"
"PROJ_LIBRARY=${PROJ_LIBRARY_REL}"
"PROJ_LIBRARY=${PROJ_LIBS_RELEASE}"
"PNG_LIB=${PNG_LIBRARY_REL}"
"GEOS_LIB=${GEOS_LIBRARY_REL}"
"EXPAT_LIB=${EXPAT_LIBRARY_REL}"
@ -103,7 +105,7 @@ if (VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
${NMAKE_OPTIONS}
"GDAL_HOME=${CURRENT_PACKAGES_DIR}/debug"
"CXX_CRT_FLAGS=${LINKAGE_FLAGS}d"
"PROJ_LIBRARY=${PROJ_LIBRARY_DBG}"
"PROJ_LIBRARY=${PROJ_LIBS_DEBUG}"
"PNG_LIB=${PNG_LIBRARY_DBG}"
"GEOS_LIB=${GEOS_LIBRARY_DBG}"
"EXPAT_LIB=${EXPAT_LIBRARY_DBG}"
@ -306,12 +308,7 @@ else()
)
endif()
# proj needs a C++ runtime library
if(VCPKG_TARGET_IS_OSX)
list(APPEND CONF_OPTS "--with-proj-extra-lib-for-test=-lc++")
else()
list(APPEND CONF_OPTS "--with-proj-extra-lib-for-test=-lstdc++")
endif()
x_vcpkg_pkgconfig_get_modules(PREFIX PROJ MODULES proj LIBS)
if("tools" IN_LIST FEATURES)
list(APPEND CONF_OPTS "--with-tools=yes")
@ -324,10 +321,13 @@ else()
AUTOCONFIG
COPY_SOURCE
OPTIONS
${CONF_OPTS}
${CONF_OPTS}
OPTIONS_RELEASE
"--with-proj-extra-lib-for-test=${PROJ_LIBS_RELEASE}"
OPTIONS_DEBUG
--enable-debug
--with-tools=no
--enable-debug
--with-tools=no
"--with-proj-extra-lib-for-test=${PROJ_LIBS_DEBUG}"
)
# Verify configuration results (tightly coupled to vcpkg_configure_make)

View File

@ -1,7 +1,7 @@
{
"name": "gdal",
"version-semver": "3.4.0",
"port-version": 3,
"port-version": 4,
"description": "The Geographic Data Abstraction Library for reading and writing geospatial raster and vector data",
"homepage": "https://gdal.org",
"supports": "!(arm & windows)",
@ -27,6 +27,10 @@
"proj4",
"sqlite3",
"tiff",
{
"name": "vcpkg-pkgconfig-get-modules",
"host": true
},
"zlib",
"zstd"
],

View File

@ -50,6 +50,15 @@ if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
MODULES --msvc-syntax ${pkg_config_modules}
LIBS
)
# vcpkg_build_nmake doesn't supply cmake's implicit link libraries
if(PKGCONFIG_LIBS_DEBUG MATCHES "libcrypto")
string(APPEND PKGCONFIG_LIBS_DEBUG " user32.lib")
endif()
if(PKGCONFIG_LIBS_RELEASE MATCHES "libcrypto")
string(APPEND PKGCONFIG_LIBS_RELEASE " user32.lib")
endif()
string(JOIN " " LIBS_ALL_DEBUG
"/LIBPATH:${CURRENT_INSTALLED_DIR}/debug/lib"
"${PKGCONFIG_LIBS_DEBUG}"

View File

@ -1,7 +1,7 @@
{
"name": "libspatialite",
"version": "5.0.1",
"port-version": 1,
"port-version": 2,
"description": "SpatiaLite is an open source library intended to extend the SQLite core to support fully fledged Spatial SQL capabilities.",
"homepage": "https://www.gaia-gis.it/gaia-sins/libspatialite-sources",
"dependencies": [

View File

@ -26,7 +26,15 @@ index 7d736d129..2be8f8be9 100644
if(NOT SQLITE3_FOUND)
message(SEND_ERROR "sqlite3 dependency not found!")
endif()
@@ -171,6 +186,7 @@ if(ENABLE_CURL)
@@ -151,6 +165,7 @@ if(ENABLE_TIFF)
find_package(TIFF REQUIRED)
if(TIFF_FOUND)
set(TIFF_ENABLED TRUE)
+ set(TIFF_LIBRARY TIFF::TIFF)
else()
message(SEND_ERROR
"libtiff dependency not found! Use ENABLE_TIFF=OFF to force it off")
@@ -171,6 +188,7 @@ if(ENABLE_CURL)
find_package(CURL REQUIRED)
if(CURL_FOUND)
set(CURL_ENABLED TRUE)
@ -34,35 +42,25 @@ index 7d736d129..2be8f8be9 100644
else()
message(SEND_ERROR "curl dependency not found!")
endif()
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index c790fa4a8..6653a28b9 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -95,6 +95,10 @@ endif ()
foreach (PROJECT_VARIANT_NAME ${PROJECT_NAME} ${PROJECT_LEGACY_NAME})
string (TOLOWER "${PROJECT_VARIANT_NAME}" PROJECT_VARIANT_LOWER)
+ set(FIND_DEPENDENCY_SQLITE3 "find_dependency(unofficial-sqlite3 CONFIG)")
+ if(CURL_ENABLED)
+ set(FIND_DEPENDENCY_CURL "find_dependency(CURL CONFIG)")
+ endif()
set (CMAKECONFIGSUBDIR "${CMAKECONFIGDIR}/${PROJECT_VARIANT_LOWER}")
# proj-config.cmake for the install tree. It's installed in
# ${CMAKECONFIGSUBDIR} and @PROJECT_ROOT_DIR@ is the relative
diff --git a/cmake/project-config.cmake.in b/cmake/project-config.cmake.in
index 23f997abd..8baef00f0 100644
--- a/cmake/project-config.cmake.in
+++ b/cmake/project-config.cmake.in
@@ -7,6 +7,10 @@
@@ -7,6 +7,17 @@
# @PROJECT_VARIANT_NAME@_LIBRARY_DIRS = /usr/local/lib
# @PROJECT_VARIANT_NAME@_BINARY_DIRS = /usr/local/bin
# @PROJECT_VARIANT_NAME@_VERSION = 4.9.1 (for example)
+cmake_policy(PUSH)
+cmake_policy(SET CMP0012 NEW)
+include(CMakeFindDependencyMacro)
+
+@FIND_DEPENDENCY_SQLITE3@
+@FIND_DEPENDENCY_CURL@
+find_dependency(unofficial-sqlite3 CONFIG)
+if("@ENABLE_TIFF@")
+ find_dependency(TIFF)
+endif()
+if("@ENABLE_CURL@")
+ find_dependency(CURL CONFIG)
+endif()
+cmake_policy(POP)
# Tell the user project where to find our headers and libraries
get_filename_component (_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)

View File

@ -1,13 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 75c4696..2e8a957 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -110,7 +110,7 @@ include(policies)
################################################################################
# Check for sqlite3
################################################################################
-find_program(EXE_SQLITE3 sqlite3)
+# Use incoming parameter
if(NOT EXE_SQLITE3)
message(SEND_ERROR "sqlite3 binary not found!")
endif()

View File

@ -0,0 +1,53 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 89763d7..f648296 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -342,7 +342,7 @@ install(FILES ${docfiles}
################################################################################
# pkg-config support
################################################################################
-if(UNIX OR MINGW)
+if(1)
configure_proj_pc()
install(FILES
diff --git a/cmake/ProjUtilities.cmake b/cmake/ProjUtilities.cmake
index 2e0db05..46e5de1 100644
--- a/cmake/ProjUtilities.cmake
+++ b/cmake/ProjUtilities.cmake
@@ -76,12 +76,20 @@ function(configure_proj_pc)
set(datadir "$\{datarootdir\}")
set(PACKAGE "proj")
set(VERSION ${PROJ_VERSION})
- set(SQLITE3_LIBS -lsqlite3)
+ set(LIBS_PRIVATE "")
+ if(WIN32 AND NOT MINGW)
+ string(APPEND LIBS_PRIVATE " -lole32 -lshell32")
+ elseif(NOT APPLE OR CMAKE_ANDROID_STL_TYPE MATCHES "^gnu")
+ string(APPEND LIBS_PRIVATE " -lstdc++ -lm")
+ else()
+ string(APPEND LIBS_PRIVATE " -lc++ -lm")
+ endif()
+ set(REQUIRES_PRIVATE "sqlite3")
if(TIFF_ENABLED)
- set(TIFF_LIBS -ltiff)
+ string(APPEND REQUIRES_PRIVATE " libtiff-4")
endif()
if(CURL_ENABLED)
- set(CURL_LIBS -lcurl)
+ string(APPEND REQUIRES_PRIVATE " libcurl")
endif()
configure_file(
diff --git a/proj.pc.in b/proj.pc.in
index 846310d..3feac38 100644
--- a/proj.pc.in
+++ b/proj.pc.in
@@ -10,5 +10,6 @@ Description: Coordinate transformation software library
Requires:
Version: @VERSION@
Libs: -L${libdir} -lproj
-Libs.private: @SQLITE3_LIBS@ @TIFF_LIBS@ @CURL_LIBS@ -lstdc++
+Libs.private: @LIBS_PRIVATE@
+Requires.private: @REQUIRES_PRIVATE@
Cflags: -I${includedir}

View File

@ -1,53 +1,49 @@
set(VERSION 8.0.0) # Variable used for pc file
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO OSGeo/PROJ
REF "${VERSION}"
SHA512 353f0e14ba6c11bfcec8a30b3f322842e8a3103546e0fd40871e341c859ca7ae2b9411425be5b588eb45cc5716255d2ea81d6357407bcfb9506a0edb161376f5
REF 8.1.1
SHA512 a26d4191905ac01ce8052290dbd065038bb59bdf5ee4ead0b8ba948de7fcc9d7bffd897533a07ffc2e9824b59210fa2a6cec652e512794a9ef9b07ce40e7e213
HEAD_REF master
PATCHES
fix-filemanager-uwp.patch
fix-sqlite3-bin.patch
fix-win-output-name.patch
fix-proj4-targets-cmake.patch
tools-cmake.patch
pkgconfig.patch
)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
set(VCPKG_BUILD_SHARED_LIBS ON)
set(EXTRA_FEATURES tiff ENABLE_TIFF tools BUILD_PROJSYNC tools ENABLE_CURL)
set(TOOL_NAMES cct cs2cs geod gie proj projinfo projsync)
else()
set(VCPKG_BUILD_SHARED_LIBS OFF)
set(TOOL_NAMES cct cs2cs geod gie proj projinfo)
endif()
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
net ENABLE_CURL
tiff ENABLE_TIFF
tools BUILD_CCT
tools BUILD_CS2CS
tools BUILD_GEOD
tools BUILD_GIE
tools BUILD_PROJ
tools BUILD_PROJINFO
${EXTRA_FEATURES}
# BUILD_PROJSYNC handled below
)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
message(WARNING "ENABLE_TIFF ENABLE_CURL and BUILD_PROJSYNC will be off when building static")
set(FEATURE_OPTIONS ${FEATURE_OPTIONS} -DENABLE_TIFF=OFF -DENABLE_CURL=OFF -DBUILD_PROJSYNC=OFF)
vcpkg_list(SET TOOL_NAMES cct cs2cs geod gie proj projinfo)
if("net" IN_LIST FEATURES AND "tools" IN_LIST FEATURES)
set(BUILD_PROJSYNC TRUE)
vcpkg_list(APPEND TOOL_NAMES projsync)
else()
set(BUILD_PROJSYNC FALSE)
endif()
vcpkg_list(APPEND FEATURE_OPTIONS -DBUILD_PROJSYNC=${BUILD_PROJSYNC})
set(EXE_SQLITE3 "${CURRENT_HOST_INSTALLED_DIR}/tools/sqlite3${VCPKG_HOST_EXECUTABLE_SUFFIX}")
find_program(EXE_SQLITE3 NAMES "sqlite3" PATHS "${CURRENT_HOST_INSTALLED_DIR}/tools" NO_DEFAULT_PATH REQUIRED)
vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS ${FEATURE_OPTIONS}
-DPROJ_LIB_SUBDIR=lib
-DPROJ_INCLUDE_SUBDIR=include
-DPROJ_DATA_SUBDIR=share/${PORT}
-DBUILD_TESTING=OFF
-DEXE_SQLITE3=${EXE_SQLITE3}
"-DEXE_SQLITE3=${EXE_SQLITE3}"
)
vcpkg_cmake_install()
@ -64,46 +60,10 @@ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
vcpkg_copy_pdbs()
set(PACKAGE "${PORT}")
set(requires_private "sqlite3")
if(ENABLE_CURL)
string(APPEND requires_private " libcurl")
endif()
if(ENABLE_TIFF)
string(APPEND requires_private " libtiff-4")
endif()
set(libs_private "")
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
string(APPEND libs_private " -lole32 -lshell32")
elseif(VCPKG_TARGET_IS_OSX)
string(APPEND libs_private " -lc++ -lm")
else()
string(APPEND libs_private " -lstdc++ -lm")
endif()
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(datarootdir [[${prefix}/share]])
set(datadir [[${prefix}/share]])
set(outfile "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/proj.pc")
configure_file("${SOURCE_PATH}/proj.pc.in" "${outfile}" @ONLY)
vcpkg_replace_string("${outfile}" "Requires:" "Requires.private: ${requires_private}")
vcpkg_replace_string("${outfile}" " -lstdc++" "${libs_private}")
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
set(includedir [[${prefix}/../include]])
set(datarootdir [[${prefix}/../share]])
set(datadir [[${prefix}/../share]])
set(outfile "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/proj.pc")
configure_file("${SOURCE_PATH}/proj.pc.in" "${outfile}" @ONLY)
vcpkg_replace_string("${outfile}" "Requires:" "Requires.private: ${requires_private}")
vcpkg_replace_string("${outfile}" " -lstdc++" "${libs_private}")
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
vcpkg_replace_string("${outfile}" " -lproj" " -lproj_d")
endif()
endif()
vcpkg_fixup_pkgconfig()
if(NOT DEFINED VCPKG_BUILD_TYPE AND VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/proj.pc" " -lproj" " -lproj_d")
endif()
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

View File

@ -1,8 +1,8 @@
{
"name": "proj4",
"version-semver": "8.0.0",
"version-semver": "8.1.1",
"description": "PROJ.4 library for cartographic projections",
"homepage": "https://github.com/OSGeo/PROJ",
"homepage": "https://proj.org/",
"dependencies": [
{
"name": "sqlite3",
@ -25,9 +25,16 @@
}
],
"default-features": [
"net",
"tiff"
],
"features": {
"net": {
"description": "Enable network support",
"dependencies": [
"curl"
]
},
"tiff": {
"description": "Enable TIFF support to read some grids",
"dependencies": [
@ -35,10 +42,7 @@
]
},
"tools": {
"description": "generate tools",
"dependencies": [
"curl"
]
"description": "Build tools"
}
}
}

View File

@ -25,6 +25,14 @@ if (VCPKG_TARGET_IS_WINDOWS)
LIBS
)
# vcpkg_build_nmake doesn't supply cmake's implicit link libraries
if(PKGCONFIG_LIBS_DEBUG MATCHES "libcrypto")
string(APPEND PKGCONFIG_LIBS_DEBUG " user32.lib")
endif()
if(PKGCONFIG_LIBS_RELEASE MATCHES "libcrypto")
string(APPEND PKGCONFIG_LIBS_RELEASE " user32.lib")
endif()
set(ICONV_LIBS "iconv.lib")
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
string(APPEND ICONV_LIBS " charset.lib")

View File

@ -1,6 +1,7 @@
{
"name": "spatialite-tools",
"version-string": "5.0.1",
"version": "5.0.1",
"port-version": 1,
"description": "Contains spatialite.exe and other command line tools to work with SpatiaLite databases (import, export, SQL queries)",
"homepage": "https://www.gaia-gis.it/fossil/spatialite-tools/index",
"dependencies": [

View File

@ -2366,7 +2366,7 @@
},
"gdal": {
"baseline": "3.4.0",
"port-version": 3
"port-version": 4
},
"gdcm": {
"baseline": "3.0.7",
@ -3914,7 +3914,7 @@
},
"libspatialite": {
"baseline": "5.0.1",
"port-version": 1
"port-version": 2
},
"libspnav": {
"baseline": "0.2.3",
@ -5401,7 +5401,7 @@
"port-version": 1
},
"proj4": {
"baseline": "8.0.0",
"baseline": "8.1.1",
"port-version": 0
},
"prometheus-cpp": {
@ -6454,7 +6454,7 @@
},
"spatialite-tools": {
"baseline": "5.0.1",
"port-version": 0
"port-version": 1
},
"spdk": {
"baseline": "19.01.1",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "78bf53bfc83afb261c9eaa60cf2ef9487031b4b1",
"version-semver": "3.4.0",
"port-version": 4
},
{
"git-tree": "164700a47428c2ded10ee9dc8e28fb189fca0f94",
"version-semver": "3.4.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "35cc452ea0fc43d38cfca4d340e47f13c9fd740f",
"version": "5.0.1",
"port-version": 2
},
{
"git-tree": "9a0fe08cf3273de9def88a4fd388a1ade854cfac",
"version": "5.0.1",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "d40a44623b794f07f5362653b6efd7efc16cc832",
"version-semver": "8.1.1",
"port-version": 0
},
{
"git-tree": "f1939ed4483f6f1d75f6ddacb6a741090144bcfb",
"version-semver": "8.0.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "1e91990a5c6a01d86cc1b4cb84bbea812e62b450",
"version": "5.0.1",
"port-version": 1
},
{
"git-tree": "bd6f0ddd2db2c709ce3bd94df91dced9e3d23c7e",
"version-string": "5.0.1",