build.lua 1069 bytes · raw
-- libxml2's CMake project, the library only: no programs, tests, documentation, Python, ICU, readline, loadable modules or
-- network code. iconv is the system library. What it installs: libxml2.a, or libxml2.so with its links.
function build(slice, options, deps)
local static = slice.linkage == "static"
local defines = {
LIBXML2_WITH_PROGRAMS = false, LIBXML2_WITH_TESTS = false, LIBXML2_WITH_DOCS = false, LIBXML2_WITH_PYTHON = false,
LIBXML2_WITH_ICU = false, LIBXML2_WITH_READLINE = false, LIBXML2_WITH_MODULES = false, LIBXML2_WITH_HTTP = false,
LIBXML2_WITH_ICONV = true, LIBXML2_WITH_ZLIB = options.zlib,
}
if options.zlib then
local z = deps.zlib
defines.ZLIB_USE_STATIC_LIBS = z.linkage == "static"
defines.ZLIB_INCLUDE_DIR = z.include
defines.ZLIB_LIBRARY = z.libraries.z
end
otok.cmake{ defines = defines }
local p = slice.prefix
return { libraries = { xml2 = otok.glob(static and "lib/libxml2.a" or "lib/libxml2.so", p)[1] }, headers = p .. "/include/libxml2" }
end
recipe.toml 1295 bytes · raw
# The otok recipe of libxml2 (https://github.com/apotocki/otok): libxml2 for Linux, from the release archive, with libxml2's CMake, the
# library only (no xmllint, tests or Python); static or dynamic.
[recipe]
api = 1
library = "libxml2"
name = "libxml2"
version = "2.15.4"
revision = 1
license = "MIT"
license-files = ["Copyright"]
homepage = "https://gitlab.gnome.org/GNOME/libxml2"
documentation = "https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home"
description = "libxml2, the XML C parser and toolkit of GNOME."
keywords = ["xml", "html", "xpath", "parser"]
linkage = ["static", "dynamic"]
[source]
url = "https://download.gnome.org/sources/libxml2/2.15/libxml2-2.15.4.tar.xz"
sha256 = "98087fd181d9070724f3fbc65c7377db03038eb92bd882374daff44940138821"
[options.zlib]
type = "bool"
default = false
additive = true
doc = "Reading and writing gzip-compressed documents, with zlib."
[platforms]
supported = ["linux"]
build-on = ["linux/gcc", "linux/clang"]
[deps.zlib]
version = ">= 1.2"
default-recipe = "apotocki/zlib"
when = { option = "zlib" }
[toolchains]
cmake = { version = ">= 3.20", default-recipe = "apotocki/cmake" }
ninja = { version = ">= 1.10", default-recipe = "apotocki/ninja" }
[[product]]
name = "LibXml2"
libraries = ["xml2"]
link = { libraries = ["m", "pthread"] }