Christoph Reiter 2d1af2debd libxml2 rebuilds
for 873e523d1b404ec899ea9f0e1
2025-09-30 09:21:12 +02:00

108 lines
3.3 KiB
Bash

# Maintainer: Alexey Pavlov <alexpux@gmail.com>
_realname=libxslt
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.1.43
pkgrel=4
pkgdesc="XML stylesheet transformation library (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="https://gitlab.gnome.org/GNOME/libxslt/-/wikis/home"
msys2_references=(
"cpe: cpe:/a:xmlsoft:libxslt"
)
license=('custom')
depends=("${MINGW_PACKAGE_PREFIX}-cc-libs"
"${MINGW_PACKAGE_PREFIX}-libxml2")
makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-autotools")
source=("https://download.gnome.org/sources/libxslt/${pkgver%.*}/${_realname}-${pkgver}.tar.xz"
'0001-pkgconfig-add-cflags-private.patch'
'0003-fix-concurrent-directory-creation.all.patch'
'0010-xslt-config-win-paths.patch')
sha256sums=('5a3d6b383ca5afc235b171118e90f5ff6aa27e9fea3303065231a6d403f0183a'
'7ece75b9f1ff1e3e1c37adcc0e5f236f80a0a6546f506125da8694533f73c2e3'
'322053cefed25e89e2c0f87720df7ee2cc5b090213e91724c8980cafa3f9c942'
'9e7a75d479e5cd799b52ccfe5762c18f4d9af0dc687fab257ef2dec6e71a08f1')
# Helper macros to help make tasks easier #
apply_patch_with_msg() {
for _fname in "$@"
do
msg2 "Applying ${_fname}"
patch -Nbp1 -i "${srcdir}"/${_fname}
done
}
del_file_exists() {
for _fname in "$@"
do
if [ -f $_fname ] || [ -d $_fname ]; then
rm -rf $_fname
fi
done
}
# =========================================== #
prepare() {
cd "${srcdir}/${_realname}-${pkgver}"
apply_patch_with_msg \
"0001-pkgconfig-add-cflags-private.patch" \
"0003-fix-concurrent-directory-creation.all.patch" \
"0010-xslt-config-win-paths.patch"
autoreconf -fi
}
build() {
mkdir -p "${srcdir}/build-${MSYSTEM}-static" && cd "${srcdir}/build-${MSYSTEM}-static"
CPPFLAGS+=" -DLIBXML_STATIC -DLIBEXSLT_STATIC -DLIBXSLT_STATIC" \
../${_realname}-${pkgver}/configure \
--prefix=${MINGW_PREFIX} \
--build=${MINGW_CHOST} \
--target=${MINGW_CHOST} \
--disable-shared \
--enable-static \
--with-crypto \
--with-plugins \
--with-libxml-prefix=${MINGW_PREFIX} \
--without-python
make
mkdir -p "${srcdir}/build-${MSYSTEM}-shared" && cd "${srcdir}/build-${MSYSTEM}-shared"
../${_realname}-${pkgver}/configure \
--prefix=${MINGW_PREFIX} \
--build=${MINGW_CHOST} \
--target=${MINGW_CHOST} \
--enable-shared \
--disable-static \
--with-crypto \
--with-plugins \
--with-libxml-prefix=${MINGW_PREFIX} \
--without-python
make
}
package() {
export MSYS2_ARG_CONV_EXCL="-//OASIS"
cd "${srcdir}/build-${MSYSTEM}-static"
make DESTDIR="${pkgdir}" install
cd "${srcdir}/build-${MSYSTEM}-shared"
make DESTDIR="${pkgdir}" install
# Remove hard coded paths
local PREFIX_DEPS=$(cygpath -am ${MINGW_PREFIX})
sed -s "s|${PREFIX_DEPS}\/include|\${includedir}|g" -i "${pkgdir}"${MINGW_PREFIX}/bin/xslt-config
sed -s "s|${PREFIX_DEPS}\/lib|\${libdir}|g" -i "${pkgdir}"${MINGW_PREFIX}/bin/xslt-config
sed -s "s|${PREFIX_DEPS}|${MINGW_PREFIX}|g" -i "${pkgdir}"${MINGW_PREFIX}/lib/xsltConf.sh
sed -s "s|${PREFIX_DEPS}|${MINGW_PREFIX}|g" -i "${pkgdir}"${MINGW_PREFIX}/lib/pkgconfig/libexslt.pc
sed -s "s|${PREFIX_DEPS}|${MINGW_PREFIX}|g" -i "${pkgdir}"${MINGW_PREFIX}/lib/pkgconfig/libxslt.pc
}