summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkj-sh6042024-07-12 21:42:00 -0400
committerkj-sh6042024-07-12 21:42:00 -0400
commit98d9c7915e8ed2373343749fa057704ad050081b (patch)
treedb57502a21df09d92cb5e3a8e08dd2c306e0fa5d
parent6531664243d94b171d1c2a38788e1d9933760450 (diff)
kj-gitbot: python2-libxml2/
-rw-r--r--python2-libxml2/.SRCINFO28
-rw-r--r--python2-libxml2/.gitignore5
-rw-r--r--python2-libxml2/PKGBUILD140
-rw-r--r--python2-libxml2/no-fuzz.diff24
4 files changed, 197 insertions, 0 deletions
diff --git a/python2-libxml2/.SRCINFO b/python2-libxml2/.SRCINFO
new file mode 100644
index 0000000..bdf9a12
--- /dev/null
+++ b/python2-libxml2/.SRCINFO
@@ -0,0 +1,28 @@
+pkgbase = python2-libxml2
+ pkgdesc = XML parsing library, version 2
+ pkgver = 2.9.14
+ pkgrel = 2
+ url = https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home
+ arch = x86_64
+ arch = aarch64
+ arch = i686
+ arch = pentium4
+ arch = armv7h
+ arch = armv6l
+ license = MIT
+ makedepends = git
+ depends = icu
+ depends = ncurses
+ depends = python2
+ depends = libxml2
+ depends = readline
+ depends = xz
+ depends = zlib
+ source = python2-libxml2::git+https://gitlab.gnome.org/GNOME/libxml2.git#commit=7846b0a677f8d3ce72486125fa281e92ac9970e8
+ source = no-fuzz.diff
+ source = https://www.w3.org/XML/Test/xmlts20130923.tar.gz
+ sha256sums = SKIP
+ sha256sums = 3fc010d8c42b93e6d6f1fca6b598a561e9d2c8780ff3ca0c76a31efabaea404f
+ sha256sums = 9b61db9f5dbffa545f4b8d78422167083a8568c59bd1129f94138f936cf6fc1f
+
+pkgname = python2-libxml2
diff --git a/python2-libxml2/.gitignore b/python2-libxml2/.gitignore
new file mode 100644
index 0000000..48f9191
--- /dev/null
+++ b/python2-libxml2/.gitignore
@@ -0,0 +1,5 @@
+pkg/
+src/
+*.tar.*
+*.pkg.*
+python2*/
diff --git a/python2-libxml2/PKGBUILD b/python2-libxml2/PKGBUILD
new file mode 100644
index 0000000..ada77d2
--- /dev/null
+++ b/python2-libxml2/PKGBUILD
@@ -0,0 +1,140 @@
+# Maintainer: Pellegrino Prevete <pellegrinoprevete@gmail.com>
+# Contributor: Levente Polyak <anthraxx[at]archlinux[dot]org>
+# Contributor: Jan de Groot <jgc@archlinux.org>
+# Contributor: Tom Gundersen <teg@jklm.no>
+# Contributor: John Proctor <jproctor@prium.net>
+# Contributor: MarsSeed <marcell.meszaros@runbox.eu>
+
+_py="python2"
+_pkg="libxml2"
+pkgname="${_py}-${_pkg}"
+pkgver=2.9.14
+_pkgver=2.9.10
+pkgrel=2
+pkgdesc='XML parsing library, version 2'
+_url="https://gitlab.gnome.org/GNOME/${_pkg}"
+url="${_url}/-/wikis/home"
+arch=(
+ x86_64
+ aarch64
+ i686
+ pentium4
+ armv7h
+ armv6l
+)
+license=(MIT)
+depends=(
+ icu
+ ncurses
+ "${_py}"
+ "${_pkg}"
+ readline
+ xz
+ zlib
+)
+makedepends=(
+ git
+)
+_commit=7846b0a677f8d3ce72486125fa281e92ac9970e8 # tags/v2.9.14^0
+_w3_tests="https://www.w3.org/XML/Test/xmlts20130923.tar.gz"
+source=(
+ "${pkgname}::git+${_url}.git#commit=$_commit"
+ no-fuzz.diff # Do not run fuzzing tests
+ "${_w3_tests}"
+)
+sha256sums=(
+ 'SKIP'
+ '3fc010d8c42b93e6d6f1fca6b598a561e9d2c8780ff3ca0c76a31efabaea404f'
+ '9b61db9f5dbffa545f4b8d78422167083a8568c59bd1129f94138f936cf6fc1f'
+)
+
+pkgver() {
+ cd "${pkgname}"
+ git describe --tags \
+ | sed 's/-rc/rc/;s/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
+}
+
+prepare() {
+ local _msg="Use xmlconf from conformance test suite"
+ mkdir -p build
+ ln -s xmlconf build/xmlconf || echo "${_msg}"
+
+ cd "${pkgname}"
+
+ # Take patches from https://src.fedoraproject.org/rpms/libxml2/tree/master
+ local src
+ for src in "${source[@]}"; do
+ src="${src%%::*}"
+ src="${src##*/}"
+ [[ "${src}" = *.diff ]] || continue
+ echo "Applying patch ${src}..."
+ git apply -3 "../${src}"
+ done
+
+ autoreconf -fiv
+}
+
+build() (
+ local _configure="../${pkgname}/configure"
+ local _configure_opts=(
+ --prefix=/usr
+ --with-threads
+ --with-history
+ --with-python="/usr/bin/${_py}"
+ --with-icu
+ )
+ local _cflags=(
+ "-I/usr/include/${_pkg}-2.9"
+ )
+ local _ldflags=(
+ "-L/usr/lib/${_pkg}-2.9"
+ )
+
+ cd build
+
+ CFLAGS="${_cflags[*]}" \
+ LDFLAGS="${_ldflags[*]}" \
+ "../${pkgname}/configure" "${_configure_opts[@]}"
+
+ sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0 /g' libtool
+
+ CFLAGS="${_cflags[*]}" \
+ LDFLAGS="${_ldflags[*]}" \
+ make
+
+ find doc -type f -exec chmod 0644 {} +
+)
+
+check() {
+ CFLAGS="${_cflags[*]}" \
+ LDFLAGS="${_ldflags[*]}" \
+ make -C build check
+}
+
+package() {
+ make DESTDIR="${pkgdir}" -C build install
+ "${_py}" -m compileall \
+ -d /usr/lib "${pkgdir}/usr/lib"
+ "${_py}" -O \
+ -m compileall \
+ -d /usr/lib "${pkgdir}/usr/lib"
+
+ install -Dm 644 build/COPYING \
+ -t "${pkgdir}/usr/share/licenses/${pkgname}"
+
+ rm -rf "${pkgdir}/usr/bin/"
+ rm -rf "${pkgdir}/usr/bin/"
+ rm -rf "${pkgdir}/usr/include/${_pkg}/libxml"
+ rm -rf "${pkgdir}/usr/lib/cmake"
+ rm -rf "${pkgdir}/usr/lib/${_pkg}"*
+ rm -rf "${pkgdir}/usr/lib/pkgconfig"
+ rm -rf "${pkgdir}/usr/lib/xml2Conf.sh"
+ rm -rf "${pkgdir}/usr/share/aclocal"
+ rm -rf "${pkgdir}/usr/share/doc/${_pkg}"
+ rm -rf "${pkgdir}/usr/share/doc/${_pkg}-python-${pkgver}"
+ rm -rf "${pkgdir}/usr/share/gtk-doc/html/${_pkg}"
+ rm -rf "${pkgdir}/usr/share/man/man1"
+ rm -rf "${pkgdir}/usr/share/man/man3"
+}
+
+# vim: ts=2 sw=2 et:
diff --git a/python2-libxml2/no-fuzz.diff b/python2-libxml2/no-fuzz.diff
new file mode 100644
index 0000000..67ab6cc
--- /dev/null
+++ b/python2-libxml2/no-fuzz.diff
@@ -0,0 +1,24 @@
+diff --git i/Makefile.am w/Makefile.am
+index 7917b595..f0f4b695 100644
+--- i/Makefile.am
++++ w/Makefile.am
+@@ -2,9 +2,9 @@
+
+ ACLOCAL_AMFLAGS = -I m4
+
+-SUBDIRS = include . doc example fuzz xstc $(PYTHON_SUBDIR)
++SUBDIRS = include . doc example xstc $(PYTHON_SUBDIR)
+
+-DIST_SUBDIRS = include . doc example fuzz python xstc
++DIST_SUBDIRS = include . doc example python xstc
+
+ AM_CPPFLAGS = -I$(top_builddir)/include -I$(srcdir)/include
+
+@@ -210,7 +210,6 @@ runtests: runtest$(EXEEXT) testrecurse$(EXEEXT) testapi$(EXEEXT) \
+ $(CHECKER) ./runxmlconf$(EXEEXT)
+ @(if [ "$(PYTHON_SUBDIR)" != "" ] ; then cd python ; \
+ $(MAKE) tests ; fi)
+- @cd fuzz; $(MAKE) tests
+
+ check: all runtests
+