# Contributor: Carlo Landmeter # Maintainer: Carlo Landmeter pkgname=libxml2 pkgver=2.9.10 pkgrel=1 pkgdesc="XML parsing library, version 2" url="http://www.xmlsoft.org/" arch="all" license="MIT" depends_dev="zlib-dev xz-dev" checkdepends="perl tar" makedepends="$depends_dev python3-dev" subpackages="$pkgname-dbg $pkgname-doc $pkgname-dev $pkgname-utils py3-$pkgname:_py3" options="!strip" source="http://xmlsoft.org/sources/libxml2-$pkgver.tar.gz revert-Make-xmlFreeNodeList-non-recursive.patch " # secfixes: # 2.9.8-r1: # - CVE-2018-9251 # - CVE-2018-14404 # - CVE-2018-14567 # 2.9.4-r4: # - CVE-2017-5969 # 2.9.4-r2: # - CVE-2016-9318 # 2.9.4-r1: # - CVE-2016-5131 prepare() { default_prepare # setup.py is generated rm python/setup.py # We don't build libxml2 with icu. rm test/icu_parse_test.xml cp -ra "$builddir" "$builddir"-python2 } libxml2_configure() { ./configure \ --build=$CBUILD \ --host=$CHOST \ --prefix=/usr \ --sysconfdir=/etc \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --with-lzma \ --with-zlib \ "$@" } build() { cd "$builddir" libxml2_configure \ --with-python=/usr/bin/python3 make msg "build python2" cd "$builddir"-python2 libxml2_configure \ --with-python=/usr/bin/python2 make } check() { rm "$builddir"-python2/test/ebcdic_566012.xml make -C "$builddir"-python2 runtests } package() { cd "$builddir" make -j1 DESTDIR="$pkgdir" install make -j1 -C "$builddir"-python2/python DESTDIR="$pkgdir" install # We don't need static lib for python bindings. rm "$pkgdir"/usr/lib/python*/site-packages/*.a } dev() { default_dev mv "$pkgdir"/usr/lib/*.sh "$subpkgdir"/usr/lib/ } _py3() { pkgdesc="$pkgname python3 bindings" mkdir -p "$subpkgdir"/usr/lib mv "$pkgdir"/usr/lib/python3* "$subpkgdir"/usr/lib/ } utils() { pkgdesc="XML utilities" replaces="libxml2" mkdir -p "$subpkgdir"/usr mv "$pkgdir"/usr/bin "$subpkgdir"/usr/ } sha512sums="0adfd12bfde89cbd6296ba6e66b6bed4edb814a74b4265bda34d95c41d9d92c696ee7adb0c737aaf9cc6e10426a31a35079b2a23d26c074e299858da12c072ed libxml2-2.9.10.tar.gz 347178e432379d543683cba21b902e7305202c03e8dbd724ae395963d677096a5cfc4e345e208d498163ca5174683c167610fc2b297090476038bc2bb7c84b4f revert-Make-xmlFreeNodeList-non-recursive.patch"