Otok public index

apotocki/zlib

zlib, the general-purpose compression library.

Library
zlib
Newest
1.3.2 (r1, linux)
Targets
linux, windows
License
Zlib
Homepage
https://zlib.net
Keywords
compression, deflate, zlib

Use it

In otok.toml:

[deps.zlib]
recipe = "apotocki/zlib"
version = "~> 1.3.2"

Versions

VersionTargetChannelPublishedStatus
1.3.2 (r1, linux) linux stable 2026-11-07
1.3.2 (r1, windows) windows stable 2026-11-07

1.3.2 (r1, linux)

Platforms

linux

Toolchains

Recipe files

build.lua 469 bytes · raw
-- zlib's CMake project, the library only. What it installs: libz.a, or libz.so with its links.

function build(slice, options, deps)
    local static = slice.linkage == "static"
    otok.cmake{ defines = { ZLIB_BUILD_SHARED = not static, ZLIB_BUILD_STATIC = static, ZLIB_BUILD_TESTING = false } }
    local p = slice.prefix
    local lib = otok.glob(static and "lib/libz.a" or "lib/libz.so", p)[1]
    return { libraries = { z = lib }, headers = p .. "/include" }
end
recipe.toml 856 bytes · raw
# The otok recipe of zlib (https://github.com/apotocki/otok): libz for Linux, from the release archive; static or
# dynamic.
[recipe]
api = 1
library = "zlib"
name = "zlib"
version = "1.3.2"
revision = 1
license = "Zlib"
license-files = ["LICENSE"]
homepage = "https://zlib.net"
description = "zlib, the general-purpose compression library."
keywords = ["compression", "deflate", "zlib"]
linkage = ["static", "dynamic"]

[source]
url = "https://github.com/madler/zlib/releases/download/v1.3.2/zlib-1.3.2.tar.gz"
sha256 = "bb329a0a2cd0274d05519d61c667c062e06990d72e125ee2dfa8de64f0119d16"

[platforms]
supported = ["linux"]
build-on = ["linux/gcc", "linux/clang"]

[toolchains]
cmake = { version = ">= 3.20", default-recipe = "apotocki/cmake" }
ninja = { version = ">= 1.10", default-recipe = "apotocki/ninja" }

[[product]]
name = "ZLIB"
libraries = ["z"]