From 5c480eafdaacad6d4a1797dd794473e1eac81b4e Mon Sep 17 00:00:00 2001 From: Park DongHa Date: Tue, 9 Apr 2024 09:56:59 +0900 Subject: [PATCH] [liblzma] Create a new port with v5.4.6 (#190) * [liblzma] Create a new port with v5.4.6 * [liblzma] update baseline * ci: test `liblzma` port --- .circleci/port-linux.txt | 1 + ports/liblzma/portfile.cmake | 59 ++++++++++++++++++++++++++++++++++++ ports/liblzma/vcpkg.json | 17 +++++++++++ test/self-hosted.json | 1 + versions/baseline.json | 4 +++ versions/l-/liblzma.json | 9 ++++++ 6 files changed, 91 insertions(+) create mode 100644 ports/liblzma/portfile.cmake create mode 100644 ports/liblzma/vcpkg.json create mode 100644 versions/l-/liblzma.json diff --git a/.circleci/port-linux.txt b/.circleci/port-linux.txt index 137cbc82..fa0cf4f5 100644 --- a/.circleci/port-linux.txt +++ b/.circleci/port-linux.txt @@ -2,3 +2,4 @@ protobuf grpc[codegen] flatbuffers abseil +liblzma diff --git a/ports/liblzma/portfile.cmake b/ports/liblzma/portfile.cmake new file mode 100644 index 00000000..8b9090f8 --- /dev/null +++ b/ports/liblzma/portfile.cmake @@ -0,0 +1,59 @@ +# https://sourceforge.net/projects/lzmautils/ +# https://sourceforge.net/projects/lzmautils/files/xz-5.4.6.tar.xz/download +vcpkg_from_sourceforge( + OUT_SOURCE_PATH SOURCE_PATH + REPO lzmautils + FILENAME xz-5.4.6.tar.xz + SHA512 495cc890d25c075c927c907b77e60d86dd8a4c377cea5b1172c8e916984149a7bb5fb32db25091f7219346b83155b47e4bc0404cc8529d992014cd7ed0c278b7 +) + +if(VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_IOS) + # https://cmake.org/cmake/help/latest/module/FindLibLZMA.html + message(WARNING "Forcing system built-in LibLZMA") + message(STATUS "Installing LibLZMA headers") + set(VCPKG_POLICY_EMPTY_PACKAGE enabled) + file(INSTALL "${SOURCE_PATH}/src/liblzma/api/" DESTINATION "${CURRENT_PACKAGES_DIR}/include") + file(REMOVE + "${CURRENT_PACKAGES_DIR}/include/Makefile.am" + "${CURRENT_PACKAGES_DIR}/include/Makefile.in" + ) + return() +endif() + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DBUILD_TESTING=OFF + -DCREATE_XZ_SYMLINKS=OFF + -DCREATE_LZMA_SYMLINKS=OFF + -DENABLE_SMALL=${VCPKG_TARGET_IS_ANDROID} + -DHAVE_GETOPT_LONG=OFF + MAYBE_UNUSED_VARIABLES + CREATE_XZ_SYMLINKS + CREATE_LZMA_SYMLINKS +) +vcpkg_cmake_install() +vcpkg_copy_pdbs() +if(NOT VCPKG_TARGET_IS_WINDOWS) + vcpkg_fixup_pkgconfig() +endif() +# https://cmake.org/cmake/help/latest/module/FindLibLZMA.html +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/liblzma PACKAGE_NAME liblzma) + +file(REMOVE_RECURSE + "${CURRENT_PACKAGES_DIR}/debug/include" + "${CURRENT_PACKAGES_DIR}/debug/share" + "${CURRENT_PACKAGES_DIR}/share/man" +) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(REMOVE_RECURSE + "${CURRENT_PACKAGES_DIR}/bin" + "${CURRENT_PACKAGES_DIR}/debug/bin" + ) +endif() + +file(INSTALL "${SOURCE_PATH}/README" "${SOURCE_PATH}/THANKS" + DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" +) +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING") diff --git a/ports/liblzma/vcpkg.json b/ports/liblzma/vcpkg.json new file mode 100644 index 00000000..38c03869 --- /dev/null +++ b/ports/liblzma/vcpkg.json @@ -0,0 +1,17 @@ +{ + "name": "liblzma", + "version": "5.4.6", + "description": "Compression library with an API similar to that of zlib.", + "homepage": "https://sourceforge.net/projects/lzmautils/", + "license": null, + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} diff --git a/test/self-hosted.json b/test/self-hosted.json index 8d5e0862..103b8322 100644 --- a/test/self-hosted.json +++ b/test/self-hosted.json @@ -6,6 +6,7 @@ "homepage": "https://github.com/luncliff/vcpkg-registry", "supports": "windows", "dependencies": [ + "liblzma", { "name": "d3d12-transition-layer", "features": [ diff --git a/versions/baseline.json b/versions/baseline.json index 97ac4c11..f9bc95eb 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -68,6 +68,10 @@ "baseline": "swift-5.10", "port-version": 0 }, + "liblzma": { + "baseline": "5.4.6", + "port-version": 0 + }, "llama-cpp": { "baseline": "b1695", "port-version": 0 diff --git a/versions/l-/liblzma.json b/versions/l-/liblzma.json new file mode 100644 index 00000000..896aa337 --- /dev/null +++ b/versions/l-/liblzma.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "a990dde00453701a6f899ee6741033b4c6f9e2fb", + "version": "5.4.6", + "port-version": 0 + } + ] +}