apotocki/libpng
libpng, the reference library for PNG images.
- Library
- libpng
- Newest
- 1.6.47 (r1, linux)
- Targets
- linux, windows
- License
- libpng-2.0
- Homepage
- http://www.libpng.org/pub/png/libpng.html
- Keywords
- png, image
Use it
In otok.toml:
[deps.libpng]
recipe = "apotocki/libpng"
version = "~> 1.6.47"
Versions
| Version | Target | Channel | Published | Status |
|---|---|---|---|---|
| 1.6.47 (r1, linux) | linux | stable | 2026-11-07 | |
| 1.6.47 (r1, windows) | windows | stable | 2026-11-07 |
1.6.47 (r1, linux)
Platforms
linux
Dependencies
| Library | Version | Recipe | Details |
|---|---|---|---|
| zlib | >= 1.2 |
apotocki/zlib |
Toolchains
cmake { default-recipe = "apotocki/cmake", version = ">= 3.20" }ninja { default-recipe = "apotocki/ninja", version = ">= 1.10" }
Recipe files
build.lua
-- libpng's CMake project, the library only. What it installs: libpng16.a, or libpng16.so with its links (libpng16d in
-- debug); the headers in include/ and include/libpng16/, and libpng.pc.
function build(slice, options, deps)
local static = slice.linkage == "static"
-- FindZLIB takes a static zlib only when told to look for one
otok.cmake{ defines = { PNG_SHARED = not static, PNG_STATIC = static, PNG_TESTS = false, PNG_TOOLS = false, PNG_FRAMEWORK = false,
ZLIB_USE_STATIC_LIBS = deps.zlib.linkage == "static" } }
local p = slice.prefix
local lib = otok.glob(static and "lib/libpng16*.a" or "lib/libpng16*.so", p)[1]
return { libraries = { png16 = lib }, headers = p .. "/include" }
end
recipe.toml
# The otok recipe of libpng (https://github.com/apotocki/otok): libpng16 for Linux, from the release tag, with zlib of
# its own recipe; static or dynamic.
[recipe]
api = 1
library = "libpng"
name = "libpng"
version = "1.6.47"
revision = 1
license = "libpng-2.0"
license-files = ["LICENSE"]
homepage = "http://www.libpng.org/pub/png/libpng.html"
description = "libpng, the reference library for PNG images."
keywords = ["png", "image"]
linkage = ["static", "dynamic"]
[source]
git = "https://github.com/pnggroup/libpng"
commit = "872555f4ba910252783af1507f9e7fe1653be252"
tag = "v1.6.47"
[platforms]
supported = ["linux"]
build-on = ["linux/gcc", "linux/clang"]
[deps.zlib]
version = ">= 1.2"
default-recipe = "apotocki/zlib"
[toolchains]
cmake = { version = ">= 3.20", default-recipe = "apotocki/cmake" }
ninja = { version = ">= 1.10", default-recipe = "apotocki/ninja" }
[[product]]
name = "PNG"
libraries = ["png16"]