diff --git a/ports/gdal/0001-Fix-debug-crt-flags.patch b/ports/gdal/0001-Fix-debug-crt-flags.patch index 1580051f5c7..4640cf7f04d 100644 --- a/ports/gdal/0001-Fix-debug-crt-flags.patch +++ b/ports/gdal/0001-Fix-debug-crt-flags.patch @@ -1,8 +1,14 @@ diff --git a/nmake.opt b/nmake.opt -index 88e197c..308eddd 100644 +index 468d2ba1a..e75a081f7 100644 --- a/nmake.opt +++ b/nmake.opt -@@ -147,11 +147,21 @@ CXX_PDB_FLAGS=/Zi /Fd$(GDAL_PDB) +@@ -148,16 +148,26 @@ GDAL_PDB = $(GDAL_ROOT)\gdal$(VERSION)$(POSTFIX).pdb + !ENDIF + + !IFDEF WITH_PDB +-CXX_PDB_FLAGS=/Zi /Fd$(GDAL_PDB) ++CXX_PDB_FLAGS=/Z7 /Fd$(GDAL_PDB) + !ELSE CXX_PDB_FLAGS= !ENDIF @@ -26,3 +32,12 @@ index 88e197c..308eddd 100644 !ENDIF !ENDIF # OPTFLAGS +@@ -175,7 +185,7 @@ OPTFLAGS= $(CXX_ANALYZE_FLAGS) $(CXX_PDB_FLAGS) /nologo /MP$(CPU_COUNT) /MDd /EH + # 4351: new behavior: elements of array 'array' will be default initialized (needed for https://trac.osgeo.org/gdal/changeset/35593) + # 4611: interaction between '_setjmp' and C++ object destruction is non-portable + # +-WARNFLAGS = /W4 /wd4127 /wd4251 /wd4275 /wd4786 /wd4100 /wd4245 /wd4206 /wd4351 /wd4611 ++WARNFLAGS = /W3 /wd4127 /wd4251 /wd4275 /wd4786 /wd4100 /wd4245 /wd4206 /wd4351 /wd4611 + + !ENDIF + diff --git a/ports/gdal/0005-Fix-cfitsio.patch b/ports/gdal/0004-Fix-cfitsio.patch similarity index 69% rename from ports/gdal/0005-Fix-cfitsio.patch rename to ports/gdal/0004-Fix-cfitsio.patch index 5e3814a3dcb..0a878c07b56 100644 --- a/ports/gdal/0005-Fix-cfitsio.patch +++ b/ports/gdal/0004-Fix-cfitsio.patch @@ -1,13 +1,13 @@ diff --git a/frmts/fits/fitsdataset.cpp b/frmts/fits/fitsdataset.cpp -index 4f41a12..723d211 100644 +index c3f4a4e1f..eb29a92b1 100644 --- a/frmts/fits/fitsdataset.cpp +++ b/frmts/fits/fitsdataset.cpp -@@ -34,7 +34,7 @@ - #include "ogr_spatialref.h" +@@ -38,7 +38,7 @@ + #include "ogrsf_frmts.h" #include -#include +#include + #include #include - #include diff --git a/ports/gdal/0004-Fix-std-fabs.patch b/ports/gdal/0004-Fix-std-fabs.patch deleted file mode 100644 index 08fb21ce7bf..00000000000 --- a/ports/gdal/0004-Fix-std-fabs.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/ogr/ogrlinestring.cpp b/ogr/ogrlinestring.cpp -index 1e16d9f..cf7ced1 100644 ---- a/ogr/ogrlinestring.cpp -+++ b/ogr/ogrlinestring.cpp -@@ -35,6 +35,7 @@ - #include - #include - #include -+#include - - CPL_CVSID("$Id: ogrlinestring.cpp ad9178b63f501e9840d86a3220c9e5100c6e3fa2 2019-10-21 13:19:06 +0200 Even Rouault $") - diff --git a/ports/gdal/0005-Fix-configure.patch b/ports/gdal/0005-Fix-configure.patch new file mode 100644 index 00000000000..3883ed96bd9 --- /dev/null +++ b/ports/gdal/0005-Fix-configure.patch @@ -0,0 +1,222 @@ +diff --git a/configure.ac b/configure.ac +index bd85e0616..c45b0f74a 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1275,10 +1275,10 @@ AC_MSG_CHECKING([for libtiff]) + if test "x${with_libtiff}" = "xyes" -o "x${with_libtiff}" = "x" ; then + + dnl Only automatically pick up the external libtiff if it is >= 4.0. +- AC_CHECK_LIB(tiff,TIFFScanlineSize64,TIFF_SETTING=external HAVE_BIGTIFF=yes,TIFF_SETTING=internal HAVE_BIGTIFF=yes,) ++ AC_SEARCH_LIBS(TIFFScanlineSize64,[tiffd tiff],TIFF_SETTING=external HAVE_BIGTIFF=yes,TIFF_SETTING=internal HAVE_BIGTIFF=yes,-ljpeg) + + if test "$TIFF_SETTING" = "external" ; then +- LIBS="-ltiff $LIBS" ++ LIBS="-ljpeg $LIBS" + AC_MSG_RESULT([using pre-installed libtiff.]) + else + AC_MSG_RESULT([using internal TIFF code.]) +@@ -1338,18 +1338,12 @@ if test "`basename xx/$with_curl`" = "curl-config" ; then + elif test "$with_curl" = "no" ; then + LIBCURL_CONFIG=no + else +- AC_PATH_PROG(LIBCURL_CONFIG, curl-config, no) ++ LIBCURL_CONFIG=yes + fi + + if test "$LIBCURL_CONFIG" != "no" ; then + +- CURL_VERNUM=`$LIBCURL_CONFIG --vernum` +- CURL_VER=`$LIBCURL_CONFIG --version | awk '{print $2}'` +- +- AC_MSG_RESULT([ found libcurl version $CURL_VER]) +- +- AC_CHECK_LIB(curl,curl_global_init,CURL_SETTING=yes,CURL_SETTING=no,`$LIBCURL_CONFIG --libs`) +- ++ AC_SEARCH_LIBS(curl_global_init,[curl-d curl],CURL_SETTING=yes,CURL_SETTING=no,) + fi + + AC_SUBST(CURL_SETTING,$CURL_SETTING) +@@ -1512,12 +1506,12 @@ elif test "$with_spatialite" = "yes"; then + AC_CHECK_HEADERS(sqlite3.h) + if test "$ac_cv_header_sqlite3_h" = "yes"; then + AC_MSG_CHECKING([for spatialite.h in /usr/include or /usr/local/include]) +- if test -f "/usr/include/spatialite.h" -o -f "/usr/local/include/spatialite.h"; then ++ if test -f "$prefix/../include/spatialite.h" -o -f "$prefix/include/spatialite.h" -o -f "/usr/include/spatialite.h" -o -f "/usr/local/include/spatialite.h"; then + AC_MSG_RESULT(found) +- AC_CHECK_LIB(spatialite,spatialite_init,SPATIALITE_INIT_FOUND=yes,SPATIALITE_INIT_FOUND=no,-lsqlite3) ++ AC_CHECK_LIB(spatialite,spatialite_init,SPATIALITE_INIT_FOUND=yes,SPATIALITE_INIT_FOUND=no,-lsqlite3 -lrttopo -lfreexl) + if test "$SPATIALITE_INIT_FOUND" = "yes"; then + HAVE_SPATIALITE=yes +- SPATIALITE_LIBS="-lspatialite -lsqlite3" ++ SPATIALITE_LIBS="-lspatialite -lsqlite3 -lrttopo -lfreexl" + LIBS="$LIBS $SPATIALITE_LIBS" + HAVE_SQLITE3=yes + fi +@@ -1570,11 +1564,15 @@ dnl --------------------------------------------------------------------------- + AC_ARG_WITH(liblzma,[ --with-liblzma[=ARG] Include liblzma support (ARG=yes/no)],,) + + if test "$with_liblzma" = "yes" ; then +- AC_CHECK_LIB(lzma,lzma_code,LIBLZMA_SETTING=yes,LIBLZMA_SETTING=no,) ++ SAVED_LIBS="$LIBS" ++ LIBS="" ++ AC_SEARCH_LIBS(lzma_code,[lzmad lzma],LIBLZMA_SETTING=yes,LIBLZMA_SETTING=no,) + AC_CHECK_HEADERS(lzma.h) ++ LZMA_LIBS="$LIBS" ++ LIBS="$SAVED_LIBS" + + if test "$LIBLZMA_SETTING" = "yes" -a "$ac_cv_header_lzma_h" = "yes" ; then +- LIBS="-llzma $LIBS" ++ LIBS="$LZMA_LIBS $LIBS" + else + LIBLZMA_SETTING=no + fi +@@ -1592,11 +1590,9 @@ dnl --------------------------------------------------------------------------- + AC_ARG_WITH(zstd,[ --with-zstd[=ARG] Include zstd support (ARG=yes/no/installation_prefix)],,) + + if test "$with_zstd" = "" -o "$with_zstd" = "yes" ; then +- AC_CHECK_LIB(zstd,ZSTD_decompressStream,ZSTD_SETTING=yes,ZSTD_SETTING=no,) ++ AC_SEARCH_LIBS(ZSTD_decompressStream,[zstdd zstd],ZSTD_SETTING=yes,ZSTD_SETTING=no,) + +- if test "$ZSTD_SETTING" = "yes" ; then +- LIBS="-lzstd $LIBS" +- else ++ if test "$ZSTD_SETTING" != "yes" ; then + if test "$with_zstd" = "yes" ; then + AC_MSG_ERROR([libzstd not found]) + else +@@ -1820,8 +1816,6 @@ fi + + if test "$CURL_SETTING" = "yes" ; then + +- CURL_INC=`$LIBCURL_CONFIG --cflags` +- CURL_LIB=`$LIBCURL_CONFIG --libs` + m4_foreach_w([frmt],CURL_FORMATS,[ + driver_enabled=m4_join([_],[$INTERNAL_FORMAT],frmt,[ENABLED]) + if test "x$driver_enabled" = "xyes"; then +@@ -1888,7 +1882,7 @@ else + PKG_CHECK_MODULES([PQ],[libpq > 9.1], [HAVE_PG=yes], [HAVE_PG=no]) + + if test "${HAVE_PG}" = "yes" ; then +- PG_LIB="${PQ_LIBS}" ++ PG_LIB="${PQ_LIBS} -lpgcommon -lpgport" + PG_INC="${PQ_CFLAGS}" + SAVED_LIBS="${LIBS}" + LIBS="${PG_LIB}" +@@ -4287,13 +4281,13 @@ if test "x$with_xml2" = "xyes" -o "x$with_xml2" = "x" ; then + if test "${HAVE_LIBXML2}" = "yes"; then + SAVED_LIBS="${LIBS}" + LIBS="${LIBXML2_LIBS}" +- AC_CHECK_LIB(xml2,xmlParseDoc,HAVE_LIBXML2=yes,HAVE_LIBXML2=no) ++ AC_CHECK_LIB(xml2,xmlParseDoc,HAVE_LIBXML2=yes,HAVE_LIBXML2=no,-lz -lm $LZMA_LIBS) + LIBS="${SAVED_LIBS}" + fi + + if test "${HAVE_LIBXML2}" = "yes"; then + LIBXML2_INC="${LIBXML2_CFLAGS}" +- LIBXML2_LIB="${LIBXML2_LIBS}" ++ LIBXML2_LIB="${LIBXML2_LIBS} -lz -lm $LZMA_LIBS" + else + if test "x$with_xml2" = "xyes"; then + AC_MSG_ERROR([--with-xml2 was requested, but libxml2 is not available]) +@@ -4817,8 +4811,7 @@ if test "$with_libjson_c" = "external" -o "$with_libjson_c" = "" -o "$with_libjs + elif test "$with_libjson_c" = "internal" ; then + LIBJSONC_SETTING=internal + elif test "$with_libjson_c" != "no"; then +- LIBS="-L$with_libjson_c/lib $LIBS" +- AC_CHECK_LIB(json-c,json_object_set_serializer,LIBJSONC_SETTING=external,LIBJSONC_SETTING=internal,-L$with_libjson_c/lib) ++ AC_CHECK_LIB(json-c,json_object_set_serializer,LIBJSONC_SETTING=external,LIBJSONC_SETTING=internal,) + else + AC_MSG_ERROR([libjson-c (internal or external) is required]) + fi + +diff --git a/m4/ax_lib_sqlite3.m4 b/m4/ax_lib_sqlite3.m4 +index e53a4a967..440e2c5ed 100644 +--- a/m4/ax_lib_sqlite3.m4 ++++ b/m4/ax_lib_sqlite3.m4 +@@ -76,23 +76,22 @@ AC_DEFUN([AX_LIB_SQLITE3], + + unset ac_cv_lib_sqlite3_sqlite3_open + saved_LIBS="$LIBS" +- LIBS="" + AC_CHECK_LIB(sqlite3,sqlite3_open,LIB_SQLITE3_FOUND=yes,LIB_SQLITE3_FOUND=no,-L$ac_sqlite3_path/lib) + LIBS="$saved_LIBS" + if test "$LIB_SQLITE3_FOUND" = "yes"; then + ac_sqlite3_ldflags="-L$ac_sqlite3_path/lib" + fi + ++ ac_sqlite3_include_path="$ac_sqlite3_path/include" + ac_sqlite3_cppflags="-I$ac_sqlite3_path/include" + else +- for ac_sqlite3_path_tmp in /usr /usr/local /opt ; do +- if test -f "$ac_sqlite3_path_tmp/include/$ac_sqlite3_header" \ +- && test -r "$ac_sqlite3_path_tmp/include/$ac_sqlite3_header"; then ++ for ac_sqlite3_path_tmp in $prefix /usr /usr/local /opt; do ++ if (test -f "$ac_sqlite3_path_tmp/include/$ac_sqlite3_header" \ ++ && test -r "$ac_sqlite3_path_tmp/include/$ac_sqlite3_header") || (test -f "$ac_sqlite3_path_tmp/../include/$ac_sqlite3_header" && test -r "$ac_sqlite3_path_tmp/../include/$ac_sqlite3_header"); then + ac_sqlite3_path=$ac_sqlite3_path_tmp + + unset ac_cv_lib_sqlite3_sqlite3_open + saved_LIBS="$LIBS" +- LIBS="" + AC_CHECK_LIB(sqlite3,sqlite3_open,LIB_SQLITE3_FOUND=yes,LIB_SQLITE3_FOUND=no,) + LIBS="$saved_LIBS" + if test "$LIB_SQLITE3_FOUND" = "yes"; then +@@ -100,7 +99,6 @@ AC_DEFUN([AX_LIB_SQLITE3], + else + unset ac_cv_lib_sqlite3_sqlite3_open + saved_LIBS="$LIBS" +- LIBS="" + AC_CHECK_LIB(sqlite3,sqlite3_open,LIB_SQLITE3_FOUND=yes,LIB_SQLITE3_FOUND=no,-L$ac_sqlite3_path_tmp/lib) + LIBS="$saved_LIBS" + if test "$LIB_SQLITE3_FOUND" = "yes"; then +@@ -108,7 +106,12 @@ AC_DEFUN([AX_LIB_SQLITE3], + fi + fi + +- ac_sqlite3_cppflags="-I$ac_sqlite3_path_tmp/include" ++ if test -f "$ac_sqlite3_path_tmp/include/$ac_sqlite3_header" && test -r "$ac_sqlite3_path_tmp/include/$ac_sqlite3_header"; then ++ ac_sqlite3_include_path="$ac_sqlite3_path_tmp/include" ++ else ++ ac_sqlite3_include_path="$ac_sqlite3_path_tmp/../include" ++ fi ++ ac_sqlite3_cppflags="-I$ac_sqlite3_include_path" + break; + fi + done +@@ -122,7 +125,6 @@ AC_DEFUN([AX_LIB_SQLITE3], + AC_MSG_CHECKING([for SQLite3 library >= $sqlite3_version_req]) + + if test "x$WANT_SQLITE3" = "xyes"; then +- + ac_sqlite3_ldflags="$ac_sqlite3_ldflags -lsqlite3" + + saved_CPPFLAGS="$CPPFLAGS" +@@ -161,7 +163,7 @@ AC_DEFUN([AX_LIB_SQLITE3], + SQLITE3_CFLAGS="$ac_sqlite3_cppflags" + SQLITE3_LDFLAGS="$ac_sqlite3_ldflags" + +- ac_sqlite3_header_path="$ac_sqlite3_path/include/$ac_sqlite3_header" ++ ac_sqlite3_header_path="$ac_sqlite3_include_path/$ac_sqlite3_header" + + dnl Retrieve SQLite release version + if test "x$ac_sqlite3_header_path" != "x"; then +@@ -184,5 +186,6 @@ AC_DEFUN([AX_LIB_SQLITE3], + else + AC_MSG_RESULT([disabled]) + fi ++ unset ac_sqlite3_include_path + ]) + + +diff --git a/m4/geos.m4 b/m4/geos.m4 +index a410673b4..c16e1f33a 100644 +--- a/m4/geos.m4 ++++ b/m4/geos.m4 +@@ -60,6 +60,7 @@ AC_DEFUN([GEOS_INIT],[ + + AC_PATH_PROG(GEOS_CONFIG, geos-config, no) + ac_geos_config_auto=yes ++ HAVE_GEOS="yes" + + else + diff --git a/ports/gdal/dependency_win.cmake b/ports/gdal/dependency_win.cmake index c18bc9b2d12..6bb6202d2f0 100644 --- a/ports/gdal/dependency_win.cmake +++ b/ports/gdal/dependency_win.cmake @@ -16,8 +16,8 @@ macro(find_dependency_win) # Setup geos libraries + include path set(GEOS_INCLUDE_DIR "${CURRENT_INSTALLED_DIR}/include" ) - set(GEOS_LIBRARY_REL "${CURRENT_INSTALLED_DIR}/lib/geos_c.lib" ) - set(GEOS_LIBRARY_DBG "${CURRENT_INSTALLED_DIR}/debug/lib/geos_cd.lib" ) + set(GEOS_LIBRARY_REL "${CURRENT_INSTALLED_DIR}/lib/geos_c.lib ${CURRENT_INSTALLED_DIR}/lib/geos.lib" ) + set(GEOS_LIBRARY_DBG "${CURRENT_INSTALLED_DIR}/debug/lib/geos_cd.lib ${CURRENT_INSTALLED_DIR}/debug/lib/geosd.lib" ) # Setup expat libraries + include path set(EXPAT_INCLUDE_DIR "${CURRENT_INSTALLED_DIR}/include" ) @@ -90,6 +90,123 @@ macro(find_dependency_win) set(ICONV_LIBRARY_REL "${CURRENT_INSTALLED_DIR}/lib/iconv.lib ${CURRENT_INSTALLED_DIR}/lib/charset.lib" ) set(ICONV_LIBRARY_DBG "${CURRENT_INSTALLED_DIR}/debug/lib/iconv.lib ${CURRENT_INSTALLED_DIR}/debug/lib/charset.lib" ) + # Setup jpeg libraries + if(EXISTS "${CURRENT_INSTALLED_DIR}/lib/jpeg.lib") + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/include" JPEG_INCLUDE) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/jpeg.lib" JPEG_LIBRARY_REL) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/jpegd.lib" JPEG_LIBRARY_DBG) + list(APPEND NMAKE_OPTIONS JPEG_EXTERNAL_LIB=1) + list(APPEND NMAKE_OPTIONS JPEGDIR=${JPEG_INCLUDE}) + list(APPEND NMAKE_OPTIONS_REL JPEG_LIB=${JPEG_LIBRARY_REL}) + list(APPEND NMAKE_OPTIONS_DBG JPEG_LIB=${JPEG_LIBRARY_DBG}) + endif() + + # Setup zstd libraries + if(EXISTS "${CURRENT_INSTALLED_DIR}/lib/zstd.lib") + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/include" ZSTD_INCLUDE) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/zstd.lib" ZSTD_LIBRARY_REL) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/zstdd.lib" ZSTD_LIBRARY_DBG) + list(APPEND NMAKE_OPTIONS ZSTD_CFLAGS=-I${ZSTD_INCLUDE}) + list(APPEND NMAKE_OPTIONS_REL ZSTD_LIBS=${ZSTD_LIBRARY_REL}) + list(APPEND NMAKE_OPTIONS_DBG ZSTD_LIBS=${ZSTD_LIBRARY_DBG}) + endif() + + # Setup tiff libraries + if(EXISTS "${CURRENT_INSTALLED_DIR}/lib/tiff.lib") + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/include" TIFF_INCLUDE) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/tiff.lib" TIFF_LIBRARY_REL) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/tiffd.lib" TIFF_LIBRARY_DBG) + list(APPEND NMAKE_OPTIONS TIFF_INC=-I${TIFF_INCLUDE}) + list(APPEND NMAKE_OPTIONS TIFF_OPTS=-DBIGTIFF_SUPPORT) + list(APPEND NMAKE_OPTIONS_REL TIFF_LIB=${TIFF_LIBRARY_REL}) + list(APPEND NMAKE_OPTIONS_DBG TIFF_LIB=${TIFF_LIBRARY_DBG}) + endif() + + # Setup geotiff libraries + if(EXISTS "${CURRENT_INSTALLED_DIR}/lib/geotiff_i.lib") + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/include" GEOTIFF_INCLUDE) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/geotiff_i.lib" GEOTIFF_LIBRARY_REL) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/geotiff_d_i.lib" GEOTIFF_LIBRARY_DBG) + list(APPEND NMAKE_OPTIONS GEOTIFF_INC=-I${GEOTIFF_INCLUDE}) + list(APPEND NMAKE_OPTIONS_REL GEOTIFF_LIB=${GEOTIFF_LIBRARY_REL}) + list(APPEND NMAKE_OPTIONS_DBG GEOTIFF_LIB=${GEOTIFF_LIBRARY_DBG}) + endif() + + # Setup Xerces libraries + if(EXISTS "${CURRENT_INSTALLED_DIR}/lib/xerces-c_3.lib") + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}" XERCES_DIR) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/include" XERCES_INCLUDE) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/xerces-c_3.lib" XERCES_LIBRARY_REL) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/xerces-c_3D.lib" XERCES_LIBRARY_DBG) + list(APPEND NMAKE_OPTIONS ILI_ENABLED=YES) + list(APPEND NMAKE_OPTIONS XERCES_DIR=${XERCES_DIR}) + list(APPEND NMAKE_OPTIONS "XERCES_INCLUDE=-I${XERCES_INCLUDE} -I${XERCES_INCLUDE}/xercesc") + list(APPEND NMAKE_OPTIONS_REL XERCES_LIB=${XERCES_LIBRARY_REL}) + list(APPEND NMAKE_OPTIONS_DBG XERCES_LIB=${XERCES_LIBRARY_DBG}) + endif() + + # Setup freexl libraries + if(EXISTS "${CURRENT_INSTALLED_DIR}/lib/freexl.lib") + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/include" FREEXL_INCLUDE) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/freexl.lib" FREEXL_LIBRARY_REL) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/freexl.lib" FREEXL_LIBRARY_DBG) + list(APPEND NMAKE_OPTIONS FREEXL_CFLAGS=-I${FREEXL_INCLUDE}) + list(APPEND NMAKE_OPTIONS_REL FREEXL_LIBS=${FREEXL_LIBRARY_REL}) + list(APPEND NMAKE_OPTIONS_DBG FREEXL_LIBS=${FREEXL_LIBRARY_DBG}) + endif() + + # Setup Cryptopp libraries + if(EXISTS "${CURRENT_INSTALLED_DIR}/lib/cryptopp-static.lib") + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/include" CRYPTOPP_INCLUDE) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/cryptopp-static.lib" CRYPTOPP_LIBRARY_REL) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/cryptopp-static.lib" CRYPTOPP_LIBRARY_DBG) + list(APPEND NMAKE_OPTIONS CRYPTOPP_INC=-I${CRYPTOPP_INCLUDE}) + list(APPEND NMAKE_OPTIONS_REL CRYPTOPP_LIB=${CRYPTOPP_LIBRARY_REL}) + list(APPEND NMAKE_OPTIONS_DBG CRYPTOPP_LIB=${CRYPTOPP_LIBRARY_DBG}) + endif() + + # Setup netcdf libraries + if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + if(EXISTS "${CURRENT_INSTALLED_DIR}/lib/netcdf.lib") + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/include" NETCDF_INCLUDE) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/netcdf.lib" NETCDF_LIBRARY_REL) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/netcdf.lib" NETCDF_LIBRARY_DBG) + list(APPEND NMAKE_OPTIONS NETCDF_PLUGIN=NO) + list(APPEND NMAKE_OPTIONS NETCDF_SETTING=yes) + list(APPEND NMAKE_OPTIONS NETCDF_INC_DIR=${NETCDF_INCLUDE}) + list(APPEND NMAKE_OPTIONS_REL NETCDF_LIB=${NETCDF_LIBRARY_REL}) + list(APPEND NMAKE_OPTIONS_DBG NETCDF_LIB=${NETCDF_LIBRARY_DBG}) + endif() + endif() + + # Setup libkml libraries + if(EXISTS "${CURRENT_INSTALLED_DIR}/lib/kmlbase.lib") + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}" LIBKML_DIR) + list(APPEND NMAKE_OPTIONS LIBKML_DIR=${LIBKML_DIR}) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/include" LIBKML_INCLUDE) + list(APPEND NMAKE_OPTIONS LIBKML_INCLUDE=-I${LIBKML_INCLUDE}) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/kmlbase.lib" KMLBASE_REL) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/kmlbase.lib" KMLBASE_DBG) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/kmlconvenience.lib" KMLCONVENIENCE_REL) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/kmlconvenience.lib" KMLCONVENIENCE_DBG) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/kmldom.lib" KMLDOM_REL) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/kmldom.lib" KMLDOM_DBG) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/kmlengine.lib" KMLENGINE_REL) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/kmlengine.lib" KMLENGINE_DBG) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/kmlregionator.lib" KMLREGIONATOR_REL) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/kmlregionator.lib" KMLREGIONATOR_DBG) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/kmlxsd.lib" KMLXSD_REL) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/kmlxsd.lib" KMLXSD_DBG) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/bz2.lib" BZIP2_REL) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/bz2d.lib" BZIP2_DBG) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/minizip.lib" MINIZIP_REL) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/minizip.lib" MINIZIP_DBG) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/uriparser.lib" URIPARSER_REL) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/uriparser.lib" URIPARSER_DBG) + list(APPEND NMAKE_OPTIONS_REL "LIBKML_LIBS=${KMLBASE_REL} ${KMLCONVENIENCE_REL} ${KMLDOM_REL} ${KMLENGINE_REL} ${KMLREGIONATOR_REL} ${KMLXSD_REL} ${BZIP2_REL} ${MINIZIP_REL} ${URIPARSER_REL} ${EXPAT_LIBRARY_REL} ${ZLIB_LIBRARY_REL}") + list(APPEND NMAKE_OPTIONS_DBG "LIBKML_LIBS=${KMLBASE_DBG} ${KMLCONVENIENCE_DBG} ${KMLDOM_DBG} ${KMLENGINE_DBG} ${KMLREGIONATOR_DBG} ${KMLXSD_DBG} ${BZIP2_DBG} ${MINIZIP_DBG} ${URIPARSER_DBG} ${EXPAT_LIBRARY_DBG} ${ZLIB_LIBRARY_DBG}") + endif() + if("mysql-libmysql" IN_LIST FEATURES OR "mysql-libmariadb" IN_LIST FEATURES) # Setup MySQL libraries + include path if("mysql-libmysql" IN_LIST FEATURES) @@ -108,8 +225,13 @@ macro(find_dependency_win) if ("libspatialite" IN_LIST FEATURES) # Setup spatialite libraries + include path set(SPATIALITE_INCLUDE_DIR "${CURRENT_INSTALLED_DIR}/include/spatialite" ) - set(SPATIALITE_LIBRARY_REL "${CURRENT_INSTALLED_DIR}/lib/spatialite.lib" ) - set(SPATIALITE_LIBRARY_DBG "${CURRENT_INSTALLED_DIR}/debug/lib/spatialite.lib" ) + if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + set(SPATIALITE_LIBRARY_REL "${CURRENT_INSTALLED_DIR}/lib/librttopo.lib" "${CURRENT_INSTALLED_DIR}/lib/spatialite.lib") + set(SPATIALITE_LIBRARY_DBG "${CURRENT_INSTALLED_DIR}/debug/lib/librttopo.lib" "${CURRENT_INSTALLED_DIR}/debug/lib/spatialite.lib") + else() + set(SPATIALITE_LIBRARY_REL "${CURRENT_INSTALLED_DIR}/lib/spatialite.lib" ) + set(SPATIALITE_LIBRARY_DBG "${CURRENT_INSTALLED_DIR}/debug/lib/spatialite.lib" ) + endif() set(HAVE_SPATIALITE "-DHAVE_SPATIALITE") endif() -endmacro() +endmacro() \ No newline at end of file diff --git a/ports/gdal/portfile.cmake b/ports/gdal/portfile.cmake index 5b138f8a1f7..f2a102a20c2 100644 --- a/ports/gdal/portfile.cmake +++ b/ports/gdal/portfile.cmake @@ -4,10 +4,10 @@ include(${CMAKE_CURRENT_LIST_DIR}/dependency_win.cmake) vcpkg_fail_port_install(ON_ARCH "arm") # NOTE: update the version and checksum for new GDAL release -set(GDAL_VERSION_STR "3.1.3") -set(GDAL_VERSION_PKG "313") +set(GDAL_VERSION_STR "3.2.2") +set(GDAL_VERSION_PKG "322") set(GDAL_VERSION_LIB "204") -set(GDAL_PACKAGE_SUM "a6dad37813eecb5e0c888ec940cf7f83c5096e69e4f33a3e5a5557542e7f656b9726e470e1b5d3d035de53df065510931a436a8c889f1366abd630c1cf5dfb49") +set(GDAL_PACKAGE_SUM "ce319e06c78bd076228b3710c127cdbd37c7d6fb23966b47df7287eaffe86a05d4ddcc78494c8bfcaf4db98a71f2ed50a01fb3ca2fe1c10cf0d2e812683c8e53") vcpkg_download_distfile(ARCHIVE URLS "http://download.osgeo.org/gdal/${GDAL_VERSION_STR}/gdal${GDAL_VERSION_PKG}.zip" @@ -15,11 +15,11 @@ vcpkg_download_distfile(ARCHIVE SHA512 ${GDAL_PACKAGE_SUM} ) -set(GDAL_PATCHES 0001-Fix-debug-crt-flags.patch 0002-Fix-build.patch) +set(GDAL_PATCHES 0001-Fix-debug-crt-flags.patch 0002-Fix-build.patch 0005-Fix-configure.patch) if (VCPKG_LIBRARY_LINKAGE STREQUAL "static") list(APPEND GDAL_PATCHES 0003-Fix-static-build.patch) endif() -list(APPEND GDAL_PATCHES 0004-Fix-std-fabs.patch 0005-Fix-cfitsio.patch) +list(APPEND GDAL_PATCHES 0004-Fix-cfitsio.patch) vcpkg_extract_source_archive_ex( ARCHIVE ${ARCHIVE} @@ -40,6 +40,7 @@ if (VCPKG_TARGET_IS_WINDOWS) endif() list(APPEND NMAKE_OPTIONS + # VERSION=${GDAL_VERSION_LIB} DATADIR=${NATIVE_DATA_DIR} HTMLDIR=${NATIVE_HTML_DIR} GEOS_DIR=${GEOS_INCLUDE_DIR} @@ -136,6 +137,7 @@ if (VCPKG_TARGET_IS_WINDOWS) if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) list(APPEND GDAL_EXES gdal_contour + gdal_create gdal_grid gdal_rasterize gdal_translate @@ -149,7 +151,6 @@ if (VCPKG_TARGET_IS_WINDOWS) gdalmanage gdalmdiminfo gdalmdimtranslate - gdalserver gdalsrsinfo gdaltindex gdaltransform @@ -190,21 +191,45 @@ else() set(BUILD_DYNAMIC no) set(BUILD_STATIC yes) endif() - + set(CONF_OPTS --enable-shared=${BUILD_DYNAMIC} --enable-static=${BUILD_STATIC}) - list(APPEND CONF_OPTS --with-proj=${CURRENT_INSTALLED_DIR} --with-libjson-c=${CURRENT_INSTALLED_DIR} --without-freexl) - list(APPEND CONF_OPTS --without-jasper) - + list(APPEND CONF_OPTS --with-proj=yes --with-libjson-c=${CURRENT_INSTALLED_DIR}) + list(APPEND CONF_OPTS --with-libtiff=yes --with-geotiff=yes) + list(APPEND CONF_OPTS --with-pg=yes --with-liblzma=yes) + + if ("libspatialite" IN_LIST FEATURES) + list(APPEND CONF_OPTS --with-spatialite=yes) + else() + list(APPEND CONF_OPTS --with-spatialite=no) + endif() + + if(VCPKG_TARGET_IS_LINUX) + set(DEPENDLIBS "-lstdc++") + else() + set(DEPENDLIBS "-lc++ -liconv -llber -lldap -framework CoreFoundation -framework Security") + endif() + + list(APPEND OPTIONS_RELEASE + "LIBS=-pthread ${DEPENDLIBS} -lssl -lcrypto -lgeos_c -lgeos -llzma -lszip" + ) + list(APPEND OPTIONS_DEBUG + "LIBS=-pthread ${DEPENDLIBS} -lssl -lcrypto -lgeos_cd -lgeosd -llzmad -lszip_debug" + ) + vcpkg_configure_make( SOURCE_PATH ${SOURCE_PATH} AUTOCONFIG COPY_SOURCE - OPTIONS ${CONF_OPTS} + OPTIONS + ${CONF_OPTS} + "GEOS_VERSION=3.9.0" + OPTIONS_RELEASE + ${OPTIONS_RELEASE} OPTIONS_DEBUG --enable-debug - --without-fit # Disable cfitsio temporary + ${OPTIONS_DEBUG} ) - + vcpkg_install_make(MAKEFILE GNUmakefile) file(REMOVE_RECURSE diff --git a/ports/gdal/vcpkg.json b/ports/gdal/vcpkg.json index b485a220262..971e9b205f3 100644 --- a/ports/gdal/vcpkg.json +++ b/ports/gdal/vcpkg.json @@ -1,14 +1,15 @@ { "name": "gdal", - "version-string": "3.1.3", - "port-version": 4, - "description": "The Geographic Data Abstraction Library for reading and writing geospatial raster and vector data.", - "homepage": "hhttps://gdal.org/", + "version-semver": "3.2.2", + "description": "The Geographic Data Abstraction Library for reading and writing geospatial raster and vector data", + "homepage": "https://gdal.org", + "supports": "!arm", "dependencies": [ "cfitsio", "curl", "expat", "geos", + "giflib", "hdf5", { "name": "json-c", @@ -24,7 +25,8 @@ "openjpeg", "proj4", "sqlite3", - "zlib" + "zlib", + "zstd" ], "features": { "libspatialite": { diff --git a/versions/baseline.json b/versions/baseline.json index 7812ac6802d..5c0d70a43fb 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2157,8 +2157,8 @@ "port-version": 0 }, "gdal": { - "baseline": "3.1.3", - "port-version": 4 + "baseline": "3.2.2", + "port-version": 0 }, "gdcm": { "baseline": "3.0.7", diff --git a/versions/g-/gdal.json b/versions/g-/gdal.json index f53bc429fad..09828f5022f 100644 --- a/versions/g-/gdal.json +++ b/versions/g-/gdal.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "bb182d21db781421272dccf7c43273c746480c05", + "version-semver": "3.2.2", + "port-version": 0 + }, { "git-tree": "b503a5dd67c0251115346ebfc05551bc8f36c06f", "version-string": "3.1.3",