Otok public index

apotocki/zstd

Zstandard, a fast lossless compression algorithm.

Library
zstd
Newest
1.5.7 (r1, android)
Targets
android, apple, linux, windows
License
BSD-3-Clause OR GPL-2.0-only
Homepage
https://facebook.github.io/zstd/
Documentation
https://facebook.github.io/zstd/zstd_manual.html
Keywords
compression, zstd

Use it

In otok.toml:

[deps.zstd]
recipe = "apotocki/zstd"
version = "~> 1.5.7"

Versions

VersionTargetChannelPublishedStatus
1.5.7 (r1, android) android stable 2026-11-13
1.5.7 (r1, apple) apple stable 2026-11-14
1.5.7 (r1, linux) linux stable 2026-11-14
1.5.7 (r1, windows) windows stable 2026-11-13

1.5.7 (r1, android)

Platforms

android

Toolchains

Recipe files

build.lua 868 bytes · raw
-- The CMake project in build/cmake, the library only (no programs, tests or contrib). What it installs: libzstd.a, or libzstd.so
-- with its links.
function build(slice, options, deps)
    local static = slice.linkage == "static"
    otok.cmake{
        source = slice.source .. "/build/cmake",
        defines = { ZSTD_BUILD_STATIC = static, ZSTD_BUILD_SHARED = not static, ZSTD_BUILD_PROGRAMS = false,
            ZSTD_BUILD_TESTS = false, ZSTD_BUILD_CONTRIB = false, ZSTD_FRAMEWORK = false,
            -- zstd tests the level to know whether bionic has fseeko, and its CMake leaves threads off for Android
            ANDROID_PLATFORM_LEVEL = slice.android.api, ZSTD_MULTITHREAD_SUPPORT = true },
    }
    local p = slice.prefix
    return { libraries = { zstd = otok.glob(static and "lib/libzstd.a" or "lib/libzstd.so", p)[1] }, headers = p .. "/include" }
end
recipe.toml 1010 bytes · raw
# The otok recipe of Zstandard (https://github.com/apotocki/otok): libzstd for Android, from the release archive, with the
# CMake project in build/cmake, the library only; static or dynamic.
[recipe]
api = 1
library = "zstd"
name = "zstd"
version = "1.5.7"
revision = 1
license = "BSD-3-Clause OR GPL-2.0-only"
license-files = ["LICENSE"]
homepage = "https://facebook.github.io/zstd/"
documentation = "https://facebook.github.io/zstd/zstd_manual.html"
description = "Zstandard, a fast lossless compression algorithm."
keywords = ["compression", "zstd"]
linkage = ["static", "dynamic"]

[source]
url = "https://github.com/facebook/zstd/releases/download/v1.5.7/zstd-1.5.7.tar.gz"
sha256 = "eb33e51f49a15e023950cd7825ca74a4a2b43db8354825ac24fc1b7ee09e6fa3"

[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 = "Zstd"
libraries = ["zstd"]