# Depends on: python2 python

description="Libraries and utilities used for parsing XML files."
url="http://xmlsoft.org/"
packager="tnut <tnut@nutyx.org>"
contributors="Pierre B, Fanch"

name=libxml2
version=2.9.8
release=4

source=(ftp://xmlsoft.org/libxml2/$name-$version.tar.gz  http://www.linuxfromscratch.org/patches/blfs/svn/libxml2-2.9.8-python3_hack-1.patch)

build() {
cd $name-$version
patch -Np1 -i ../libxml2-2.9.8-python3_hack-1.patch
sed -i '/_PyVerify_fd/,+1d' python/types.c
./configure --prefix=/usr    \
            --disable-static \
            --with-history   \
            --with-python=/usr/bin/python3
make
make DESTDIR=$PKG install
rm $PKG/usr/lib/$name.la
rm $PKG/usr/lib/python3.7/site-packages/libxml2mod.la
}
