Skip to content
Snippets Groups Projects
Verified Commit 38ee0b5b authored by Jan Alexander Steffens (heftig)'s avatar Jan Alexander Steffens (heftig)
Browse files

2.13.7-1

parent 4f719e68
Branches main
Tags 2.13.7-1
No related merge requests found
pkgbase = libxml2
pkgdesc = XML C parser and toolkit
pkgver = 2.13.6
pkgrel = 3
pkgver = 2.13.7
pkgrel = 1
url = https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home
arch = x86_64
license = MIT
......@@ -14,14 +14,14 @@ pkgbase = libxml2
depends = readline
depends = xz
depends = zlib
source = git+https://gitlab.gnome.org/GNOME/libxml2.git#tag=v2.13.6
source = git+https://gitlab.gnome.org/GNOME/libxml2.git#tag=v2.13.7
source = https://www.w3.org/XML/Test/xmlts20130923.tar.gz
source = 0001-meson-Build-fixes.patch
source = xml2-config
b2sums = 84fd36291960d78ebef4c373c15c29bf4efd17fe59174cca70bad6fe8ac73dd333cdea6ed6f577db2107991fa6b6d6fb20f7551cb640cbbfe38ff696b9a0b9ba
source = 0001-meson-Install-a-xml2-config-script.patch
source = 0002-meson-Build-fixes.patch
b2sums = fc6186c28db0582fc52a0247e2a333c7030a62005efa6b98eb982acd78a28fc8bf2a542b340f86549cb6ac724d2f9fc94d4d8fdce374847fef61dcadd80132a2
b2sums = 63a47bc69278ef510cd0b3779aed729e1b309e30efa0015d28ed051cc03f9dfddb447ab57b07b3393e8f47393d15473b0e199c34cb1f5f746b15ddfaa55670be
b2sums = 15438434f5f2fa450c3ff92b552bc3029cb1dc42e7a3d607af5690ded6e10bd0119275d447018e9083d3bf9d07c96c6c3d6b01bf69d2b6d4e5c385bbb3c74416
b2sums = c85651b242884d37d8f23292f3d3f475005f819975a30ab2233f3e2d0adae6ba46eab85d52e46d94940b0f01e8a411460153e8ceeb1e7449cb30c629022b5da4
b2sums = 9c9925ea96fc993b6e5dffb68629f0864d6d3445605c0de92bf07156c81f88fbe4efb46f5784ce8dc5c87d8ccd4f8689dce09a91925f53b840887a514a6b2b8d
b2sums = a42e284cd50e87a6eb4bd66bc02f968fc9f79922e000295d9778c5f2974985251509d58214203e9f542bad365e85136f7f07672bd4b6e338e89b0bd9b14190f1
pkgname = libxml2
optdepends = python: Python bindings
......
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Jan Alexander Steffens (heftig)" <heftig@archlinux.org>
Date: Tue, 18 Feb 2025 20:21:01 +0100
Subject: [PATCH] meson: Build fixes
---
CMakeLists.txt | 3 ---
meson.build | 28 +++++++++++++++++++++-----
python/Makefile.am | 2 +-
python/generator.py | 15 +++++++++-----
python/meson.build | 49 +++++++++++++++++++++++++++++++++++++++------
5 files changed, 77 insertions(+), 20 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2af1e6f6d8c5..7a4ee1c8e220 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -543,9 +543,6 @@ if(LIBXML2_WITH_PYTHON)
COMMAND
${Python_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/python/generator.py
- ${CMAKE_CURRENT_SOURCE_DIR}/doc/libxml2-api.xml
- ${CMAKE_CURRENT_SOURCE_DIR}/python/libxml2-python-api.xml
- WORKING_DIRECTORY
${CMAKE_CURRENT_BINARY_DIR}
)
file(READ python/libxml.py LIBXML_PY)
diff --git a/meson.build b/meson.build
index f425f3270145..861c174bc0b0 100644
--- a/meson.build
+++ b/meson.build
@@ -25,7 +25,7 @@ dir_include = dir_prefix / get_option('includedir')
dir_pkginclude = dir_include / meson.project_name()
dir_lib = dir_prefix / get_option('libdir')
dir_data = dir_prefix / get_option('datadir')
-dir_doc = dir_data / 'doc' / 'libxml2'
+dir_doc = dir_data / 'doc' / meson.project_name()
dir_locale = dir_prefix / get_option('localedir')
# host
@@ -316,6 +316,7 @@ xml_check_functions = [
['stat', 'sys/stat.h'],
['mmap', 'sys/mman.h'],
['munmap', 'sys/mman.h'],
+ ['getentropy', 'sys/random.h'],
]
foreach function : xml_check_functions
@@ -430,7 +431,7 @@ if not get_option('minimum')
endif
endif
-want_thread_alloc = threads_dep.found()
+want_thread_alloc = want_thread_alloc and threads_dep.found()
### xmllint shell history
xmllint_deps = []
@@ -560,7 +561,11 @@ int main()
return 0;
}
'''
- res = cc.compiles(ipv6_src, name: 'support for IPV6')
+ res = cc.compiles(
+ ipv6_src,
+ name: 'support for IPV6',
+ args: config_h.has('HAVE_NETDB_H') ? ['-DHAVE_NETDB_H=1'] : [],
+ )
if res == true
config_h.set10('SUPPORT_IP6', true)
endif
@@ -598,11 +603,12 @@ else
endif
# icu
-icu_dep = dependency('icu-i18n', method: 'pkg-config', required: get_option('icu'))
+icu_dep = dependency('icu-i18n', required: get_option('icu'))
if icu_dep.found()
def_var = icu_dep.get_variable(pkgconfig: 'DEFS')
config_dir += include_directories(def_var)
xml_deps += icu_dep
+ xml_deps += dependency('icu-uc', required: true)
endif
subdir('include/libxml')
@@ -673,10 +679,21 @@ foreach file : xml_opt_src
endif
endforeach
+xml_lib_link_args = []
+
+if want_legacy and not sys_windows
+ symfile = files('libxml2.syms')[0]
+ xml_lib_link_args += cc.get_supported_link_arguments([
+ '-Wl,--undefined-version',
+ '-Wl,--version-script=@0@'.format(symfile.full_path()),
+ ])
+endif
+
xml_lib = library(
'xml2',
files(xml_src),
c_args: libxml2_cflags,
+ link_args: xml_lib_link_args,
dependencies: xml_deps,
include_directories: config_dir,
install: true,
@@ -763,28 +780,29 @@ pkgmod.generate(
description: 'libXML library version2.',
filebase: 'libxml-2.0',
name: 'libXML',
+ subdirs: meson.project_name(),
variables: 'modules=' + dl_dep.found().to_string('1', '0'),
)
## libxml2-config.cmake file
config_cmake = configuration_data()
config_cmake.set('LIBXML_MAJOR_VERSION', v_maj)
config_cmake.set('LIBXML_MINOR_VERSION', v_min)
config_cmake.set('LIBXML_MICRO_VERSION', v_mic)
config_cmake.set('VERSION', meson.project_version())
config_cmake.set('WITH_ICONV', iconv_dep.found().to_int().to_string())
config_cmake.set('WITH_ICU', icu_dep.found().to_int().to_string())
config_cmake.set('WITH_LZMA', lzma_dep.found().to_int().to_string())
config_cmake.set('WITH_MODULES', dl_dep.found().to_int().to_string())
config_cmake.set('WITH_THREADS', threads_dep.found().to_int().to_string())
config_cmake.set('WITH_ZLIB', zlib_dep.found().to_int().to_string())
config_cmake.set('XML_CFLAGS', xml_cflags)
configure_file(
input: 'libxml2-config.cmake.in',
output: 'libxml2-config.cmake',
configuration: config_cmake,
- install_dir: dir_lib / 'cmake' / 'libxml2',
+ install_dir: dir_lib / 'cmake' / meson.project_name(),
)
install_data(files('libxml.m4'), install_dir: dir_data / 'aclocal')
diff --git a/python/Makefile.am b/python/Makefile.am
index c9f3efade5ba..76018a9ec52e 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -38,7 +38,7 @@ CLEANFILES = libxml2.py $(GENERATED)
all-local: libxml2.py
$(GENERATED): $(srcdir)/generator.py $(API_DESC)
- $(PYTHON) $(srcdir)/generator.py $(srcdir)
+ $(PYTHON) $(srcdir)/generator.py $(builddir)
# libxml.c #includes libxml2-export.c
libxml.$(OBJEXT): libxml2-export.c
diff --git a/python/generator.py b/python/generator.py
index 149e0dfeb162..48dd5a32b6b1 100755
--- a/python/generator.py
+++ b/python/generator.py
@@ -13,9 +13,14 @@ import string
if __name__ == "__main__":
# launched as a script
srcPref = os.path.dirname(sys.argv[0])
+ try:
+ dstPref = sys.argv[1]
+ except IndexError:
+ dstPref = os.getcwd()
else:
# imported
srcPref = os.path.dirname(__file__)
+ dstPref = os.getcwd()
#######################################################################
#
@@ -695,11 +700,11 @@ def buildStubs():
failed = 0
skipped = 0
- include = open("libxml2-py.h", "w")
+ include = open(os.path.join(dstPref, "libxml2-py.h"), "w")
include.write("/* Generated */\n\n")
- export = open("libxml2-export.c", "w")
+ export = open(os.path.join(dstPref, "libxml2-export.c"), "w")
export.write("/* Generated */\n\n")
- wrapper = open("libxml2-py.c", "w")
+ wrapper = open(os.path.join(dstPref, "libxml2-py.c"), "w")
wrapper.write("/* Generated */\n\n")
wrapper.write("#define PY_SSIZE_T_CLEAN\n")
wrapper.write("#include <Python.h>\n")
@@ -1081,8 +1086,8 @@ def buildWrappers():
info = (0, func, name, ret, args, file)
function_classes['None'].append(info)
- classes = open("libxml2class.py", "w")
- txt = open("libxml2class.txt", "w")
+ classes = open(os.path.join(dstPref, "libxml2class.py"), "w")
+ txt = open(os.path.join(dstPref, "libxml2class.txt"), "w")
txt.write(" Generated Classes for libxml2-python\n\n")
txt.write("#\n# Global functions of the module\n#\n\n")
diff --git a/python/meson.build b/python/meson.build
index 633dc9227b45..f2377d11fbf8 100644
--- a/python/meson.build
+++ b/python/meson.build
@@ -3,20 +3,57 @@ pymod = import('python')
py = pymod.find_installation('python3', required: false)
if py.found() == true
- r = run_command(py, 'generator.py', meson.current_source_dir(), check: true)
+ message('Installing python modules to', py.get_install_dir())
- libxml2mod_src = ['libxml.c', 'libxml2-py.c', 'types.c']
+ pygenerated = custom_target(
+ 'Python generated files',
+ input: files('generator.py'),
+ depend_files: files(
+ '..' / 'doc' / 'libxml2-api.xml',
+ 'libxml2-python-api.xml',
+ ),
+ output: [
+ 'libxml2-py.h',
+ 'libxml2-export.c',
+ 'libxml2-py.c',
+ 'libxml2class.py',
+ 'libxml2class.txt',
+ ],
+ command: [py, '@INPUT@', meson.current_build_dir()],
+ )
+ pygenerated_dep = declare_dependency(
+ sources : [pygenerated[0]],
+ )
- message(py.get_install_dir())
+ libxml2_py = custom_target(
+ 'libxml2.py',
+ input: [files('libxml.py'), pygenerated[3]],
+ output: 'libxml2.py',
+ command: [find_program('cat'), '@INPUT@'],
+ capture: true,
+ install: true,
+ install_dir: py.get_install_dir(),
+ )
+
+ libxml2mod_src = [
+ files('libxml.c', 'types.c'),
+ pygenerated[2],
+ ]
py.extension_module(
'libxml2mod',
- files(libxml2mod_src),
- dependencies: [py.dependency(), xml_dep],
- include_directories: [config_dir],
+ libxml2mod_src,
+ dependencies: [
+ py.dependency(),
+ xml_dep,
+ pygenerated_dep,
+ ],
+ include_directories: [config_dir, '.'],
install: true,
)
+ py.install_sources(files('drv_libxml2.py'))
+
setup_py = configuration_data()
setup_py.set('prefix', get_option('prefix'))
setup_py.set('LIBXML_VERSION', meson.project_version())
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Jan Alexander Steffens (heftig)" <heftig@archlinux.org>
Date: Thu, 13 Mar 2025 18:32:18 +0100
Subject: [PATCH] meson: Install a xml2-config script
This one does not need build-time configuration but forwards to
`pkg-config` instead. It is mostly (and hopefully sufficiently)
compatible with the script installed by autotools.
---
meson.build | 11 +++++++++-
xml2-config-meson | 56 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 66 insertions(+), 1 deletion(-)
create mode 100755 xml2-config-meson
diff --git a/meson.build b/meson.build
index ee373feb638d..448c329bb664 100644
--- a/meson.build
+++ b/meson.build
@@ -271,7 +271,7 @@ endforeach
# [X] libxml-2.0.pc.in
# [X] libxml2-config.cmake.in
# [X] python/setup.py.in
-# [N] xml2-config.in
+# [X] xml2-config.in
## config.h
config_h = configuration_data()
@@ -789,6 +789,15 @@ configure_file(
install_data(files('libxml.m4'), install_dir: dir_data / 'aclocal')
+## xml2-config script
+
+install_data(
+ 'xml2-config-meson',
+ install_dir: dir_bin,
+ install_mode: 'rwxr-xr-x',
+ rename: 'xml2-config',
+)
+
if support_tls == false
message('===============================================================')
message('WARNING: Your C compiler appears to not support thread-local')
diff --git a/xml2-config-meson b/xml2-config-meson
new file mode 100755
index 000000000000..0403b966a4b9
--- /dev/null
+++ b/xml2-config-meson
@@ -0,0 +1,56 @@
+#!/bin/sh
+
+usage() {
+ cat <<EOF
+${2:+$2
+
+}Usage: xml2-config <OPTION...>
+
+Options:
+ --prefix print libxml prefix
+ --prefix=DIR change libxml prefix
+ --libs print library linking information
+ --dynamic skip libraries only necessary for static linking
+ --cflags print pre-processor and compiler flags
+ --modules module support enabled
+ --help display this help and exit
+ --version output version information
+EOF
+ exit "$1"
+}
+
+if [ "$#" -lt 1 ]; then
+ usage 1 "Need at least one option."
+fi
+
+prefix=0
+set_prefix=
+libs=0
+libflag=--static
+cflags=0
+modules=0
+version=0
+
+for arg in "$@"; do
+ case $arg in
+ --prefix) prefix=1 ;;
+ --prefix=*) set_prefix="${arg#*=}" ;;
+ --libs) libs=1 ;;
+ --dynamic) libflag=--shared ;;
+ --cflags) cflags=1 ;;
+ --modules) modules=1 ;;
+ --help) usage 0 ;;
+ --version) version=1 ;;
+ *) usage 1 "Unknown option: $arg" ;;
+ esac
+done
+
+set --
+[ "$prefix" -eq 1 ] && set -- "$@" --variable=prefix
+[ -n "$set_prefix" ] && set -- "$@" --define-variable=prefix="$set_prefix"
+[ "$libs" -eq 1 ] && set -- "$@" --libs "$libflag"
+[ "$cflags" -eq 1 ] && set -- "$@" --cflags
+[ "$modules" -eq 1 ] && set -- "$@" --variable=modules
+[ "$version" -eq 1 ] && set -- "$@" --modversion
+
+exec ${PKG_CONFIG:-pkg-config} "$@" libxml-2.0
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Jan Alexander Steffens (heftig)" <heftig@archlinux.org>
Date: Tue, 18 Feb 2025 20:21:01 +0100
Subject: [PATCH] meson: Build fixes
---
meson.build | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
diff --git a/meson.build b/meson.build
index 448c329bb664..70556b7c7004 100644
--- a/meson.build
+++ b/meson.build
@@ -316,6 +316,7 @@ xml_check_functions = [
['stat', 'sys/stat.h'],
['mmap', 'sys/mman.h'],
['munmap', 'sys/mman.h'],
+ ['getentropy', 'sys/random.h'],
]
foreach function : xml_check_functions
@@ -430,7 +431,7 @@ if not get_option('minimum')
endif
endif
-want_thread_alloc = threads_dep.found()
+want_thread_alloc = want_thread_alloc and threads_dep.found()
### xmllint shell history
xmllint_deps = []
@@ -560,7 +561,11 @@ int main()
return 0;
}
'''
- res = cc.compiles(ipv6_src, name: 'support for IPV6')
+ res = cc.compiles(
+ ipv6_src,
+ name: 'support for IPV6',
+ args: config_h.has('HAVE_NETDB_H') ? ['-DHAVE_NETDB_H=1'] : [],
+ )
if res == true
config_h.set10('SUPPORT_IP6', true)
endif
@@ -598,11 +603,12 @@ else
endif
# icu
-icu_dep = dependency('icu-i18n', method: 'pkg-config', required: get_option('icu'))
+icu_dep = dependency('icu-i18n', required: get_option('icu'))
if icu_dep.found()
def_var = icu_dep.get_variable(pkgconfig: 'DEFS')
config_dir += include_directories(def_var)
xml_deps += icu_dep
+ xml_deps += dependency('icu-uc', required: true)
endif
subdir('include/libxml')
@@ -673,10 +679,21 @@ foreach file : xml_opt_src
endif
endforeach
+xml_lib_link_args = []
+
+if want_legacy and not sys_windows
+ symfile = files('libxml2.syms')[0]
+ xml_lib_link_args += cc.get_supported_link_arguments([
+ '-Wl,--undefined-version',
+ '-Wl,--version-script=@0@'.format(symfile.full_path()),
+ ])
+endif
+
xml_lib = library(
'xml2',
files(xml_src),
c_args: libxml2_cflags,
+ link_args: xml_lib_link_args,
dependencies: xml_deps,
include_directories: config_dir,
install: true,
@@ -763,6 +780,7 @@ pkgmod.generate(
description: 'libXML library version2.',
filebase: 'libxml-2.0',
name: 'libXML',
+ subdirs: meson.project_name(),
variables: 'modules=' + dl_dep.found().to_string('1', '0'),
)
......@@ -9,8 +9,8 @@ pkgname=(
libxml2
libxml2-docs
)
pkgver=2.13.6
pkgrel=3
pkgver=2.13.7
pkgrel=1
pkgdesc="XML C parser and toolkit"
url="https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home"
arch=(x86_64)
......@@ -31,13 +31,13 @@ makedepends=(
source=(
"git+https://gitlab.gnome.org/GNOME/libxml2.git#tag=v$pkgver"
https://www.w3.org/XML/Test/xmlts20130923.tar.gz
0001-meson-Build-fixes.patch
xml2-config
0001-meson-Install-a-xml2-config-script.patch
0002-meson-Build-fixes.patch
)
b2sums=('84fd36291960d78ebef4c373c15c29bf4efd17fe59174cca70bad6fe8ac73dd333cdea6ed6f577db2107991fa6b6d6fb20f7551cb640cbbfe38ff696b9a0b9ba'
b2sums=('fc6186c28db0582fc52a0247e2a333c7030a62005efa6b98eb982acd78a28fc8bf2a542b340f86549cb6ac724d2f9fc94d4d8fdce374847fef61dcadd80132a2'
'63a47bc69278ef510cd0b3779aed729e1b309e30efa0015d28ed051cc03f9dfddb447ab57b07b3393e8f47393d15473b0e199c34cb1f5f746b15ddfaa55670be'
'15438434f5f2fa450c3ff92b552bc3029cb1dc42e7a3d607af5690ded6e10bd0119275d447018e9083d3bf9d07c96c6c3d6b01bf69d2b6d4e5c385bbb3c74416'
'c85651b242884d37d8f23292f3d3f475005f819975a30ab2233f3e2d0adae6ba46eab85d52e46d94940b0f01e8a411460153e8ceeb1e7449cb30c629022b5da4')
'9c9925ea96fc993b6e5dffb68629f0864d6d3445605c0de92bf07156c81f88fbe4efb46f5784ce8dc5c87d8ccd4f8689dce09a91925f53b840887a514a6b2b8d'
'a42e284cd50e87a6eb4bd66bc02f968fc9f79922e000295d9778c5f2974985251509d58214203e9f542bad365e85136f7f07672bd4b6e338e89b0bd9b14190f1')
prepare() {
cd libxml2
......@@ -46,7 +46,10 @@ prepare() {
ln -s ../xmlconf
# Meson fixes
git apply -3 ../0001-meson-Build-fixes.patch
git cherry-pick -n c2e2d76211e27df3c882616a14b4da24df7d3cb3
git cherry-pick -n 064a02114a0e35ac9d87dd1a0952e6c474273a68
git apply -3 ../0001-meson-Install-a-xml2-config-script.patch
git apply -3 ../0002-meson-Build-fixes.patch
}
build() {
......@@ -70,7 +73,6 @@ package_libxml2() {
provides=(libxml2.so)
meson install -C build --destdir "$pkgdir"
install -D xml2-config -t "$pkgdir/usr/bin"
# Split docs
mkdir -p doc/usr/share
......
#!/bin/bash
usage() {
cat <<EOF
${2:+$2
}Usage: xml2-config <OPTION...>
Options:
--prefix print libxml prefix
--prefix=DIR change libxml prefix
--libs print library linking information
--dynamic skip libraries only necessary for static linking
--cflags print pre-processor and compiler flags
--modules module support enabled
--help display this help and exit
--version output version information
EOF
exit $1
}
if (( $# < 1 )); then
usage 1 "Need at least one option."
fi
pc_args=()
libs=0
libflag=--static
for arg; do
case $arg in
--prefix) pc_args+=(--variable=prefix) ;;
--prefix=*) pc_args+=(--define-variable=prefix="${arg#*=}") ;;
--libs) libs=1 ;;
--dynamic) libflag=--shared ;;
--cflags) pc_args+=(--cflags) ;;
--modules) pc_args+=(--variable=modules) ;;
--help) usage 0 ;;
--version) pc_args+=(--modversion) ;;
*) usage 1 "Unknown option: ${arg@Q}" ;;
esac
done
if (( libs )); then
pc_args+=(--libs $libflag)
fi
exec ${PKG_CONFIG:-pkg-config} "${pc_args[@]}" libxml-2.0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment