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/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/portfile.cmake b/ci/vcpkg-custom-ports/zlib/portfile.cmake new file mode 100644 index 00000000..e00e7c37 --- /dev/null +++ b/ci/vcpkg-custom-ports/zlib/portfile.cmake @@ -0,0 +1,36 @@ +set(VERSION 1.2.5) + +vcpkg_download_distfile(ARCHIVE_FILE + 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} +) + +# 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 + 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}) + +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..a4391a7b --- /dev/null +++ b/ci/vcpkg-custom-ports/zlib/vcpkg.json @@ -0,0 +1,7 @@ +{ + "name": "zlib", + "version": "1.2.5", + "port-version": 0, + "description": "A compression library", + "homepage": "https://www.zlib.net/" +} 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"