Files
MSYS2-packages/libxml2/PKGBUILD
Christoph Reiter 7e4e1c531b libxml2: Update to 2.12.4
Also disable the legacy APIs, like we did for the mingw build recently
There shouldn't be any users left.
2024-01-17 06:48:24 +01:00

133 lines
4.0 KiB
Bash

# Maintainer: Alexey Pavlov <alexpux@gmail.com>
pkgbase=libxml2
pkgname=('libxml2' 'libxml2-devel' 'libxml2-python')
pkgver=2.12.4
pkgrel=1
pkgdesc="XML parsing library, version 2"
arch=(i686 x86_64)
license=('spdx:MIT')
makedepends=('gcc' 'python-devel' 'libreadline-devel'
'liblzma-devel' 'zlib-devel' 'autotools')
url="https://gitlab.gnome.org/GNOME/libxml2/-/wikis/"
source=("https://download.gnome.org/sources/libxml2/${pkgver%.*}/${pkgbase}-${pkgver}.tar.xz"
https://www.w3.org/XML/Test/xmlts20130923.tar.gz
libxml2-2.9.8-python3-unicode-errors.patch)
sha256sums=('497360e423cf0bd99eacdb7c6215dea92e6d6e89ee940393c2bae0e77cb9b7d0'
'9b61db9f5dbffa545f4b8d78422167083a8568c59bd1129f94138f936cf6fc1f'
'0f5d465503b24271e11752262af89c58eb0b26b4901c3b021bd843e6e5d4e95a')
# Helper macros to help make tasks easier #
apply_patch_with_msg() {
for _patch in "$@"
do
msg2 "Applying $_patch"
patch -Nbp1 -i "${srcdir}/$_patch"
done
}
del_file_exists() {
for _fname in "$@"
do
if [ -f $_fname ] || [ -d $_fname ]; then
rm -rf $_fname
fi
done
}
# =========================================== #
prepare() {
cd ${srcdir}
del_file_exists ${pkgbase}-${pkgver}/xmlconf
mv xmlconf -t ${pkgbase}-${pkgver}
cd ${pkgbase}-${pkgver}
# From https://src.fedoraproject.org/rpms/libxml2/tree/main
apply_patch_with_msg \
libxml2-2.9.8-python3-unicode-errors.patch
autoreconf -vfi
}
build() {
export lt_cv_deplibs_check_method='pass_all'
cd ${pkgbase}-${pkgver}
export MSYSTEM=CYGWIN
local CYGWIN_CHOST="${CHOST/-msys/-cygwin}"
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--build=${CYGWIN_CHOST} \
--host=${CYGWIN_CHOST} \
--target=${CYGWIN_CHOST} \
--enable-ipv6 \
--with-history \
--with-iconv \
--without-icu \
--enable-shared \
--enable-static \
--with-python=/usr/bin/python
make
make DESTDIR=${srcdir}/dest install
PYTHON_SITELIB="$(python -c 'import site, sys; sys.stdout.write(site.getsitepackages()[0])')"
mv ${srcdir}/dest${PYTHON_SITELIB}/${pkgbase/lib/msys-}mod.dll ${srcdir}/dest${PYTHON_SITELIB}/${pkgbase}mod.dll
sed -i -e "s:${pkgbase/lib/msys-}mod:${PN}mod:g" ${srcdir}/dest${PYTHON_SITELIB}/${pkgbase}mod.la
}
check() {
cd ${pkgbase}-${pkgver}
make check
}
package_libxml2() {
depends=('coreutils' 'liblzma' 'libreadline' 'zlib')
groups=('libraries')
install=libxml2.install
mkdir -p ${pkgdir}/usr
cp -rf ${srcdir}/dest/usr/bin ${pkgdir}/usr/
rm -f ${pkgdir}/usr/bin/*-config
mkdir -p ${pkgdir}/usr/share
cp -rf ${srcdir}/dest/usr/share/man ${pkgdir}/usr/share/
install -Dm644 ${srcdir}/${pkgbase}-${pkgver}/Copyright "${pkgdir}/usr/share/licenses/${pkgbase}/Copyright"
}
package_libxml2-devel() {
pkgdesc="Libxml2 headers and libraries"
groups=('development')
options=('staticlibs')
depends=("libxml2=${pkgver}" 'libreadline-devel' 'liblzma-devel' 'zlib-devel')
PYTHON_SITELIB="$(python -c 'import site, sys; sys.stdout.write(site.getsitepackages()[0])')"
mkdir -p ${pkgdir}/usr/{bin,share}
cp -f ${srcdir}/dest/usr/bin/*-config ${pkgdir}/usr/bin/
cp -rf ${srcdir}/dest/usr/include ${pkgdir}/usr/
cp -rf ${srcdir}/dest/usr/lib ${pkgdir}/usr/
rm -rf ${pkgdir}${PYTHON_SITELIB}
cp -rf ${srcdir}/dest/usr/share/aclocal ${pkgdir}/usr/share/
cp -rf ${srcdir}/dest/usr/share/doc ${pkgdir}/usr/share/
rm -rf ${pkgdir}/usr/share/doc/libxml2/python
cp -rf ${srcdir}/dest/usr/share/gtk-doc ${pkgdir}/usr/share/
}
package_libxml2-python(){
pkgdesc="Libxml2 python modules"
depends=('libxml2')
groups=('python-modules')
options=('staticlibs')
PYTHON_SITELIB="$(python -c 'import site, sys; sys.stdout.write(site.getsitepackages()[0])')"
mkdir -p ${pkgdir}/${PYTHON_SITELIB}
mkdir -p ${pkgdir}/usr/share/doc
cp -rf ${srcdir}/dest${PYTHON_SITELIB}/* ${pkgdir}${PYTHON_SITELIB}/
cp -rf ${srcdir}/dest/usr/share/doc/libxml2/python ${pkgdir}/usr/share/doc/python-libxml2
python -m compileall \
-o 0 -o 1 -q -s"${pkgdir}" -p"/" "${pkgdir}${PYTHON_SITELIB}/"
}