Skip to content

Commit

Permalink
[liblzma] Create a new port with v5.4.6 (#190)
Browse files Browse the repository at this point in the history
* [liblzma] Create a new port with v5.4.6

* [liblzma] update baseline

* ci: test `liblzma` port
  • Loading branch information
luncliff authored Apr 9, 2024
1 parent f1cf94e commit 5c480ea
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 0 deletions.
1 change: 1 addition & 0 deletions .circleci/port-linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ protobuf
grpc[codegen]
flatbuffers
abseil
liblzma
59 changes: 59 additions & 0 deletions ports/liblzma/portfile.cmake
Original file line number Diff line number Diff line change
@@ -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")
17 changes: 17 additions & 0 deletions ports/liblzma/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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
}
]
}
1 change: 1 addition & 0 deletions test/self-hosted.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"homepage": "https://github.com/luncliff/vcpkg-registry",
"supports": "windows",
"dependencies": [
"liblzma",
{
"name": "d3d12-transition-layer",
"features": [
Expand Down
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions versions/l-/liblzma.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "a990dde00453701a6f899ee6741033b4c6f9e2fb",
"version": "5.4.6",
"port-version": 0
}
]
}

0 comments on commit 5c480ea

Please sign in to comment.