2017-06-27 17:34:09 -07:00
|
|
|
vcpkg_download_distfile(ARCHIVE
|
2023-09-29 14:15:38 +08:00
|
|
|
URLS "https://archive.apache.org/dist/apr/apr-util-${VERSION}.tar.bz2"
|
|
|
|
FILENAME "apr-util-${VERSION}.tar.bz2"
|
|
|
|
SHA512 8050a481eeda7532ef3751dbd8a5aa6c48354d52904a856ef9709484f4b0cc2e022661c49ddf55ec58253db22708ee0607dfa7705d9270e8fee117ae4f06a0fe
|
2017-06-27 20:31:49 -07:00
|
|
|
)
|
|
|
|
|
2022-11-07 15:34:34 -08:00
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
|
|
FEATURES
|
|
|
|
crypto APU_HAVE_CRYPTO
|
|
|
|
crypto CMAKE_REQUIRE_FIND_PACKAGE_OpenSSL
|
|
|
|
)
|
|
|
|
|
2020-05-07 06:20:49 +10:00
|
|
|
if(VCPKG_TARGET_IS_WINDOWS)
|
2022-10-26 12:56:35 -07:00
|
|
|
vcpkg_extract_source_archive(
|
|
|
|
SOURCE_PATH
|
2021-11-19 05:42:56 +01:00
|
|
|
ARCHIVE "${ARCHIVE}"
|
2020-05-07 06:20:49 +10:00
|
|
|
PATCHES
|
|
|
|
use-vcpkg-expat.patch
|
|
|
|
apr.patch
|
2022-08-01 20:17:11 +02:00
|
|
|
unglue.patch
|
2020-05-07 06:20:49 +10:00
|
|
|
)
|
|
|
|
|
2021-11-19 05:42:56 +01:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2022-11-07 15:34:34 -08:00
|
|
|
OPTIONS
|
|
|
|
${FEATURE_OPTIONS}
|
2020-05-07 06:20:49 +10:00
|
|
|
OPTIONS_DEBUG
|
|
|
|
-DDISABLE_INSTALL_HEADERS=ON
|
|
|
|
)
|
|
|
|
|
2021-11-19 05:42:56 +01:00
|
|
|
vcpkg_cmake_install()
|
2020-05-07 06:20:49 +10:00
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
2022-10-26 12:56:35 -07:00
|
|
|
# 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:
|
2020-05-07 06:20:49 +10:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
2022-10-26 12:56:35 -07:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/apu.h" "defined(APU_DECLARE_STATIC)" "0")
|
2020-05-07 06:20:49 +10:00
|
|
|
else()
|
2022-10-26 12:56:35 -07:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/apu.h" "defined(APU_DECLARE_STATIC)" "1")
|
2020-05-07 06:20:49 +10:00
|
|
|
endif()
|
2021-11-19 05:42:56 +01:00
|
|
|
else()
|
2022-10-26 12:56:35 -07:00
|
|
|
vcpkg_extract_source_archive(
|
|
|
|
SOURCE_PATH
|
|
|
|
ARCHIVE "${ARCHIVE}"
|
2020-05-07 06:20:49 +10:00
|
|
|
)
|
|
|
|
|
2022-11-07 15:34:34 -08:00
|
|
|
if ("crypto" IN_LIST FEATURES)
|
|
|
|
set(CRYPTO_OPTIONS
|
|
|
|
"--with-crypto=yes"
|
|
|
|
"--with-openssl=${CURRENT_INSTALLED_DIR}")
|
|
|
|
else()
|
|
|
|
set(CRYPTO_OPTIONS "--with-crypto=no")
|
|
|
|
endif()
|
|
|
|
|
2020-05-07 06:20:49 +10:00
|
|
|
# To cross-compile you will need a triplet file that locates the tool chain and sets --host and --cache parameters of "./configure".
|
|
|
|
# The ${VCPKG_PLATFORM_TOOLSET}.cache file must have been generated on the targeted host using "./configure -C".
|
|
|
|
# For example, to target aarch64-linux-gnu, triplets/aarch64-linux-gnu.cmake should contain (beyond the standard content):
|
|
|
|
# set(VCPKG_PLATFORM_TOOLSET aarch64-linux-gnu)
|
|
|
|
# set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE ${MY_CROSS_DIR}/cmake/Toolchain-${VCPKG_PLATFORM_TOOLSET}.cmake)
|
|
|
|
# set(CONFIGURE_PARAMETER_1 --host=${VCPKG_PLATFORM_TOOLSET})
|
|
|
|
# set(CONFIGURE_PARAMETER_2 --cache-file=${MY_CROSS_DIR}/autoconf/${VCPKG_PLATFORM_TOOLSET}.cache)
|
|
|
|
if(CONFIGURE_PARAMETER_1)
|
|
|
|
message(STATUS "Configuring apr-util with ${CONFIGURE_PARAMETER_1} ${CONFIGURE_PARAMETER_2} ${CONFIGURE_PARAMETER_3}")
|
|
|
|
else()
|
|
|
|
message(STATUS "Configuring apr-util")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
vcpkg_configure_make(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2022-10-26 12:56:35 -07:00
|
|
|
OPTIONS
|
2020-05-07 06:20:49 +10:00
|
|
|
"--prefix=${CURRENT_INSTALLED_DIR}"
|
2022-11-07 15:34:34 -08:00
|
|
|
${CRYPTO_OPTIONS}
|
2020-05-26 02:52:48 +08:00
|
|
|
"--with-apr=${CURRENT_INSTALLED_DIR}/tools/apr"
|
2022-11-07 15:34:34 -08:00
|
|
|
"--with-expat=${CURRENT_INSTALLED_DIR}"
|
2020-05-07 06:20:49 +10:00
|
|
|
"${CONFIGURE_PARAMETER_1}"
|
|
|
|
"${CONFIGURE_PARAMETER_2}"
|
|
|
|
"${CONFIGURE_PARAMETER_3}"
|
|
|
|
)
|
2019-10-07 19:35:13 +02:00
|
|
|
|
2020-05-07 06:20:49 +10:00
|
|
|
vcpkg_install_make()
|
2021-11-19 05:42:56 +01:00
|
|
|
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")
|
|
|
|
if(NOT VCPKG_BUILD_TYPE)
|
|
|
|
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()
|
2017-07-10 20:45:34 -07:00
|
|
|
endif()
|
|
|
|
|
2021-11-19 05:42:56 +01:00
|
|
|
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|