Initial commit

This commit is contained in:
2025-12-19 12:48:04 +02:00
commit 4234981482
5 changed files with 144 additions and 0 deletions
+2
View File
@@ -0,0 +1,2 @@
# Exclude bpm archives
*.bpm
+4
View File
@@ -0,0 +1,4 @@
#!/bin/sh
# Ignore this package
echo "ignore"
+20
View File
@@ -0,0 +1,20 @@
name: libxml2-legacy
description: XML C parser and toolkit (legacy version)
version: 2.13.9
revision: 1
url: https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home
license: MIT
architecture: any
type: source
depends:
- glibc
- icu
- xz-utils
- zlib
make_depends:
- meson
downloads:
- url: https://download.gnome.org/sources/libxml2/${BPM_PKG_VERSION%.*}/libxml2-${BPM_PKG_VERSION}.tar.xz
extract_to: ${BPM_SOURCE}
extract_strip_components: 1
checksum: a2c9ae7b770da34860050c309f903221c67830c86e4a7e760692b803df95143a
+79
View File
@@ -0,0 +1,79 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Jan Alexander Steffens (heftig)" <[email protected]>
Date: Tue, 18 Feb 2025 20:21:01 +0100
Subject: [PATCH] meson: Build fixes
---
meson.build | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/meson.build b/meson.build
index 60ab17d17452..7dc86286d297 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,
+39
View File
@@ -0,0 +1,39 @@
# This is the source.sh script. It is executed by BPM in a temporary directory when compiling a source package
# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE
# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT
# The prepare function is executed in the root of the temp directory
# This function is used for putting downloaded files to the correct location or applying patches
prepare() {
cd "$BPM_SOURCE"
patch -Np1 -i "$BPM_WORKDIR"/meson-build-fixes.patch
}
# The build function is executed in the source directory
# This function is used to compile the source code
build() {
meson setup build --prefix=/usr/lib/libxml2-legacy -Dhttp=true -Dlegacy=true -Dpython=false
meson compile -C build
}
# The check function is executed in the source directory
# This function is used to run tests to verify the package has been compiled correctly
check() {
meson test -C build --print-errorlogs
}
# The package function is executed in the source directory
# This function is used to move the compiled files into the output directory
package() {
meson install -C build --destdir="$BPM_OUTPUT"
# Move library out of libxml2-legacy directory
mv "$BPM_OUTPUT"/usr/lib/libxml2-legacy/lib/libxml2.so.* -t "$BPM_OUTPUT"/usr/lib
ln -sr "$BPM_OUTPUT"/usr/lib/libxml2.so.2 -t "$BPM_OUTPUT"/usr/lib/libxml2-legacy/lib
# Remove unnecessary files
rm -r "$BPM_OUTPUT"/usr/lib/libxml2-legacy/{bin,share}
# Install package license
install -Dm644 "$BPM_SOURCE"/Copyright "$BPM_OUTPUT"/usr/share/licenses/libxml2-legacy/Copyright
}