Otok public index

apotocki/libxml2

libxml2, the XML C parser and toolkit of GNOME.

Library
libxml2
Newest
2.15.4 (r1, android)
Targets
android, apple, linux, windows
License
MIT
Homepage
https://gitlab.gnome.org/GNOME/libxml2
Documentation
https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home
Keywords
xml, html, xpath, parser

Use it

In otok.toml:

[deps.libxml2]
recipe = "apotocki/libxml2"
version = "~> 2.15.4"

Versions

VersionTargetChannelPublishedStatus
2.15.4 (r1, android) android stable 2026-11-14
2.15.4 (r1, apple) apple stable 2026-11-14
2.15.4 (r1, linux) linux stable 2026-11-14
2.15.4 (r1, windows) windows stable 2026-11-14

2.15.4 (r1, android)

Platforms

android

Options

OptionTypeDefaultDescription
zlibadditive bool false Reading and writing gzip-compressed documents, with zlib.

Toolchains

Recipe files

build.lua 905 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: 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 = false, LIBXML2_WITH_ZLIB = options.zlib,
    }
    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 1219 bytes · raw
# The otok recipe of libxml2 (https://github.com/apotocki/otok): libxml2 for Android, 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 = ["android"]
build-on = ["*/ndk"]

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

[[product]]
name = "LibXml2"
libraries = ["xml2"]
link = { libraries = [{ library = "z", when = { option = "zlib" } }] }