Skip to content

Commit

Permalink
python-lxml: update to 4.9.4
Browse files Browse the repository at this point in the history
  • Loading branch information
MehdiChinoune committed Dec 29, 2023
1 parent 46f0a0a commit 7746189
Showing 1 changed file with 34 additions and 27 deletions.
61 changes: 34 additions & 27 deletions mingw-w64-python-lxml/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
_realname=lxml
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
pkgver=4.9.3
pkgver=4.9.4
pkgrel=1
provides=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}=${pkgver}"
"${MINGW_PACKAGE_PREFIX}-python-${_realname}-docs")
Expand All @@ -15,55 +15,62 @@ replaces=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}"
pkgdesc="Python binding for the libxml2 and libxslt libraries (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64')
license=('spdx:BSD-3-Clause')
url="https://lxml.de/"
msys2_repository_url="https://github.com/lxml/lxml"
license=('spdx:BSD-3-Clause')
depends=("${MINGW_PACKAGE_PREFIX}-libxml2"
"${MINGW_PACKAGE_PREFIX}-libxslt"
"${MINGW_PACKAGE_PREFIX}-python")
optdepends=("${MINGW_PACKAGE_PREFIX}-python-beautifulsoup4: support for parsing not well formed HTML"
"${MINGW_PACKAGE_PREFIX}-python-cssselect: support for cssselect"
"${MINGW_PACKAGE_PREFIX}-python-html5lib: support for html5lib parser")
makedepends=("${MINGW_PACKAGE_PREFIX}-cython0"
"${MINGW_PACKAGE_PREFIX}-python-docutils"
"${MINGW_PACKAGE_PREFIX}-python-beautifulsoup4"
"${MINGW_PACKAGE_PREFIX}-python-cssselect"
"${MINGW_PACKAGE_PREFIX}-python-html5lib"
makedepends=("${MINGW_PACKAGE_PREFIX}-python-build"
"${MINGW_PACKAGE_PREFIX}-python-installer"
"${MINGW_PACKAGE_PREFIX}-python-setuptools"
"${MINGW_PACKAGE_PREFIX}-pkgconf"
"${MINGW_PACKAGE_PREFIX}-cc")
source=("https://github.com/lxml/lxml/archive/${_realname}-${pkgver}.tar.gz"
"${MINGW_PACKAGE_PREFIX}-python-wheel"
"${MINGW_PACKAGE_PREFIX}-cython0"
"${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-pkgconf")
source=("https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname}-${pkgver}.tar.gz"
"use-distutils-get_platform.patch"
"0001-setupinfo-fix-library-name.patch"
"https://github.com/lxml/lxml/commit/53eb0f82641cbfc968f0fb8ca6d81767fcfe1a5b.patch")
sha256sums=('42b9ab83cb8739d817c7fff41c20f31aa61625bb6f6ab333873a5f3406b139ac'
sha256sums=('b1541e50b78e15fa06a2670157a1962ef06591d4c998b998047fff5e3236880e'
'6e58bd3072a6a77bf50c4c203beef589c97873e9902d4c8c6151abe71035f186'
'7d9e5380a8461e3c2bb4b8e0ece52011b26e3112b94b97e548c927524cfc93de'
'27b1051219a7036938065d67cc54a8bcc838e0de79d748ddff03fced83ea03ef')

prepare() {
pushd "${_realname}-${_realname}-${pkgver}"
patch -p1 -i "${srcdir}/use-distutils-get_platform.patch"
patch -p1 -i "${srcdir}/0001-setupinfo-fix-library-name.patch"
patch -p1 -i "${srcdir}/53eb0f82641cbfc968f0fb8ca6d81767fcfe1a5b.patch"
popd
_apply_patch_with_msg() {
for _patch in "$@"
do
msg2 "Applying ${_patch}"
patch -p1 -i "${srcdir}/${_patch}"
done
}

rm -rf python-build-${MSYSTEM} | true
cp -r "${_realname}-${_realname}-${pkgver}" "python-build-${MSYSTEM}"
prepare() {
cd "${_realname}-${pkgver}"
_apply_patch_with_msg \
use-distutils-get_platform.patch \
0001-setupinfo-fix-library-name.patch \
53eb0f82641cbfc968f0fb8ca6d81767fcfe1a5b.patch
}

build() {
msg "Python build for ${MSYSTEM}"
cd "${srcdir}/python-build-${MSYSTEM}"
${MINGW_PREFIX}/bin/python setup.py build \
--with-cython --with-unicode-strings
rm -rf python-build-${MSYSTEM} | true
cp -r "${_realname}-${pkgver}" "python-build-${MSYSTEM}" && cd "python-build-${MSYSTEM}"

CFLAGS+=" -Wno-incompatible-function-pointer-types" \
${MINGW_PREFIX}/bin/python -m build --wheel --skip-dependency-check --no-isolation \
-C--with-cython -C--with-unicode-strings
}

package() {
cd "${srcdir}/python-build-${MSYSTEM}"
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
${MINGW_PREFIX}/bin/python setup.py install --prefix=${MINGW_PREFIX#\/} \
--root="${pkgdir}" --optimize=1 --skip-build \
--with-cython --with-unicode-strings

MSYS2_ARG_CONV_EXCL="--prefix=" \
${MINGW_PREFIX}/bin/python -m installer --prefix=${MINGW_PREFIX} \
--destdir="${pkgdir}" dist/*.whl

install -Dm644 LICENSES.txt \
"${pkgdir}${MINGW_PREFIX}"/share/licenses/python-${_realname}/LICENSE
Expand Down

1 comment on commit 7746189

@lazka
Copy link
Member

@lazka lazka commented on 7746189 Jan 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fyi, -C--with-cython doesn't work, see #19598

Please sign in to comment.