build.lua 1076 bytes · raw
-- libxml2's CMake project, the library only: no programs, tests, documentation, Python, ICU, readline, loadable modules or
-- network code. iconv is left out (the library converts UTF-8, UTF-16 and ISO 8859 itself). What it installs: libxml2s.lib (the name carries the configuration).
function build(slice, options, deps)
local static = true
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 = false, 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("lib/*xml2*.lib", p)[1] }, headers = p .. "/include/libxml2" }
end
recipe.toml 1383 bytes · raw
# The otok recipe of libxml2 (https://github.com/apotocki/otok): libxml2 for Windows, from the release archive, with libxml2's CMake, the
# library only (no xmllint, tests or Python); static (consumers are built with LIBXML_STATIC, which the product defines).
[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"]
[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 = ["windows"]
build-on = ["windows/msvc", "linux/clang-cl"]
[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"]
defines = ["LIBXML_STATIC"]
link = { libraries = ["ws2_32", "bcrypt"] }