2018-08-08 19:15:13 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
2023-09-14 07:51:44 +08:00
|
|
|
REPO libimobiledevice/libirecovery
|
|
|
|
REF c7b488fbf2a9ab95e451df1319e68662fff7b9b7 # commits on 2023-05-13
|
|
|
|
SHA512 a8638b71789c0cedf5913a877ca42fef079c968592b6149dfa578d2dc7840f63c1d1fadd934d7cfbd5139cea2b3a4249886a88b69c3edb19dbd3f893c266f665
|
|
|
|
HEAD_REF master
|
|
|
|
PATCHES
|
|
|
|
001_fix_static_build.patch
|
|
|
|
002_fix_api.patch
|
|
|
|
003_fix_msvc.patch
|
2023-09-23 07:05:44 +08:00
|
|
|
004_fix_tools_msvc.patch
|
2018-08-08 19:15:13 +08:00
|
|
|
)
|
|
|
|
|
2023-09-14 07:51:44 +08:00
|
|
|
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
|
|
|
|
|
2023-09-23 07:05:44 +08:00
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
|
|
FEATURES
|
|
|
|
tools BUILD_TOOLS
|
|
|
|
)
|
|
|
|
|
|
|
|
if("tools" IN_LIST FEATURES)
|
|
|
|
vcpkg_find_acquire_program(PKGCONFIG)
|
|
|
|
list(APPEND FEATURE_OPTIONS "-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}")
|
|
|
|
endif()
|
|
|
|
|
2023-09-14 07:51:44 +08:00
|
|
|
vcpkg_cmake_configure(
|
2023-08-17 03:56:04 +08:00
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2023-09-23 07:05:44 +08:00
|
|
|
OPTIONS
|
|
|
|
${FEATURE_OPTIONS}
|
2018-08-08 19:15:13 +08:00
|
|
|
)
|
|
|
|
|
2023-09-14 07:51:44 +08:00
|
|
|
vcpkg_cmake_install()
|
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-${PORT})
|
|
|
|
vcpkg_fixup_pkgconfig()
|
2023-09-23 07:05:44 +08:00
|
|
|
if("tools" IN_LIST FEATURES)
|
|
|
|
vcpkg_copy_tools(TOOL_NAMES irecovery AUTO_CLEAN)
|
|
|
|
endif()
|
2023-09-14 07:51:44 +08:00
|
|
|
|
|
|
|
if (VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/libirecovery.h"
|
|
|
|
"#ifdef IRECV_STATIC" "#if 1"
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/libirecovery.h"
|
|
|
|
"#ifdef IRECV_STATIC" "#if 0"
|
|
|
|
)
|
|
|
|
endif()
|
2023-08-17 03:56:04 +08:00
|
|
|
|
2023-09-14 07:51:44 +08:00
|
|
|
file(READ "${CURRENT_PACKAGES_DIR}/share/unofficial-${PORT}/unofficial-${PORT}-config.cmake" cmake_config)
|
|
|
|
file(WRITE "${CURRENT_PACKAGES_DIR}/share/unofficial-${PORT}/unofficial-${PORT}-config.cmake"
|
|
|
|
"include(CMakeFindDependencyMacro)
|
|
|
|
find_dependency(unofficial-libimobiledevice-glue CONFIG)
|
|
|
|
${cmake_config}
|
|
|
|
")
|
|
|
|
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
|
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
|
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|