From 387a6e6da4e29195dc70ebf5836dc4174fc38429 Mon Sep 17 00:00:00 2001 From: Lily Wang <494550702@qq.com> Date: Tue, 25 Oct 2022 03:12:14 -0700 Subject: [PATCH 1/7] [apr-util] Fix incorrect header file --- ports/apr-util/portfile.cmake | 2 +- ports/apr-util/vcpkg.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/apr-util/portfile.cmake b/ports/apr-util/portfile.cmake index 6cafce46626e4e..f4f52633f083bb 100644 --- a/ports/apr-util/portfile.cmake +++ b/ports/apr-util/portfile.cmake @@ -37,7 +37,7 @@ if(VCPKG_TARGET_IS_WINDOWS) file(READ ${CURRENT_PACKAGES_DIR}/include/apu.h APU_H) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - string(REPLACE "defined(APU_DECLARE_EXPORT)" "1" APU_H "${APU_H}") + string(REPLACE "defined(APU_DECLARE_STATIC)" "0" APU_H "${APU_H}") else() string(REPLACE "defined(APU_DECLARE_STATIC)" "1" APU_H "${APU_H}") endif() diff --git a/ports/apr-util/vcpkg.json b/ports/apr-util/vcpkg.json index 4b623c0161c2cb..4c4c9bbf02a3be 100644 --- a/ports/apr-util/vcpkg.json +++ b/ports/apr-util/vcpkg.json @@ -1,7 +1,7 @@ { "name": "apr-util", "version": "1.6.1", - "port-version": 8, + "port-version": 9, "description": "Apache Portable Runtime (APR) project mission is to create and maintain software libraries that provide a predictable and consistent interface to underlying platform-specific implementation", "homepage": "https://apr.apache.org/", "license": "Apache-2.0", From d36483f2f0470b56b96c06ee4572ad3ffde220d5 Mon Sep 17 00:00:00 2001 From: Lily Wang <494550702@qq.com> Date: Tue, 25 Oct 2022 03:13:35 -0700 Subject: [PATCH 2/7] x-add-version --- versions/a-/apr-util.json | 5 +++++ versions/baseline.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/versions/a-/apr-util.json b/versions/a-/apr-util.json index e71d874adfe42e..c7f7f0c4e051c1 100644 --- a/versions/a-/apr-util.json +++ b/versions/a-/apr-util.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "8c9cce187f53067cfe9f66f89d421ee5c9914bd8", + "version": "1.6.1", + "port-version": 9 + }, { "git-tree": "e11acd0b01edac0a064893b89bd9eb2d976f4371", "version": "1.6.1", diff --git a/versions/baseline.json b/versions/baseline.json index 8a1fb05dc71f8c..f59ced001f9f94 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -130,7 +130,7 @@ }, "apr-util": { "baseline": "1.6.1", - "port-version": 8 + "port-version": 9 }, "apsi": { "baseline": "0.8.2", From e6ae7074ccbf07fbe7b9d13887a417bd0bedc20c Mon Sep 17 00:00:00 2001 From: Lily Wang <494550702@qq.com> Date: Tue, 25 Oct 2022 21:06:52 -0700 Subject: [PATCH 3/7] fix deprecated function and remove unused option --- ports/apr-util/portfile.cmake | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/ports/apr-util/portfile.cmake b/ports/apr-util/portfile.cmake index f4f52633f083bb..a615d92182d26a 100644 --- a/ports/apr-util/portfile.cmake +++ b/ports/apr-util/portfile.cmake @@ -6,8 +6,8 @@ vcpkg_download_distfile(ARCHIVE ) if(VCPKG_TARGET_IS_WINDOWS) - vcpkg_extract_source_archive_ex( - OUT_SOURCE_PATH SOURCE_PATH + vcpkg_extract_source_archive( + SOURCE_PATH ARCHIVE "${ARCHIVE}" PATCHES use-vcpkg-expat.patch @@ -15,19 +15,8 @@ if(VCPKG_TARGET_IS_WINDOWS) unglue.patch ) - if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - set(APU_DECLARE_EXPORT ON) - set(APU_DECLARE_STATIC OFF) - else() - set(APU_DECLARE_EXPORT OFF) - set(APU_DECLARE_STATIC ON) - endif() - vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" - OPTIONS - -DAPU_DECLARE_EXPORT=${APU_DECLARE_EXPORT} - -DAPU_DECLARE_STATIC=${APU_DECLARE_STATIC} OPTIONS_DEBUG -DDISABLE_INSTALL_HEADERS=ON ) @@ -44,8 +33,8 @@ if(VCPKG_TARGET_IS_WINDOWS) file(WRITE ${CURRENT_PACKAGES_DIR}/include/apu.h "${APU_H}") else() - vcpkg_extract_source_archive_ex( - OUT_SOURCE_PATH SOURCE_PATH + vcpkg_extract_source_archive( + SOURCE_PATH ARCHIVE ${ARCHIVE} ) From 30099fd83cc06d67a78bfac64aeedfcb2362ecaa Mon Sep 17 00:00:00 2001 From: Lily Wang <494550702@qq.com> Date: Tue, 25 Oct 2022 21:07:44 -0700 Subject: [PATCH 4/7] x-add-version --- versions/a-/apr-util.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/a-/apr-util.json b/versions/a-/apr-util.json index c7f7f0c4e051c1..2731510bce37e5 100644 --- a/versions/a-/apr-util.json +++ b/versions/a-/apr-util.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "8c9cce187f53067cfe9f66f89d421ee5c9914bd8", + "git-tree": "70320666a21b98f34683445c6f568a745edaa913", "version": "1.6.1", "port-version": 9 }, From dd048e08165f3a7ebb88821718f08ba7f8c9673c Mon Sep 17 00:00:00 2001 From: Lily Wang <494550702@qq.com> Date: Wed, 26 Oct 2022 01:25:45 -0700 Subject: [PATCH 5/7] format --- ports/apr-util/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/apr-util/portfile.cmake b/ports/apr-util/portfile.cmake index a615d92182d26a..286a6edfb8e231 100644 --- a/ports/apr-util/portfile.cmake +++ b/ports/apr-util/portfile.cmake @@ -24,7 +24,7 @@ if(VCPKG_TARGET_IS_WINDOWS) vcpkg_cmake_install() vcpkg_copy_pdbs() - file(READ ${CURRENT_PACKAGES_DIR}/include/apu.h APU_H) + file(READ "${CURRENT_PACKAGES_DIR}/include/apu.h" APU_H) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) string(REPLACE "defined(APU_DECLARE_STATIC)" "0" APU_H "${APU_H}") else() From 4749cbd5002422062c293505f84217052509f74d Mon Sep 17 00:00:00 2001 From: Lily Wang <494550702@qq.com> Date: Wed, 26 Oct 2022 01:26:23 -0700 Subject: [PATCH 6/7] x-add-version --- versions/a-/apr-util.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/a-/apr-util.json b/versions/a-/apr-util.json index 2731510bce37e5..4f7640c8369b49 100644 --- a/versions/a-/apr-util.json +++ b/versions/a-/apr-util.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "70320666a21b98f34683445c6f568a745edaa913", + "git-tree": "9139d892590cf0bb187a8be85e2b950664133cbc", "version": "1.6.1", "port-version": 9 }, From 88475a5023bdb79bd6415b32b59c6309966be85e Mon Sep 17 00:00:00 2001 From: Billy O'Neal Date: Wed, 26 Oct 2022 11:44:31 -0700 Subject: [PATCH 7/7] * Add comment explaining how APU_DECLARE_STATIC embedding works. * Use vcpkg_replace_string. * Quotes/formatting/trailing whitespace. --- ports/apr-util/portfile.cmake | 35 ++++++++++++++++++++++++----------- versions/a-/apr-util.json | 2 +- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/ports/apr-util/portfile.cmake b/ports/apr-util/portfile.cmake index 286a6edfb8e231..66ef998bfa49a9 100644 --- a/ports/apr-util/portfile.cmake +++ b/ports/apr-util/portfile.cmake @@ -2,7 +2,6 @@ vcpkg_download_distfile(ARCHIVE URLS "https://archive.apache.org/dist/apr/apr-util-1.6.1.tar.bz2" FILENAME "apr-util-1.6.1.tar.bz2" SHA512 40eff8a37c0634f7fdddd6ca5e596b38de15fd10767a34c30bbe49c632816e8f3e1e230678034f578dd5816a94f246fb5dfdf48d644829af13bf28de3225205d - ) if(VCPKG_TARGET_IS_WINDOWS) @@ -24,18 +23,35 @@ if(VCPKG_TARGET_IS_WINDOWS) vcpkg_cmake_install() vcpkg_copy_pdbs() - file(READ "${CURRENT_PACKAGES_DIR}/include/apu.h" APU_H) + # Upstream include/apu.h.in has: + # ``` + #elif defined(APU_DECLARE_STATIC) + #define APU_DECLARE(type) type __stdcall + #define APU_DECLARE_NONSTD(type) type __cdecl + #define APU_DECLARE_DATA + #elif defined(APU_DECLARE_EXPORT) + #define APU_DECLARE(type) __declspec(dllexport) type __stdcall + #define APU_DECLARE_NONSTD(type) __declspec(dllexport) type __cdecl + #define APU_DECLARE_DATA __declspec(dllexport) + #else + #define APU_DECLARE(type) __declspec(dllimport) type __stdcall + #define APU_DECLARE_NONSTD(type) __declspec(dllimport) type __cdecl + #define APU_DECLARE_DATA __declspec(dllimport) + #endif + # ``` + # When building, BUILD_SHARED_LIBS sets APU_DECLARE_STATIC to 0 and APU_DECLARE_EXPORT to 1 + # Not BUILD_SHARED_LIBS sets APU_DECLARE_STATIC to 1 and APU_DECLARE_EXPORT to 0 + # When consuming APU_DECLARE_EXPORT is always 0 (assumed), so we need only embed the static or not setting + # into the resulting headers: if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - string(REPLACE "defined(APU_DECLARE_STATIC)" "0" APU_H "${APU_H}") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/apu.h" "defined(APU_DECLARE_STATIC)" "0") else() - string(REPLACE "defined(APU_DECLARE_STATIC)" "1" APU_H "${APU_H}") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/apu.h" "defined(APU_DECLARE_STATIC)" "1") endif() - file(WRITE ${CURRENT_PACKAGES_DIR}/include/apu.h "${APU_H}") - else() vcpkg_extract_source_archive( SOURCE_PATH - ARCHIVE ${ARCHIVE} + ARCHIVE "${ARCHIVE}" ) # To cross-compile you will need a triplet file that locates the tool chain and sets --host and --cache parameters of "./configure". @@ -53,7 +69,7 @@ else() vcpkg_configure_make( SOURCE_PATH "${SOURCE_PATH}" - OPTIONS + OPTIONS "--prefix=${CURRENT_INSTALLED_DIR}" "--with-apr=${CURRENT_INSTALLED_DIR}/tools/apr" "--with-openssl=${CURRENT_INSTALLED_DIR}" @@ -64,7 +80,6 @@ else() ) vcpkg_install_make() - vcpkg_fixup_pkgconfig() vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/apr-util/bin/apu-1-config" "${CURRENT_INSTALLED_DIR}" "`dirname $0`/../../..") vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/apr-util/bin/apu-1-config" "${CURRENT_BUILDTREES_DIR}" "not/existing") @@ -72,8 +87,6 @@ else() vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/apr-util/debug/bin/apu-1-config" "${CURRENT_INSTALLED_DIR}" "`dirname $0`/../../../..") vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/apr-util/debug/bin/apu-1-config" "${CURRENT_BUILDTREES_DIR}" "not/existing") endif() - endif() -# Handle copyright file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/versions/a-/apr-util.json b/versions/a-/apr-util.json index 4f7640c8369b49..62ec27274bc7c8 100644 --- a/versions/a-/apr-util.json +++ b/versions/a-/apr-util.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "9139d892590cf0bb187a8be85e2b950664133cbc", + "git-tree": "b6d7bb58f16bd75a40a434742d0c0a12b89645d4", "version": "1.6.1", "port-version": 9 },