2017-07-13 00:26:28 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO libarchive/libarchive
|
2023-01-25 08:40:21 +08:00
|
|
|
REF "v${VERSION}"
|
2024-02-13 06:53:06 +08:00
|
|
|
SHA512 86a4e325879cde826df068d1154ccf031bbca7a0afa3f2afc57fa41322af245ec477db9fb38fff298c9e269261de1a2ece7849ae1a3512e0ebeb8414167372c0
|
2018-07-01 12:05:51 +08:00
|
|
|
HEAD_REF master
|
2022-01-26 02:31:15 +08:00
|
|
|
PATCHES
|
2021-09-14 05:39:54 +08:00
|
|
|
disable-warnings.patch
|
2019-08-25 04:43:57 +08:00
|
|
|
fix-buildsystem.patch
|
2019-12-22 03:34:24 +08:00
|
|
|
fix-cpu-set.patch
|
2022-05-18 14:57:24 +08:00
|
|
|
fix-deps.patch
|
2018-07-01 12:05:51 +08:00
|
|
|
)
|
2017-01-06 04:22:32 +08:00
|
|
|
|
2020-01-18 08:13:12 +08:00
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
2021-08-10 15:57:48 +08:00
|
|
|
FEATURES
|
|
|
|
bzip2 ENABLE_BZip2
|
2022-05-18 14:57:24 +08:00
|
|
|
bzip2 CMAKE_REQUIRE_FIND_PACKAGE_BZip2
|
2021-08-10 15:57:48 +08:00
|
|
|
libxml2 ENABLE_LIBXML2
|
2022-05-18 14:57:24 +08:00
|
|
|
libxml2 CMAKE_REQUIRE_FIND_PACKAGE_LibXml2
|
2021-08-10 15:57:48 +08:00
|
|
|
lz4 ENABLE_LZ4
|
2022-05-18 14:57:24 +08:00
|
|
|
lz4 CMAKE_REQUIRE_FIND_PACKAGE_lz4
|
2021-08-10 15:57:48 +08:00
|
|
|
lzma ENABLE_LZMA
|
2022-05-18 14:57:24 +08:00
|
|
|
lzma CMAKE_REQUIRE_FIND_PACKAGE_LibLZMA
|
2021-08-10 15:57:48 +08:00
|
|
|
lzo ENABLE_LZO
|
|
|
|
zstd ENABLE_ZSTD
|
2020-01-18 08:13:12 +08:00
|
|
|
)
|
2023-01-25 08:40:21 +08:00
|
|
|
# Default crypto backend is OpenSSL, but it is ignored for DARWIN
|
|
|
|
set(WRAPPER_ENABLE_OPENSSL OFF)
|
|
|
|
if(NOT "crypto" IN_LIST FEATURES)
|
|
|
|
list(APPEND FEATURE_OPTIONS
|
|
|
|
-DLIBMD_FOUND=FALSE
|
|
|
|
-DENABLE_OPENSSL=OFF
|
|
|
|
)
|
|
|
|
elseif(VCPKG_TARGET_IS_OSX)
|
|
|
|
list(APPEND FEATURE_OPTIONS
|
|
|
|
-DENABLE_MBEDTLS=ON
|
|
|
|
-DENABLE_OPENSSL=OFF
|
|
|
|
-DCMAKE_REQUIRE_FIND_PACKAGE_MbedTLS=ON
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
set(WRAPPER_ENABLE_OPENSSL ON)
|
|
|
|
list(APPEND FEATURE_OPTIONS
|
|
|
|
-DCMAKE_REQUIRE_FIND_PACKAGE_OpenSSL=ON
|
|
|
|
)
|
|
|
|
endif()
|
2018-10-09 11:30:12 +08:00
|
|
|
|
2021-09-25 03:06:17 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2017-01-06 04:22:32 +08:00
|
|
|
OPTIONS
|
2020-01-18 08:13:12 +08:00
|
|
|
${FEATURE_OPTIONS}
|
2021-09-25 03:06:17 +08:00
|
|
|
-DENABLE_ZLIB=ON
|
2018-10-09 11:30:12 +08:00
|
|
|
-DENABLE_PCREPOSIX=OFF
|
2021-09-25 03:06:17 +08:00
|
|
|
-DPOSIX_REGEX_LIB=NONE
|
2024-02-13 06:53:06 +08:00
|
|
|
-DENABLE_MBEDTLS=OFF
|
2017-01-06 04:22:32 +08:00
|
|
|
-DENABLE_NETTLE=OFF
|
|
|
|
-DENABLE_EXPAT=OFF
|
|
|
|
-DENABLE_LibGCC=OFF
|
|
|
|
-DENABLE_CNG=OFF
|
|
|
|
-DENABLE_TAR=OFF
|
|
|
|
-DENABLE_CPIO=OFF
|
|
|
|
-DENABLE_CAT=OFF
|
|
|
|
-DENABLE_XATTR=OFF
|
|
|
|
-DENABLE_ACL=OFF
|
2017-01-26 13:14:57 +08:00
|
|
|
-DENABLE_ICONV=OFF
|
2021-05-12 01:37:52 +08:00
|
|
|
-DENABLE_LIBB2=OFF
|
2020-04-18 05:13:24 +08:00
|
|
|
-DENABLE_TEST=OFF
|
2019-08-25 04:43:57 +08:00
|
|
|
-DENABLE_WERROR=OFF
|
2023-01-25 08:40:21 +08:00
|
|
|
MAYBE_UNUSED_VARIABLES
|
|
|
|
CMAKE_REQUIRE_FIND_PACKAGE_BZip2
|
|
|
|
CMAKE_REQUIRE_FIND_PACKAGE_LibLZMA
|
|
|
|
CMAKE_REQUIRE_FIND_PACKAGE_LibXml2
|
|
|
|
CMAKE_REQUIRE_FIND_PACKAGE_lz4
|
|
|
|
ENABLE_LibGCC
|
2019-08-25 04:43:57 +08:00
|
|
|
)
|
2017-01-06 04:22:32 +08:00
|
|
|
|
2021-09-25 03:06:17 +08:00
|
|
|
vcpkg_cmake_install()
|
2021-01-17 11:26:38 +08:00
|
|
|
|
2021-08-10 15:57:48 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
|
|
|
|
2017-01-06 04:22:32 +08:00
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
2021-01-17 11:26:38 +08:00
|
|
|
configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake.in" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY)
|
|
|
|
|
2024-02-13 06:53:06 +08:00
|
|
|
file(REMOVE_RECURSE
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/include"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/share"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/share/man"
|
|
|
|
)
|
2021-01-17 11:26:38 +08:00
|
|
|
|
2023-01-25 08:40:21 +08:00
|
|
|
foreach(header "include/archive.h" "include/archive_entry.h")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/${header}" "(!defined LIBARCHIVE_STATIC)" "0")
|
2017-04-05 22:06:42 +08:00
|
|
|
endforeach()
|
2017-01-06 04:22:32 +08:00
|
|
|
|
2021-09-25 03:06:17 +08:00
|
|
|
file(INSTALL "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
|
|
|
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|