1 # Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
2 # Maintainer: Jan de Groot <jgc@archlinux.org>
3 # Contributor: Tom Gundersen <teg@jklm.no>
4 # Contributor: John Proctor <jproctor@prium.net>
9 pkgdesc='XML parsing library, version 2'
10 url='http://www.xmlsoft.org/'
13 depends=(zlib readline ncurses xz icu)
14 makedepends=(python2 python git)
15 _commit=b48e77cf4f6fa0792c5f4b639707a2b0675e461b # tags/v2.9.12^0
16 source=("git+https://gitlab.gnome.org/GNOME/libxml2.git#commit=$_commit"
17 libxml2-2.9.8-python3-unicode-errors.patch
18 https://www.w3.org/XML/Test/xmlts20130923.tar.gz)
20 '37eb81a8ec6929eed1514e891bff2dd05b450bcf0c712153880c485b7366c17c'
21 '9b61db9f5dbffa545f4b8d78422167083a8568c59bd1129f94138f936cf6fc1f')
25 git describe --tags | sed 's/-rc/rc/;s/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
32 # Work around lxml API abuse
33 git cherry-pick -n 85b1792e37b131e7a51af98a37f92472e8de5f3f
34 # Fix regression in xmlNodeDumpOutputInternal
35 git cherry-pick -n 13ad8736d294536da4cbcd70a96b0a2fbf47070c
36 # Fix XPath recursion limit
37 git cherry-pick -n 3e1aad4fe584747fd7d17cc7b2863a78e2d21a77
38 # Fix whitespace when serializing empty HTML documents
39 git cherry-pick -n 92d9ab4c28842a09ca2b76d3ff2f933e01b6cd6f
41 # Take patches from https://src.fedoraproject.org/rpms/libxml2/tree/master
43 for src in "${source[@]}"; do
46 [[ $src = *.patch ]] || continue
47 echo "Applying patch $src..."
48 patch -Np1 < "../$src"
51 sed -e '/cd fuzz; /d' -e 's/fuzz //g' -i Makefile.am
57 ../$pkgname/configure \
61 --with-python=/usr/bin/python$1 \
63 sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0 /g' libtool
65 find doc -type f -exec chmod 0644 {} +
80 make -C build-py2 DESTDIR="$pkgdir" install
81 make -C build-py3/python DESTDIR="$pkgdir" install
82 install -Dm 644 build-py2/COPYING -t "$pkgdir/usr/share/licenses/$pkgname"
84 #Disabled for now, as I don't want to introduce file conflicts during a security update
85 #python2 -m compileall -d /usr/lib/python2.7 "$pkgdir/usr/lib/python2.7"
86 #python2 -O -m compileall -d /usr/lib/python2.7 "$pkgdir/usr/lib/python2.7"
87 #python -m compileall -d /usr/lib/python3.10 "$pkgdir/usr/lib/python3.10"
88 #python -O -m compileall -d /usr/lib/python3.10 "$pkgdir/usr/lib/python3.10"