diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/kf5archive | |
Diffstat (limited to 'vcpkg/ports/kf5archive')
| -rw-r--r-- | vcpkg/ports/kf5archive/control-dependencies.patch | 56 | ||||
| -rw-r--r-- | vcpkg/ports/kf5archive/portfile.cmake | 42 | ||||
| -rw-r--r-- | vcpkg/ports/kf5archive/vcpkg.json | 45 |
3 files changed, 143 insertions, 0 deletions
diff --git a/vcpkg/ports/kf5archive/control-dependencies.patch b/vcpkg/ports/kf5archive/control-dependencies.patch new file mode 100644 index 0000000..26a7d3a --- /dev/null +++ b/vcpkg/ports/kf5archive/control-dependencies.patch @@ -0,0 +1,56 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 958e22d..00b9736 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -36,6 +36,7 @@ set_package_properties(BZip2 PROPERTIES + TYPE RECOMMENDED + PURPOSE "Support for BZip2 compressed files and data streams" + ) ++set(BZIP2_FOUND "${VCPKG_USE_BZIP2}") + + find_package(LibLZMA) + set_package_properties(LibLZMA PROPERTIES +@@ -43,6 +44,7 @@ set_package_properties(LibLZMA PROPERTIES + DESCRIPTION "Support for xz compressed files and data streams" + PURPOSE "Support for xz compressed files and data streams" + ) ++set(LIBLZMA_FOUND "${VCPKG_USE_LIBLZMA}") + + find_package(PkgConfig) + if (PkgConfig_FOUND) +@@ -51,6 +53,8 @@ endif() + add_feature_info(LibZstd LibZstd_FOUND + "Support for zstd compressed files and data streams" + ) ++find_package(zstd CONFIG) ++set(LibZstd_FOUND "${VCPKG_USE_ZSTD}") + + include(ECMSetupVersion) + include(ECMGenerateHeaders) +diff --git a/KF5ArchiveConfig.cmake.in b/KF5ArchiveConfig.cmake.in +index 0a738c2..b4d96a5 100644 +--- a/KF5ArchiveConfig.cmake.in ++++ b/KF5ArchiveConfig.cmake.in +@@ -23,8 +23,7 @@ if (NOT @BUILD_SHARED_LIBS@) + endif() + + if (@LibZstd_FOUND@) +- find_package(PkgConfig) +- pkg_check_modules(LibZstd IMPORTED_TARGET "libzstd") ++ find_dependency(zstd CONFIG) + endif() + endif() + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 675ddf4..9363637 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -24,7 +24,7 @@ endif() + + if (LibZstd_FOUND) + target_sources(KF5Archive PRIVATE kzstdfilter.cpp) +- target_link_libraries(KF5Archive PRIVATE PkgConfig::LibZstd) ++ target_link_libraries(KF5Archive PRIVATE $<IF:$<TARGET_EXISTS:zstd::libzstd_shared>,zstd::libzstd_shared,zstd::libzstd_static>) + endif() + + diff --git a/vcpkg/ports/kf5archive/portfile.cmake b/vcpkg/ports/kf5archive/portfile.cmake new file mode 100644 index 0000000..8fced2f --- /dev/null +++ b/vcpkg/ports/kf5archive/portfile.cmake @@ -0,0 +1,42 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO KDE/karchive + REF v5.98.0 + SHA512 3477280f319cb37e18c59d874f5bcf4db5c76e3572af6e2c91bad1135f16a2eb1c9fcc0ec9895790031e6d459b94eeb14be10ea7aab0660d037241bdf6662358 + HEAD_REF master + PATCHES + control-dependencies.patch +) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + "bzip2" VCPKG_USE_BZIP2 + "lzma" VCPKG_USE_LIBLZMA + "zstd" VCPKG_USE_ZSTD +) + +# Prevent KDEClangFormat from writing to source effectively blocking parallel configure +file(WRITE "${SOURCE_PATH}/.clang-format" "DisableFormat: true\nSortIncludes: false\n") + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DCMAKE_DISABLE_FIND_PACKAGE_PkgConfig=ON + -DBUILD_TESTING=OFF + ${FEATURE_OPTIONS} +) + +vcpkg_cmake_install() +vcpkg_cmake_config_fixup(PACKAGE_NAME KF5Archive CONFIG_PATH lib/cmake/KF5Archive) +vcpkg_copy_pdbs() + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") +endif() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") + +file(GLOB LICENSE_FILES "${SOURCE_PATH}/LICENSES/*") +vcpkg_install_copyright(FILE_LIST ${LICENSE_FILES}) + diff --git a/vcpkg/ports/kf5archive/vcpkg.json b/vcpkg/ports/kf5archive/vcpkg.json new file mode 100644 index 0000000..7432e5a --- /dev/null +++ b/vcpkg/ports/kf5archive/vcpkg.json @@ -0,0 +1,45 @@ +{ + "name": "kf5archive", + "version": "5.98.0", + "port-version": 1, + "description": "File compression", + "homepage": "https://api.kde.org/frameworks/karchive/html/index.html", + "license": "LGPL-2.0-or-later", + "supports": "!xbox", + "dependencies": [ + "ecm", + "qt5-base", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + }, + "zlib" + ], + "default-features": [ + "bzip2" + ], + "features": { + "bzip2": { + "description": "Support for bzip2 compressed files and data streams", + "dependencies": [ + "bzip2" + ] + }, + "lzma": { + "description": "Support for xz compressed files and data streams", + "dependencies": [ + "liblzma" + ] + }, + "zstd": { + "description": "Support for zstd compressed files and data streams", + "dependencies": [ + "zstd" + ] + } + } +} |