apotocki/lz4
LZ4, an extremely fast lossless compression library.
- Library
- lz4
- Newest
- 1.11.1 (r1, android)
- Targets
- android, apple, linux, windows
- License
- BSD-2-Clause
- Homepage
- https://lz4.org
- Keywords
- compression, lz4
Use it
In otok.toml:
[deps.lz4]
recipe = "apotocki/lz4"
version = "~> 1.11.1"
Versions
| Version | Target | Channel | Published | Status |
|---|---|---|---|---|
| 1.11.1 (r1, android) | android | stable | 2026-11-10 | |
| 1.11.1 (r1, apple) | apple | stable | 2026-11-10 | |
| 1.11.1 (r1, linux) | linux | stable | 2026-11-10 | |
| 1.11.1 (r1, windows) | windows | stable | 2026-11-10 | |
| 1.11.0 (r1, android) | android | stable | 2026-11-07 | |
| 1.11.0 (r1, apple) | apple | stable | 2026-11-07 | |
| 1.11.0 (r1, linux) | linux | stable | 2026-11-07 | |
| 1.11.0 (r1, windows) | windows | stable | 2026-11-07 | |
| 1.10.0 (r1, android) | android | stable | 2026-11-07 | |
| 1.10.0 (r1, apple) | apple | stable | 2026-11-07 | |
| 1.10.0 (r1, linux) | linux | stable | 2026-11-07 | |
| 1.10.0 (r1, windows) | windows | stable | 2026-11-07 |
1.11.1 (r1, android)
Platforms
android
Toolchains
cmake { default-recipe = "apotocki/cmake", version = ">= 3.20" }ninja { default-recipe = "apotocki/ninja", version = ">= 1.10" }
Recipe files
build.lua
-- The CMake project in build/cmake, the library only. What it installs: liblz4.a, or liblz4.so with its links.
function build(slice, options, deps)
local static = slice.linkage == "static"
otok.cmake{
source = slice.source .. "/build/cmake",
defines = { BUILD_STATIC_LIBS = static, LZ4_BUILD_CLI = false, LZ4_BUILD_LEGACY_LZ4C = false },
}
local p = slice.prefix
-- lz4file.h includes lz4frame_static.h, which the CMake project does not install
otok.copy(slice.source .. "/lib/lz4frame_static.h", p .. "/include/lz4frame_static.h")
return { libraries = { lz4 = otok.glob(static and "lib/liblz4.a" or "lib/liblz4.so", p)[1] }, headers = p .. "/include" }
end
recipe.toml
# The otok recipe of LZ4 (https://github.com/apotocki/otok): liblz4 for Android, from the release tag; static or
# dynamic.
[recipe]
api = 1
library = "lz4"
name = "lz4"
version = "1.11.1"
revision = 1
license = "BSD-2-Clause"
license-files = ["lib/LICENSE"]
homepage = "https://lz4.org"
description = "LZ4, an extremely fast lossless compression library."
keywords = ["compression", "lz4"]
linkage = ["static", "dynamic"]
[source]
git = "https://github.com/lz4/lz4"
commit = "aa4647fad575d01a874aaaadcdbe8e6a40e072f5"
tag = "v1.11.1"
[platforms]
supported = ["android"]
build-on = ["*/ndk"]
[toolchains]
cmake = { version = ">= 3.20", default-recipe = "apotocki/cmake" }
ninja = { version = ">= 1.10", default-recipe = "apotocki/ninja" }
[[product]]
name = "LZ4"
libraries = ["lz4"]