diff options
Diffstat (limited to 'main/libxml2/APKBUILD')
-rw-r--r-- | main/libxml2/APKBUILD | 55 |
1 files changed, 42 insertions, 13 deletions
diff --git a/main/libxml2/APKBUILD b/main/libxml2/APKBUILD index 08367fd067..f2c59efe75 100644 --- a/main/libxml2/APKBUILD +++ b/main/libxml2/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Carlo Landmeter <clandmeter@gmail.com> pkgname=libxml2 pkgver=2.9.6 -pkgrel=0 +pkgrel=2 pkgdesc="XML parsing library, version 2" url="http://www.xmlsoft.org/" arch="all" @@ -10,10 +10,12 @@ license="MIT" depends= depends_dev="zlib-dev" checkdepends="perl tar" -makedepends="$depends_dev python2-dev" -subpackages="$pkgname-doc $pkgname-dev py-$pkgname:py $pkgname-utils" +makedepends="$depends_dev python2-dev python3-dev" +subpackages="$pkgname-dbg $pkgname-doc $pkgname-dev $pkgname-utils + py-$pkgname:_py py2-$pkgname:_py py3-$pkgname:_py" options="!strip" source="ftp://ftp.xmlsoft.org/${pkgname}/${pkgname}-${pkgver}.tar.gz + libxml2-2.9.4-remove-pyverify_fd.patch " builddir="$srcdir/$pkgname-$pkgver" @@ -25,8 +27,14 @@ builddir="$srcdir/$pkgname-$pkgver" # 2.9.4-r4: # - CVE-2017-5969 -build() { - cd "$builddir" +prepare() { + default_prepare + # setup.py is generated + rm python/setup.py + cp -ra "$builddir" "$builddir"-python2 +} + +libxml2_configure() { ./configure \ --build=$CBUILD \ --host=$CHOST \ @@ -34,19 +42,31 @@ build() { --sysconfdir=/etc \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ - --disable-static + --disable-static \ + "$@" +} + +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() { - make -C "$builddir" tests + rm "$builddir"-python2/test/ebcdic_566012.xml + make -C "$builddir"-python2 runtests } package() { cd "$builddir" make -j1 DESTDIR="$pkgdir" install - - install -Dm644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING + make -j1 -C "$builddir"-python2/python DESTDIR="$pkgdir" install } dev() { @@ -54,11 +74,19 @@ dev() { mv "$pkgdir"/usr/lib/*.sh "$subpkgdir"/usr/lib/ } -py() { +_py() { + local python cd "$builddir" - pkgdesc="$pkgname python bindings" + case $subpkgname in + py2-*) python=python2;; + py3-*) python=python3;; + py-*) mkdir -p "$subpkgdir"; return 0;; # dummy py- package + esac + + pkgdesc="$pkgname $python bindings" + install_if="py-libxml2=$pkgver-r$pkgrel $python" install -d "$subpkgdir"/usr/lib - mv "$pkgdir"/usr/lib/python* "$subpkgdir"/usr/lib/ + mv "$pkgdir"/usr/lib/$python* "$subpkgdir"/usr/lib/ } utils() { @@ -68,4 +96,5 @@ utils() { mv "$pkgdir"/usr/bin "$subpkgdir"/usr/ } -sha512sums="5ef80f895374bd5dd3bcd5f00c715795f026bf45d998f8f762c0cdb739b8755e01de40cf853d98a3826eacef95c4adebe4777db11020e8d98d0bda921f55a0ed libxml2-2.9.6.tar.gz" +sha512sums="5ef80f895374bd5dd3bcd5f00c715795f026bf45d998f8f762c0cdb739b8755e01de40cf853d98a3826eacef95c4adebe4777db11020e8d98d0bda921f55a0ed libxml2-2.9.6.tar.gz +271e701daf08f10a8b591c5128f596105901a29ecc9ee72f088afab266eaec7932a4a7d2194baa07c69e1aa93f3e9dc01a4a890456f53416c45d490598be41d9 libxml2-2.9.4-remove-pyverify_fd.patch" |