From efe3b98b14b0845e8b94ffb9a5c668aceb982da8 Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Wed, 16 Mar 2022 20:30:16 +0100 Subject: [PATCH 1/4] add zlib port --- ...id-inclusions-when-HAVE_-is-set-to-0.patch | 53 +++++++++++++ .../zlib/0002-android-build-mingw.patch | 21 ++++++ ci/vcpkg-custom-ports/zlib/LICENSE | 20 +++++ .../zlib/add_debug_postfix_on_mingw.patch | 13 ++++ .../cmake_dont_build_more_than_needed.patch | 74 +++++++++++++++++++ ci/vcpkg-custom-ports/zlib/portfile.cmake | 56 ++++++++++++++ ci/vcpkg-custom-ports/zlib/usage | 4 + .../zlib/vcpkg-cmake-wrapper.cmake | 12 +++ ci/vcpkg-custom-ports/zlib/vcpkg.json | 7 ++ 9 files changed, 260 insertions(+) create mode 100644 ci/vcpkg-custom-ports/zlib/0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch create mode 100644 ci/vcpkg-custom-ports/zlib/0002-android-build-mingw.patch create mode 100644 ci/vcpkg-custom-ports/zlib/LICENSE create mode 100644 ci/vcpkg-custom-ports/zlib/add_debug_postfix_on_mingw.patch create mode 100644 ci/vcpkg-custom-ports/zlib/cmake_dont_build_more_than_needed.patch create mode 100644 ci/vcpkg-custom-ports/zlib/portfile.cmake create mode 100644 ci/vcpkg-custom-ports/zlib/usage create mode 100644 ci/vcpkg-custom-ports/zlib/vcpkg-cmake-wrapper.cmake create mode 100644 ci/vcpkg-custom-ports/zlib/vcpkg.json diff --git a/ci/vcpkg-custom-ports/zlib/0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch b/ci/vcpkg-custom-ports/zlib/0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch new file mode 100644 index 00000000..8fe2b2f5 --- /dev/null +++ b/ci/vcpkg-custom-ports/zlib/0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch @@ -0,0 +1,53 @@ +diff --git a/zconf.h.cmakein b/zconf.h.cmakein +index a7f24cc..a1b359b 100644 +--- a/zconf.h.cmakein ++++ b/zconf.h.cmakein +@@ -434,11 +434,19 @@ typedef uLong FAR uLongf; + #endif + + #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ +-# define Z_HAVE_UNISTD_H ++# if ~(~HAVE_UNISTD_H + 0) == 0 && ~(~HAVE_UNISTD_H + 1) == 1 ++# define Z_HAVE_UNISTD_H ++# elif HAVE_UNISTD_H != 0 ++# define Z_HAVE_UNISTD_H ++# endif + #endif + + #ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */ +-# define Z_HAVE_STDARG_H ++# if ~(~HAVE_STDARG_H + 0) == 0 && ~(~HAVE_STDARG_H + 1) == 1 ++# define Z_HAVE_STDARG_H ++# elif HAVE_STDARG_H != 0 ++# define Z_HAVE_STDARG_H ++# endif + #endif + + #ifdef STDC +diff --git a/zconf.h.in b/zconf.h.in +index 5e1d68a..32f53c8 100644 +--- a/zconf.h.in ++++ b/zconf.h.in +@@ -432,11 +432,19 @@ typedef uLong FAR uLongf; + #endif + + #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ +-# define Z_HAVE_UNISTD_H ++# if ~(~HAVE_UNISTD_H + 0) == 0 && ~(~HAVE_UNISTD_H + 1) == 1 ++# define Z_HAVE_UNISTD_H ++# elif HAVE_UNISTD_H != 0 ++# define Z_HAVE_UNISTD_H ++# endif + #endif + + #ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */ +-# define Z_HAVE_STDARG_H ++# if ~(~HAVE_STDARG_H + 0) == 0 && ~(~HAVE_STDARG_H + 1) == 1 ++# define Z_HAVE_STDARG_H ++# elif HAVE_STDARG_H != 0 ++# define Z_HAVE_STDARG_H ++# endif + #endif + + #ifdef STDC + diff --git a/ci/vcpkg-custom-ports/zlib/0002-android-build-mingw.patch b/ci/vcpkg-custom-ports/zlib/0002-android-build-mingw.patch new file mode 100644 index 00000000..188499df --- /dev/null +++ b/ci/vcpkg-custom-ports/zlib/0002-android-build-mingw.patch @@ -0,0 +1,21 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt (date 1618364429263) ++++ b/CMakeLists.txt (date 1618364429263) +@@ -170,7 +170,7 @@ + string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([-0-9A-Za-z.]+)\".*" + "\\1" ZLIB_FULL_VERSION ${_zlib_h_contents}) + +-if(MINGW) ++if(MINGW AND NOT ANDROID) + # This gets us DLL resource information when compiling on MinGW. + if(NOT CMAKE_RC_COMPILER) + set(CMAKE_RC_COMPILER windres.exe) +@@ -186,7 +186,7 @@ + if(BUILD_SHARED_LIBS) + set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj) + endif() +-endif(MINGW) ++endif(MINGW AND NOT ANDROID) + + add_library(zlib ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) + set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL) diff --git a/ci/vcpkg-custom-ports/zlib/LICENSE b/ci/vcpkg-custom-ports/zlib/LICENSE new file mode 100644 index 00000000..ca5fddfe --- /dev/null +++ b/ci/vcpkg-custom-ports/zlib/LICENSE @@ -0,0 +1,20 @@ + Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu \ No newline at end of file diff --git a/ci/vcpkg-custom-ports/zlib/add_debug_postfix_on_mingw.patch b/ci/vcpkg-custom-ports/zlib/add_debug_postfix_on_mingw.patch new file mode 100644 index 00000000..22172ccf --- /dev/null +++ b/ci/vcpkg-custom-ports/zlib/add_debug_postfix_on_mingw.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0fe939d..e4fc213 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -59,7 +59,7 @@ endif() + # + check_include_file(unistd.h Z_HAVE_UNISTD_H) + +-if(MSVC) ++if(WIN32) + set(CMAKE_DEBUG_POSTFIX "d") + add_definitions(-D_CRT_SECURE_NO_DEPRECATE) + add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE) diff --git a/ci/vcpkg-custom-ports/zlib/cmake_dont_build_more_than_needed.patch b/ci/vcpkg-custom-ports/zlib/cmake_dont_build_more_than_needed.patch new file mode 100644 index 00000000..a374f76d --- /dev/null +++ b/ci/vcpkg-custom-ports/zlib/cmake_dont_build_more_than_needed.patch @@ -0,0 +1,74 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0fe939d..a1291d5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -7,6 +7,7 @@ set(VERSION "1.2.11") + + option(ASM686 "Enable building i686 assembly implementation") + option(AMD64 "Enable building amd64 assembly implementation") ++option(SKIP_BUILD_EXAMPLES "Skip build of the examples" OFF) + + set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables") + set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries") +@@ -124,9 +125,11 @@ set(ZLIB_SRCS + ) + + if(NOT MINGW) +- set(ZLIB_DLL_SRCS +- win32/zlib1.rc # If present will override custom build rule below. +- ) ++ if(BUILD_SHARED_LIBS) ++ set(ZLIB_DLL_SRCS ++ win32/zlib1.rc # If present will override custom build rule below. ++ ) ++ endif() + endif() + + if(CMAKE_COMPILER_IS_GNUCC) +@@ -180,11 +183,12 @@ if(MINGW) + -I ${CMAKE_CURRENT_BINARY_DIR} + -o ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj + -i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc) +- set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj) ++ if(BUILD_SHARED_LIBS) ++ set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj) ++ endif() + endif(MINGW) + +-add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) +-add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) ++add_library(zlib ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) + set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL) + set_target_properties(zlib PROPERTIES SOVERSION 1) + +@@ -201,7 +205,7 @@ endif() + + if(UNIX) + # On unix-like platforms the library is almost always called libz +- set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z) ++ set_target_properties(zlib PROPERTIES OUTPUT_NAME z) + if(NOT APPLE) + set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"") + endif() +@@ -211,7 +215,7 @@ elseif(BUILD_SHARED_LIBS AND WIN32) + endif() + + if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL ) +- install(TARGETS zlib zlibstatic ++ install(TARGETS zlib + RUNTIME DESTINATION "${INSTALL_BIN_DIR}" + ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" + LIBRARY DESTINATION "${INSTALL_LIB_DIR}" ) +@@ -230,6 +234,7 @@ endif() + # Example binaries + #============================================================================ + ++if (NOT SKIP_BUILD_EXAMPLES) + add_executable(example test/example.c) + target_link_libraries(example zlib) + add_test(example example) +@@ -247,3 +252,4 @@ if(HAVE_OFF64_T) + target_link_libraries(minigzip64 zlib) + set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64") + endif() ++endif() diff --git a/ci/vcpkg-custom-ports/zlib/portfile.cmake b/ci/vcpkg-custom-ports/zlib/portfile.cmake new file mode 100644 index 00000000..88e9e0fe --- /dev/null +++ b/ci/vcpkg-custom-ports/zlib/portfile.cmake @@ -0,0 +1,56 @@ +set(VERSION 1.2.11) + +vcpkg_download_distfile(ARCHIVE_FILE + URLS "https://www.zlib.net/zlib-${VERSION}.tar.gz" "https://downloads.sourceforge.net/project/libpng/zlib/${VERSION}/zlib-${VERSION}.tar.gz" + FILENAME "zlib1211.tar.gz" + SHA512 73fd3fff4adeccd4894084c15ddac89890cd10ef105dd5e1835e1e9bbb6a49ff229713bd197d203edfa17c2727700fce65a2a235f07568212d820dca88b528ae +) + +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE_FILE} + REF ${VERSION} + PATCHES + "cmake_dont_build_more_than_needed.patch" + "0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch" + "add_debug_postfix_on_mingw.patch" + "0002-android-build-mingw.patch" +) + +# This is generated during the cmake build +file(REMOVE ${SOURCE_PATH}/zconf.h) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DSKIP_INSTALL_FILES=ON + -DSKIP_BUILD_EXAMPLES=ON + OPTIONS_DEBUG + -DSKIP_INSTALL_HEADERS=ON +) + +vcpkg_install_cmake() +file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) + +# Install the pkgconfig file +if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_replace_string(${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/zlib.pc "-lz" "-lzlib") + endif() + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/zlib.pc DESTINATION ${CURRENT_PACKAGES_DIR}/lib/pkgconfig) +endif() +if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_replace_string(${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/zlib.pc "-lz" "-lzlibd") + endif() + file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/zlib.pc DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig) +endif() + +vcpkg_fixup_pkgconfig() + +file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) + +vcpkg_copy_pdbs() + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) diff --git a/ci/vcpkg-custom-ports/zlib/usage b/ci/vcpkg-custom-ports/zlib/usage new file mode 100644 index 00000000..39d86182 --- /dev/null +++ b/ci/vcpkg-custom-ports/zlib/usage @@ -0,0 +1,4 @@ +The package zlib is compatible with built-in CMake targets: + + find_package(ZLIB REQUIRED) + target_link_libraries(main PRIVATE ZLIB::ZLIB) diff --git a/ci/vcpkg-custom-ports/zlib/vcpkg-cmake-wrapper.cmake b/ci/vcpkg-custom-ports/zlib/vcpkg-cmake-wrapper.cmake new file mode 100644 index 00000000..8624b708 --- /dev/null +++ b/ci/vcpkg-custom-ports/zlib/vcpkg-cmake-wrapper.cmake @@ -0,0 +1,12 @@ +find_path(ZLIB_INCLUDE_DIR NAMES zlib.h PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include" NO_DEFAULT_PATH) +find_library(ZLIB_LIBRARY_RELEASE NAMES zlib z PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib" NO_DEFAULT_PATH) +find_library(ZLIB_LIBRARY_DEBUG NAMES zlibd z PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib" NO_DEFAULT_PATH) +if(NOT ZLIB_INCLUDE_DIR OR NOT (ZLIB_LIBRARY_RELEASE OR ZLIB_LIBRARY_DEBUG)) + message(FATAL_ERROR "Broken installation of vcpkg port zlib") +endif() +if(CMAKE_VERSION VERSION_LESS 3.4) + include(SelectLibraryConfigurations) + select_library_configurations(ZLIB) + unset(ZLIB_FOUND) +endif() +_find_package(${ARGS}) diff --git a/ci/vcpkg-custom-ports/zlib/vcpkg.json b/ci/vcpkg-custom-ports/zlib/vcpkg.json new file mode 100644 index 00000000..4308e45a --- /dev/null +++ b/ci/vcpkg-custom-ports/zlib/vcpkg.json @@ -0,0 +1,7 @@ +{ + "name": "zlib", + "version": "1.2.11", + "port-version": 13, + "description": "A compression library", + "homepage": "https://www.zlib.net/" +} From f71a568c33169072eebb5e85c6f22027d87bc39a Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Wed, 16 Mar 2022 20:31:46 +0100 Subject: [PATCH 2/4] edits to zlib port to target 1.2.5 --- ci/vcpkg-custom-ports/zlib/portfile.cmake | 28 ++++------------------- ci/vcpkg-custom-ports/zlib/vcpkg.json | 4 ++-- 2 files changed, 6 insertions(+), 26 deletions(-) diff --git a/ci/vcpkg-custom-ports/zlib/portfile.cmake b/ci/vcpkg-custom-ports/zlib/portfile.cmake index 88e9e0fe..e00e7c37 100644 --- a/ci/vcpkg-custom-ports/zlib/portfile.cmake +++ b/ci/vcpkg-custom-ports/zlib/portfile.cmake @@ -1,20 +1,15 @@ -set(VERSION 1.2.11) +set(VERSION 1.2.5) vcpkg_download_distfile(ARCHIVE_FILE - URLS "https://www.zlib.net/zlib-${VERSION}.tar.gz" "https://downloads.sourceforge.net/project/libpng/zlib/${VERSION}/zlib-${VERSION}.tar.gz" - FILENAME "zlib1211.tar.gz" - SHA512 73fd3fff4adeccd4894084c15ddac89890cd10ef105dd5e1835e1e9bbb6a49ff229713bd197d203edfa17c2727700fce65a2a235f07568212d820dca88b528ae + URLS "https://downloads.sourceforge.net/project/libpng/zlib/${VERSION}/zlib-${VERSION}.tar.gz" + FILENAME "zlib125.tar.gz" + SHA512 83ce467787903b7e90ece203aaea0be42174b9cf4a9aa16fe3f72925a4993b549d50154dec4cc76b4cb1aa0b7b966118772aca3d73efa0601167256ff7ce7a12 ) vcpkg_extract_source_archive_ex( OUT_SOURCE_PATH SOURCE_PATH ARCHIVE ${ARCHIVE_FILE} REF ${VERSION} - PATCHES - "cmake_dont_build_more_than_needed.patch" - "0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch" - "add_debug_postfix_on_mingw.patch" - "0002-android-build-mingw.patch" ) # This is generated during the cmake build @@ -25,7 +20,6 @@ vcpkg_configure_cmake( PREFER_NINJA OPTIONS -DSKIP_INSTALL_FILES=ON - -DSKIP_BUILD_EXAMPLES=ON OPTIONS_DEBUG -DSKIP_INSTALL_HEADERS=ON ) @@ -33,20 +27,6 @@ vcpkg_configure_cmake( vcpkg_install_cmake() file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) -# Install the pkgconfig file -if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - if(VCPKG_TARGET_IS_WINDOWS) - vcpkg_replace_string(${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/zlib.pc "-lz" "-lzlib") - endif() - file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/zlib.pc DESTINATION ${CURRENT_PACKAGES_DIR}/lib/pkgconfig) -endif() -if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - if(VCPKG_TARGET_IS_WINDOWS) - vcpkg_replace_string(${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/zlib.pc "-lz" "-lzlibd") - endif() - file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/zlib.pc DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig) -endif() - vcpkg_fixup_pkgconfig() file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ci/vcpkg-custom-ports/zlib/vcpkg.json b/ci/vcpkg-custom-ports/zlib/vcpkg.json index 4308e45a..a4391a7b 100644 --- a/ci/vcpkg-custom-ports/zlib/vcpkg.json +++ b/ci/vcpkg-custom-ports/zlib/vcpkg.json @@ -1,7 +1,7 @@ { "name": "zlib", - "version": "1.2.11", - "port-version": 13, + "version": "1.2.5", + "port-version": 0, "description": "A compression library", "homepage": "https://www.zlib.net/" } From ecace972b21a87dea66929fee3b97f62c4634525 Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Wed, 16 Mar 2022 20:37:12 +0100 Subject: [PATCH 3/4] use custom port in install + target manylinux2014 --- ci/manylinux2014_x86_64-vcpkg-gdal.Dockerfile | 3 ++- pyproject.toml | 4 ---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/ci/manylinux2014_x86_64-vcpkg-gdal.Dockerfile b/ci/manylinux2014_x86_64-vcpkg-gdal.Dockerfile index c5a7b4d5..f77a78ee 100644 --- a/ci/manylinux2014_x86_64-vcpkg-gdal.Dockerfile +++ b/ci/manylinux2014_x86_64-vcpkg-gdal.Dockerfile @@ -12,6 +12,7 @@ RUN bootstrap-vcpkg.sh && \ vcpkg integrate bash COPY ci/custom-triplets/x64-linux-dynamic.cmake opt/vcpkg/custom-triplets/x64-linux-dynamic.cmake +COPY ci/vcpkg-custom-ports/ opt/vcpkg/custom-ports/ ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/vcpkg/installed/x64-linux-dynamic/lib" -RUN vcpkg install gdal[core]:x64-linux-dynamic --overlay-triplets=opt/vcpkg/custom-triplets +RUN vcpkg install gdal[core]:x64-linux-dynamic --overlay-triplets=opt/vcpkg/custom-triplets --overlay-ports=opt/vcpkg/custom-ports diff --git a/pyproject.toml b/pyproject.toml index 7b8fe9eb..154d4e05 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,10 +13,6 @@ archs = ["auto64"] manylinux-x86_64-image = "manylinux-vcpkg-gdal:latest" build-verbosity = 3 -[tool.cibuildwheel.linux] -# explicitly mention 2_27 for now because it fails for manylinux2014 (2_17) -repair-wheel-command = "auditwheel repair --plat manylinux_2_27_x86_64 -w {dest_dir} {wheel}" - [tool.cibuildwheel.linux.environment] VCPKG_INSTALL = "$VCPKG_INSTALLATION_ROOT/installed/x64-linux-dynamic" GDAL_INCLUDE_PATH = "$VCPKG_INSTALL/include" From e3f833157238de452d398126367ad1536a637dbb Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Fri, 18 Mar 2022 16:18:20 +0100 Subject: [PATCH 4/4] remove no longer used patches from the port --- ...id-inclusions-when-HAVE_-is-set-to-0.patch | 53 ------------- .../zlib/0002-android-build-mingw.patch | 21 ------ .../zlib/add_debug_postfix_on_mingw.patch | 13 ---- .../cmake_dont_build_more_than_needed.patch | 74 ------------------- 4 files changed, 161 deletions(-) delete mode 100644 ci/vcpkg-custom-ports/zlib/0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch delete mode 100644 ci/vcpkg-custom-ports/zlib/0002-android-build-mingw.patch delete mode 100644 ci/vcpkg-custom-ports/zlib/add_debug_postfix_on_mingw.patch delete mode 100644 ci/vcpkg-custom-ports/zlib/cmake_dont_build_more_than_needed.patch diff --git a/ci/vcpkg-custom-ports/zlib/0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch b/ci/vcpkg-custom-ports/zlib/0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch deleted file mode 100644 index 8fe2b2f5..00000000 --- a/ci/vcpkg-custom-ports/zlib/0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch +++ /dev/null @@ -1,53 +0,0 @@ -diff --git a/zconf.h.cmakein b/zconf.h.cmakein -index a7f24cc..a1b359b 100644 ---- a/zconf.h.cmakein -+++ b/zconf.h.cmakein -@@ -434,11 +434,19 @@ typedef uLong FAR uLongf; - #endif - - #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ --# define Z_HAVE_UNISTD_H -+# if ~(~HAVE_UNISTD_H + 0) == 0 && ~(~HAVE_UNISTD_H + 1) == 1 -+# define Z_HAVE_UNISTD_H -+# elif HAVE_UNISTD_H != 0 -+# define Z_HAVE_UNISTD_H -+# endif - #endif - - #ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */ --# define Z_HAVE_STDARG_H -+# if ~(~HAVE_STDARG_H + 0) == 0 && ~(~HAVE_STDARG_H + 1) == 1 -+# define Z_HAVE_STDARG_H -+# elif HAVE_STDARG_H != 0 -+# define Z_HAVE_STDARG_H -+# endif - #endif - - #ifdef STDC -diff --git a/zconf.h.in b/zconf.h.in -index 5e1d68a..32f53c8 100644 ---- a/zconf.h.in -+++ b/zconf.h.in -@@ -432,11 +432,19 @@ typedef uLong FAR uLongf; - #endif - - #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ --# define Z_HAVE_UNISTD_H -+# if ~(~HAVE_UNISTD_H + 0) == 0 && ~(~HAVE_UNISTD_H + 1) == 1 -+# define Z_HAVE_UNISTD_H -+# elif HAVE_UNISTD_H != 0 -+# define Z_HAVE_UNISTD_H -+# endif - #endif - - #ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */ --# define Z_HAVE_STDARG_H -+# if ~(~HAVE_STDARG_H + 0) == 0 && ~(~HAVE_STDARG_H + 1) == 1 -+# define Z_HAVE_STDARG_H -+# elif HAVE_STDARG_H != 0 -+# define Z_HAVE_STDARG_H -+# endif - #endif - - #ifdef STDC - diff --git a/ci/vcpkg-custom-ports/zlib/0002-android-build-mingw.patch b/ci/vcpkg-custom-ports/zlib/0002-android-build-mingw.patch deleted file mode 100644 index 188499df..00000000 --- a/ci/vcpkg-custom-ports/zlib/0002-android-build-mingw.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt ---- a/CMakeLists.txt (date 1618364429263) -+++ b/CMakeLists.txt (date 1618364429263) -@@ -170,7 +170,7 @@ - string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([-0-9A-Za-z.]+)\".*" - "\\1" ZLIB_FULL_VERSION ${_zlib_h_contents}) - --if(MINGW) -+if(MINGW AND NOT ANDROID) - # This gets us DLL resource information when compiling on MinGW. - if(NOT CMAKE_RC_COMPILER) - set(CMAKE_RC_COMPILER windres.exe) -@@ -186,7 +186,7 @@ - if(BUILD_SHARED_LIBS) - set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj) - endif() --endif(MINGW) -+endif(MINGW AND NOT ANDROID) - - add_library(zlib ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) - set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL) diff --git a/ci/vcpkg-custom-ports/zlib/add_debug_postfix_on_mingw.patch b/ci/vcpkg-custom-ports/zlib/add_debug_postfix_on_mingw.patch deleted file mode 100644 index 22172ccf..00000000 --- a/ci/vcpkg-custom-ports/zlib/add_debug_postfix_on_mingw.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 0fe939d..e4fc213 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -59,7 +59,7 @@ endif() - # - check_include_file(unistd.h Z_HAVE_UNISTD_H) - --if(MSVC) -+if(WIN32) - set(CMAKE_DEBUG_POSTFIX "d") - add_definitions(-D_CRT_SECURE_NO_DEPRECATE) - add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE) diff --git a/ci/vcpkg-custom-ports/zlib/cmake_dont_build_more_than_needed.patch b/ci/vcpkg-custom-ports/zlib/cmake_dont_build_more_than_needed.patch deleted file mode 100644 index a374f76d..00000000 --- a/ci/vcpkg-custom-ports/zlib/cmake_dont_build_more_than_needed.patch +++ /dev/null @@ -1,74 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 0fe939d..a1291d5 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -7,6 +7,7 @@ set(VERSION "1.2.11") - - option(ASM686 "Enable building i686 assembly implementation") - option(AMD64 "Enable building amd64 assembly implementation") -+option(SKIP_BUILD_EXAMPLES "Skip build of the examples" OFF) - - set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables") - set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries") -@@ -124,9 +125,11 @@ set(ZLIB_SRCS - ) - - if(NOT MINGW) -- set(ZLIB_DLL_SRCS -- win32/zlib1.rc # If present will override custom build rule below. -- ) -+ if(BUILD_SHARED_LIBS) -+ set(ZLIB_DLL_SRCS -+ win32/zlib1.rc # If present will override custom build rule below. -+ ) -+ endif() - endif() - - if(CMAKE_COMPILER_IS_GNUCC) -@@ -180,11 +183,12 @@ if(MINGW) - -I ${CMAKE_CURRENT_BINARY_DIR} - -o ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj - -i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc) -- set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj) -+ if(BUILD_SHARED_LIBS) -+ set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj) -+ endif() - endif(MINGW) - --add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) --add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) -+add_library(zlib ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) - set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL) - set_target_properties(zlib PROPERTIES SOVERSION 1) - -@@ -201,7 +205,7 @@ endif() - - if(UNIX) - # On unix-like platforms the library is almost always called libz -- set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z) -+ set_target_properties(zlib PROPERTIES OUTPUT_NAME z) - if(NOT APPLE) - set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"") - endif() -@@ -211,7 +215,7 @@ elseif(BUILD_SHARED_LIBS AND WIN32) - endif() - - if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL ) -- install(TARGETS zlib zlibstatic -+ install(TARGETS zlib - RUNTIME DESTINATION "${INSTALL_BIN_DIR}" - ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" - LIBRARY DESTINATION "${INSTALL_LIB_DIR}" ) -@@ -230,6 +234,7 @@ endif() - # Example binaries - #============================================================================ - -+if (NOT SKIP_BUILD_EXAMPLES) - add_executable(example test/example.c) - target_link_libraries(example zlib) - add_test(example example) -@@ -247,3 +252,4 @@ if(HAVE_OFF64_T) - target_link_libraries(minigzip64 zlib) - set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64") - endif() -+endif()