2021-07-02 01:14:42 +08:00
|
|
|
set(BZIP2_VERSION 1.0.8)
|
|
|
|
vcpkg_download_distfile(ARCHIVE
|
|
|
|
URLS "https://sourceware.org/pub/bzip2/bzip2-${BZIP2_VERSION}.tar.gz"
|
|
|
|
FILENAME "bzip2-${BZIP2_VERSION}.tar.gz"
|
|
|
|
SHA512 083f5e675d73f3233c7930ebe20425a533feedeaaa9d8cc86831312a6581cefbe6ed0d08d2fa89be81082f2a5abdabca8b3c080bf97218a1bd59dc118a30b9f3
|
|
|
|
)
|
|
|
|
|
2023-04-14 00:13:15 +08:00
|
|
|
vcpkg_extract_source_archive(
|
|
|
|
SOURCE_PATH
|
2021-07-02 01:14:42 +08:00
|
|
|
ARCHIVE ${ARCHIVE}
|
|
|
|
PATCHES fix-import-export-macros.patch
|
2020-08-14 04:22:54 +08:00
|
|
|
)
|
|
|
|
|
2022-09-29 02:52:09 +08:00
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
|
|
INVERTED_FEATURES
|
|
|
|
tool BZIP2_SKIP_TOOLS
|
|
|
|
)
|
|
|
|
|
2020-08-14 04:22:54 +08:00
|
|
|
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
|
|
|
|
|
2022-09-29 02:52:09 +08:00
|
|
|
vcpkg_cmake_configure(
|
2020-08-14 04:22:54 +08:00
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2022-09-29 02:52:09 +08:00
|
|
|
OPTIONS
|
|
|
|
${FEATURE_OPTIONS}
|
2020-08-14 04:22:54 +08:00
|
|
|
OPTIONS_DEBUG
|
|
|
|
-DBZIP2_SKIP_HEADERS=ON
|
|
|
|
-DBZIP2_SKIP_TOOLS=ON
|
|
|
|
)
|
|
|
|
|
2022-09-29 02:52:09 +08:00
|
|
|
vcpkg_cmake_install()
|
2020-08-14 04:22:54 +08:00
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
|
|
|
file(READ "${CURRENT_PACKAGES_DIR}/include/bzlib.h" BZLIB_H)
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
|
|
|
string(REPLACE "defined(BZ_IMPORT)" "0" BZLIB_H "${BZLIB_H}")
|
|
|
|
else()
|
|
|
|
string(REPLACE "defined(BZ_IMPORT)" "1" BZLIB_H "${BZLIB_H}")
|
|
|
|
endif()
|
|
|
|
file(WRITE "${CURRENT_PACKAGES_DIR}/include/bzlib.h" "${BZLIB_H}")
|
|
|
|
|
|
|
|
if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
|
|
|
|
set(BZIP2_PREFIX "${CURRENT_INSTALLED_DIR}")
|
|
|
|
set(bzname bz2)
|
|
|
|
configure_file("${CMAKE_CURRENT_LIST_DIR}/bzip2.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/bzip2.pc" @ONLY)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
|
|
|
|
set(BZIP2_PREFIX "${CURRENT_INSTALLED_DIR}/debug")
|
|
|
|
set(bzname bz2d)
|
|
|
|
configure_file("${CMAKE_CURRENT_LIST_DIR}/bzip2.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/bzip2.pc" @ONLY)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
vcpkg_fixup_pkgconfig()
|
|
|
|
|
|
|
|
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
|
|
|
file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|