From 5527e870d20c97c83e7117151fbaa4295d7ce160 Mon Sep 17 00:00:00 2001 From: Ivan Zhakov Date: Thu, 25 Apr 2024 14:00:10 +0000 Subject: [PATCH 1/7] Branch to backport vcpkg related changes to 1.7.x branch. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x-vcpkg@1917331 13f79535-47bb-0310-9956-ffa450edef68 From b36f00536f6437e3dbfa6ada13a3706965f2973c Mon Sep 17 00:00:00 2001 From: Ivan Zhakov Date: Thu, 25 Apr 2024 14:01:42 +0000 Subject: [PATCH 2/7] On '1.7.x-vcpkg' branch: Merge all changes in build/vcpkg and .github/workflows/windows-vcpkg.yml from trunk. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x-vcpkg@1917332 13f79535-47bb-0310-9956-ffa450edef68 --- .github/workflows/windows-vcpkg.yml | 44 +++++++++++++++++++++ build/vcpkg/apr-2/portfile.cmake | 61 +++++++++++++++++++++++++++++ build/vcpkg/apr-2/vcpkg.json | 51 ++++++++++++++++++++++++ 3 files changed, 156 insertions(+) create mode 100644 .github/workflows/windows-vcpkg.yml create mode 100644 build/vcpkg/apr-2/portfile.cmake create mode 100644 build/vcpkg/apr-2/vcpkg.json diff --git a/.github/workflows/windows-vcpkg.yml b/.github/workflows/windows-vcpkg.yml new file mode 100644 index 0000000000..b3c7c4fd4c --- /dev/null +++ b/.github/workflows/windows-vcpkg.yml @@ -0,0 +1,44 @@ +name: Vcpkg (Windows) + +on: + push: + branches: [ "trunk" ] + +jobs: + build: + strategy: + matrix: + os: [windows-latest] + triplet: + - x64-windows + - x64-windows-static + - x64-windows-static-md + - x86-windows + - x86-windows-static + port: + - apr-2 + - apr-2[core] + - apr-2[crypto,dbd-sqlite3,dbd-odbc,private-headers,xlate] + fail-fast: false + + name: "${{ matrix.port }}:${{ matrix.triplet }} on ${{ matrix.os }}" + # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. + # You can convert this to a matrix build if you need cross-platform coverage. + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + runs-on: ${{ matrix.os }} + + env: + VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" + + steps: + - name: Export GitHub Actions cache environment variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + + - uses: actions/checkout@v3 + + - name: Vcpkg Install + run: C:\vcpkg\vcpkg.exe install ${{ matrix.port }} --head --overlay-ports ${{ github.workspace }}\build\vcpkg --triplet ${{ matrix.triplet }} --enforce-port-checks diff --git a/build/vcpkg/apr-2/portfile.cmake b/build/vcpkg/apr-2/portfile.cmake new file mode 100644 index 0000000000..b77e06e6a7 --- /dev/null +++ b/build/vcpkg/apr-2/portfile.cmake @@ -0,0 +1,61 @@ +set(VERSION 2.0.0) +# +# Modify REF to latest commit id from https://github.com/apache/apr +# Update SHA512 with actual SHA512 +# +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO apache/apr + REF 6445e8804008922f8018aa238aa4d6bba608c49a + SHA512 0 + HEAD_REF trunk +) + +if (VCPKG_TARGET_IS_WINDOWS) + vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + private-headers INSTALL_PRIVATE_H + crypto FEATURE_CRYPTO + xlate FEATURE_XLATE + dbd-sqlite3 FEATURE_DBD_SQLITE3 + ) + + string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" APR_BUILD_STATIC) + string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" APR_BUILD_SHARED) + + if (FEATURE_MINIMAL_BUILD) + set(APU_USE_EXPAT OFF) + else() + set(APU_USE_EXPAT ON) + endif() + + vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DAPR_BUILD_STATIC=${APR_BUILD_STATIC} + -DAPR_BUILD_SHARED=${APR_BUILD_SHARED} + -DAPR_MODULAR_DSO=${APR_BUILD_SHARED} + -DAPR_BUILD_TESTAPR=OFF + -DINSTALL_PDB=OFF + -DAPU_HAVE_CRYPTO=${FEATURE_CRYPTO} + -DAPU_HAVE_ICONV=${FEATURE_XLATE} + -DAPU_HAVE_SQLITE3=${FEATURE_DBD_SQLITE3} + -DAPU_USE_EXPAT=${APU_USE_EXPAT} + -DAPR_INSTALL_PRIVATE_H=${INSTALL_PRIVATE_H} + ) + + vcpkg_cmake_install() + vcpkg_copy_pdbs() + vcpkg_cmake_config_fixup(PACKAGE_NAME "apr" + CONFIG_PATH "lib/cmake/apr") + + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") +else() + # In development +endif() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +# Handle copyright +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) + diff --git a/build/vcpkg/apr-2/vcpkg.json b/build/vcpkg/apr-2/vcpkg.json new file mode 100644 index 0000000000..e255ee21f0 --- /dev/null +++ b/build/vcpkg/apr-2/vcpkg.json @@ -0,0 +1,51 @@ +{ + "name": "apr-2", + "version": "2.0.0", + "port-version": 5, + "description": "The Apache Portable Runtime (APR) is a C library that forms a system portability layer that covers many operating systems.", + "homepage": "https://apr.apache.org/", + "supports": "!uwp", + "dependencies": [ + "expat", + { + "name": "vcpkg-cmake", + "host": true, + "platform": "windows" + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "features": { + "crypto": { + "description": "Crypto support", + "dependencies": [ + { + "name": "openssl", + "default-features": false, + "features": [] + } + ] + }, + "dbd-sqlite3": { + "description": "Build SQLite3 DBD driver", + "dependencies": [ + "sqlite3" + ] + }, + "dbd-odbc": { + "description": "Build ODBC DBD driver" + }, + "private-headers": { + "description": "Install non-standard files required for building Apache httpd" + }, + "xlate": { + "description": "Xlate support", + "dependencies": [ + "libiconv" + ] + } + }, + "default-features": [] +} From 84d6eb1d5d8802205ba5944716f90d4492198907 Mon Sep 17 00:00:00 2001 From: Ivan Zhakov Date: Thu, 25 Apr 2024 14:03:08 +0000 Subject: [PATCH 3/7] On '1.7.x-vcpkg' branch: Rename vcpkg port to 'apr' from 'apr-2'. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x-vcpkg@1917333 13f79535-47bb-0310-9956-ffa450edef68 --- .github/workflows/windows-vcpkg.yml | 6 +++--- build/vcpkg/{apr-2 => apr}/portfile.cmake | 2 +- build/vcpkg/{apr-2 => apr}/vcpkg.json | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) rename build/vcpkg/{apr-2 => apr}/portfile.cmake (98%) rename build/vcpkg/{apr-2 => apr}/vcpkg.json (96%) diff --git a/.github/workflows/windows-vcpkg.yml b/.github/workflows/windows-vcpkg.yml index b3c7c4fd4c..35925df8e0 100644 --- a/.github/workflows/windows-vcpkg.yml +++ b/.github/workflows/windows-vcpkg.yml @@ -16,9 +16,9 @@ jobs: - x86-windows - x86-windows-static port: - - apr-2 - - apr-2[core] - - apr-2[crypto,dbd-sqlite3,dbd-odbc,private-headers,xlate] + - apr + - apr[core] + - apr[crypto,dbd-sqlite3,dbd-odbc,private-headers,xlate] fail-fast: false name: "${{ matrix.port }}:${{ matrix.triplet }} on ${{ matrix.os }}" diff --git a/build/vcpkg/apr-2/portfile.cmake b/build/vcpkg/apr/portfile.cmake similarity index 98% rename from build/vcpkg/apr-2/portfile.cmake rename to build/vcpkg/apr/portfile.cmake index b77e06e6a7..34163b2538 100644 --- a/build/vcpkg/apr-2/portfile.cmake +++ b/build/vcpkg/apr/portfile.cmake @@ -1,4 +1,4 @@ -set(VERSION 2.0.0) +set(VERSION 1.7.5) # # Modify REF to latest commit id from https://github.com/apache/apr # Update SHA512 with actual SHA512 diff --git a/build/vcpkg/apr-2/vcpkg.json b/build/vcpkg/apr/vcpkg.json similarity index 96% rename from build/vcpkg/apr-2/vcpkg.json rename to build/vcpkg/apr/vcpkg.json index e255ee21f0..093c1a4ea7 100644 --- a/build/vcpkg/apr-2/vcpkg.json +++ b/build/vcpkg/apr/vcpkg.json @@ -1,6 +1,6 @@ { - "name": "apr-2", - "version": "2.0.0", + "name": "apr", + "version": "1.7.5", "port-version": 5, "description": "The Apache Portable Runtime (APR) is a C library that forms a system portability layer that covers many operating systems.", "homepage": "https://apr.apache.org/", From ae8a787eccd55644d6291da0234d4850434678f0 Mon Sep 17 00:00:00 2001 From: Ivan Zhakov Date: Thu, 25 Apr 2024 14:10:38 +0000 Subject: [PATCH 4/7] On '1.7.x-vcpkg' branch: Cleanup vcpkg features. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x-vcpkg@1917334 13f79535-47bb-0310-9956-ffa450edef68 --- .github/workflows/windows-vcpkg.yml | 2 +- build/vcpkg/apr/portfile.cmake | 8 -------- build/vcpkg/apr/vcpkg.json | 25 ------------------------- 3 files changed, 1 insertion(+), 34 deletions(-) diff --git a/.github/workflows/windows-vcpkg.yml b/.github/workflows/windows-vcpkg.yml index 35925df8e0..1b935c5af2 100644 --- a/.github/workflows/windows-vcpkg.yml +++ b/.github/workflows/windows-vcpkg.yml @@ -18,7 +18,7 @@ jobs: port: - apr - apr[core] - - apr[crypto,dbd-sqlite3,dbd-odbc,private-headers,xlate] + - apr[private-headers] fail-fast: false name: "${{ matrix.port }}:${{ matrix.triplet }} on ${{ matrix.os }}" diff --git a/build/vcpkg/apr/portfile.cmake b/build/vcpkg/apr/portfile.cmake index 34163b2538..04ce1f8f3b 100644 --- a/build/vcpkg/apr/portfile.cmake +++ b/build/vcpkg/apr/portfile.cmake @@ -15,9 +15,6 @@ if (VCPKG_TARGET_IS_WINDOWS) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS FEATURES private-headers INSTALL_PRIVATE_H - crypto FEATURE_CRYPTO - xlate FEATURE_XLATE - dbd-sqlite3 FEATURE_DBD_SQLITE3 ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" APR_BUILD_STATIC) @@ -34,13 +31,8 @@ if (VCPKG_TARGET_IS_WINDOWS) OPTIONS -DAPR_BUILD_STATIC=${APR_BUILD_STATIC} -DAPR_BUILD_SHARED=${APR_BUILD_SHARED} - -DAPR_MODULAR_DSO=${APR_BUILD_SHARED} -DAPR_BUILD_TESTAPR=OFF -DINSTALL_PDB=OFF - -DAPU_HAVE_CRYPTO=${FEATURE_CRYPTO} - -DAPU_HAVE_ICONV=${FEATURE_XLATE} - -DAPU_HAVE_SQLITE3=${FEATURE_DBD_SQLITE3} - -DAPU_USE_EXPAT=${APU_USE_EXPAT} -DAPR_INSTALL_PRIVATE_H=${INSTALL_PRIVATE_H} ) diff --git a/build/vcpkg/apr/vcpkg.json b/build/vcpkg/apr/vcpkg.json index 093c1a4ea7..a44ed585f9 100644 --- a/build/vcpkg/apr/vcpkg.json +++ b/build/vcpkg/apr/vcpkg.json @@ -18,33 +18,8 @@ } ], "features": { - "crypto": { - "description": "Crypto support", - "dependencies": [ - { - "name": "openssl", - "default-features": false, - "features": [] - } - ] - }, - "dbd-sqlite3": { - "description": "Build SQLite3 DBD driver", - "dependencies": [ - "sqlite3" - ] - }, - "dbd-odbc": { - "description": "Build ODBC DBD driver" - }, "private-headers": { "description": "Install non-standard files required for building Apache httpd" - }, - "xlate": { - "description": "Xlate support", - "dependencies": [ - "libiconv" - ] } }, "default-features": [] From 03e06f3c99cf90e31fd7293898850e4f51732b89 Mon Sep 17 00:00:00 2001 From: Ivan Zhakov Date: Thu, 25 Apr 2024 14:11:40 +0000 Subject: [PATCH 5/7] On '1.7.x-vcpkg' branch: * .github/workflows/windows-vcpkg.yml: Run job on 1.7.x* branches. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x-vcpkg@1917335 13f79535-47bb-0310-9956-ffa450edef68 --- .github/workflows/windows-vcpkg.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows-vcpkg.yml b/.github/workflows/windows-vcpkg.yml index 1b935c5af2..aabc0ac3d3 100644 --- a/.github/workflows/windows-vcpkg.yml +++ b/.github/workflows/windows-vcpkg.yml @@ -2,7 +2,7 @@ name: Vcpkg (Windows) on: push: - branches: [ "trunk" ] + branches: [ "1.7.x*" ] jobs: build: From f8e2235c5424382403988dfcf9fc3d9341358703 Mon Sep 17 00:00:00 2001 From: Ivan Zhakov Date: Thu, 25 Apr 2024 14:12:17 +0000 Subject: [PATCH 6/7] On '1.7.x-vcpkg' branch: * build/vcpkg/apr/portfile.cmake: Use 1.7.x branch for sources. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x-vcpkg@1917336 13f79535-47bb-0310-9956-ffa450edef68 --- build/vcpkg/apr/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/vcpkg/apr/portfile.cmake b/build/vcpkg/apr/portfile.cmake index 04ce1f8f3b..a0166c93b8 100644 --- a/build/vcpkg/apr/portfile.cmake +++ b/build/vcpkg/apr/portfile.cmake @@ -8,7 +8,7 @@ vcpkg_from_github( REPO apache/apr REF 6445e8804008922f8018aa238aa4d6bba608c49a SHA512 0 - HEAD_REF trunk + HEAD_REF 1.7.x ) if (VCPKG_TARGET_IS_WINDOWS) From 237e151e97f773049c595d94e9f7988cc0e27aec Mon Sep 17 00:00:00 2001 From: Ivan Zhakov Date: Thu, 25 Apr 2024 14:14:08 +0000 Subject: [PATCH 7/7] On '1.7.x-vcpkg' branch: * build/vcpkg/apr/vcpkg.json: Remove 'expat' from dependencies. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x-vcpkg@1917337 13f79535-47bb-0310-9956-ffa450edef68 --- build/vcpkg/apr/vcpkg.json | 1 - 1 file changed, 1 deletion(-) diff --git a/build/vcpkg/apr/vcpkg.json b/build/vcpkg/apr/vcpkg.json index a44ed585f9..cf044bbc27 100644 --- a/build/vcpkg/apr/vcpkg.json +++ b/build/vcpkg/apr/vcpkg.json @@ -6,7 +6,6 @@ "homepage": "https://apr.apache.org/", "supports": "!uwp", "dependencies": [ - "expat", { "name": "vcpkg-cmake", "host": true,