build.lua 726 bytes · raw
-- 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 925 bytes · raw
# 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"]