-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
PKGBUILD
81 lines (73 loc) · 3.36 KB
/
PKGBUILD
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# Maintainer: Alexey Pavlov <alexpux@gmail.com>
# Contributor: Ray Donnelly <mingw.android@gmail.com>
_realname=lxml
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
pkgver=4.9.4
pkgrel=1
provides=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}=${pkgver}"
"${MINGW_PACKAGE_PREFIX}-python-${_realname}-docs")
conflicts=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}"
"${MINGW_PACKAGE_PREFIX}-python-${_realname}-docs")
replaces=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}"
"${MINGW_PACKAGE_PREFIX}-python-${_realname}-docs")
pkgdesc="Python binding for the libxml2 and libxslt libraries (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64')
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}-python-build"
"${MINGW_PACKAGE_PREFIX}-python-installer"
"${MINGW_PACKAGE_PREFIX}-python-setuptools"
"${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=('b1541e50b78e15fa06a2670157a1962ef06591d4c998b998047fff5e3236880e'
'6e58bd3072a6a77bf50c4c203beef589c97873e9902d4c8c6151abe71035f186'
'7d9e5380a8461e3c2bb4b8e0ece52011b26e3112b94b97e548c927524cfc93de'
'27b1051219a7036938065d67cc54a8bcc838e0de79d748ddff03fced83ea03ef')
_apply_patch_with_msg() {
for _patch in "$@"
do
msg2 "Applying ${_patch}"
patch -p1 -i "${srcdir}/${_patch}"
done
}
prepare() {
cd "${_realname}-${pkgver}"
_apply_patch_with_msg \
use-distutils-get_platform.patch \
0001-setupinfo-fix-library-name.patch \
53eb0f82641cbfc968f0fb8ca6d81767fcfe1a5b.patch
}
build() {
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=" \
${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
install -Dm644 doc/licenses/BSD.txt \
"${pkgdir}${MINGW_PREFIX}"/share/licenses/python-${_realname}/BSD.txt
install -Dm644 doc/licenses/elementtree.txt \
"${pkgdir}${MINGW_PREFIX}"/share/licenses/python-${_realname}/elementtree.txt
}