# Maintainer: PktSurf <smlinux@pktsurf.in>
app=libxml2
version=2.9.12
build=3sml
homepage="http://www.xmlsoft.org/"
download="ftp://xmlsoft.org/libxml2/libxml2-$version.tar.gz"
desc="XML parser library"
requires="readline zlib xz python3"

prepbuilddir() {
  mkandenterbuilddir
  rm -rf $app-$version

  tar xf $srcdir/$app-$version.tar.?z*
  cd $app-$version
  fixbuilddirpermissions

  applypatch $srcdir/libxml2-2.9.8-python3-unicode-errors.patch
  applypatch $srcdir/revert-Make-xmlFreeNodeList-non-recursive.patch
  applypatch $srcdir/652dd12a858989b14eed4e84e453059cd3ba340e.diff
}

build() {
  ./configure \
    --prefix= \
    --enable-shared \
    --disable-static

  make
  make install DESTDIR=$pkg

  cp Copyright $pkgdocs/LICENSE

  mkfinalpkg
}

sha512sums="
7a2a9b03cc7a1f3ed3d64871818039bc3f658979c37d0e43685f400838c22c081c23a058b8599f1d27b4d3ea95cdbbb4f328fc541f27501cde5eacd2a9125546  libxml2-2.9.12.tar.lz
a205c97fa1488fb8907cfa08b5f82e2055c80b86213dc3cc5c4b526fe6aa786bcc4e4eeb226c44635a1d021307b39e3940f706c42fb60e9e3e9b490a84164df7  libxml2-2.9.8-python3-unicode-errors.patch
347178e432379d543683cba21b902e7305202c03e8dbd724ae395963d677096a5cfc4e345e208d498163ca5174683c167610fc2b297090476038bc2bb7c84b4f  revert-Make-xmlFreeNodeList-non-recursive.patch
3cee30d3c190879e31f4bf27699b5a9ed2a8615982375078702150dbdf9171bf0527b48a63beaa79de6afee5725076fb5214c27235737ab9b42d869d1c3c8b1c  652dd12a858989b14eed4e84e453059cd3ba340e.diff
"
