Creating a static lib with setuptools seems to make problems with clangarm64. Until we know more try a revert. See #26007
76 lines
2.9 KiB
Bash
76 lines
2.9 KiB
Bash
# Maintainer: Alexey Pavlov <Alexpux@gmail.com>
|
|
|
|
_realname=pillow
|
|
pkgbase=mingw-w64-python-pillow
|
|
pkgname=("${MINGW_PACKAGE_PREFIX}-python-pillow")
|
|
pkgver=12.0.0
|
|
pkgrel=2
|
|
pkgdesc="Python Imaging Library (PIL) fork Python3 version (mingw-w64)"
|
|
arch=('any')
|
|
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
|
|
url="https://github.com/python-pillow/Pillow/"
|
|
msys2_references=(
|
|
'purl: pkg:pypi/pillow'
|
|
"cpe: cpe:/a:python:pillow"
|
|
)
|
|
license=('spdx:MIT-CMU')
|
|
depends=("${MINGW_PACKAGE_PREFIX}-freetype"
|
|
"${MINGW_PACKAGE_PREFIX}-lcms2"
|
|
"${MINGW_PACKAGE_PREFIX}-libavif"
|
|
"${MINGW_PACKAGE_PREFIX}-libimagequant"
|
|
"${MINGW_PACKAGE_PREFIX}-libjpeg"
|
|
"${MINGW_PACKAGE_PREFIX}-libraqm"
|
|
"${MINGW_PACKAGE_PREFIX}-libtiff"
|
|
"${MINGW_PACKAGE_PREFIX}-libwebp"
|
|
"${MINGW_PACKAGE_PREFIX}-openjpeg2"
|
|
"${MINGW_PACKAGE_PREFIX}-zlib")
|
|
makedepends=("${MINGW_PACKAGE_PREFIX}-python-build"
|
|
"${MINGW_PACKAGE_PREFIX}-python-installer"
|
|
"${MINGW_PACKAGE_PREFIX}-python-setuptools"
|
|
"${MINGW_PACKAGE_PREFIX}-pybind11"
|
|
"${MINGW_PACKAGE_PREFIX}-cc"
|
|
"${MINGW_PACKAGE_PREFIX}-tk")
|
|
optdepends=("${MINGW_PACKAGE_PREFIX}-tk: for the ImageTK module")
|
|
source=("https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname}-${pkgver}.tar.gz"
|
|
"0001-Revert-build-Mode.c-as-a-common-library.patch")
|
|
sha256sums=('87d4f8125c9988bfbed67af47dd7a953e2fc7b0cc1e7800ec6d2080d490bb353'
|
|
'af97ebd6fa6ec30f7bcdff84b2bce6ef5ad44d7b58f15a91cfdf794ad4bd235c')
|
|
|
|
prepare() {
|
|
rm -rf "python-build-${MSYSTEM}" | true
|
|
cp -r "${_realname}-${pkgver}" "python-build-${MSYSTEM}"
|
|
cd "python-build-${MSYSTEM}"
|
|
|
|
# Revert of https://github.com/python-pillow/Pillow/commit/28adda9299daac9cd4ee349474d7618c16152d2d
|
|
# See https://github.com/msys2/MINGW-packages/issues/26007
|
|
patch -p1 -i "${srcdir}/0001-Revert-build-Mode.c-as-a-common-library.patch"
|
|
}
|
|
|
|
build() {
|
|
cd "${srcdir}/python-build-${MSYSTEM}"
|
|
|
|
${MINGW_PREFIX}/bin/python -m build --wheel --skip-dependency-check --no-isolation
|
|
}
|
|
|
|
check() {
|
|
cd "${srcdir}/python-build-${MSYSTEM}"
|
|
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
|
|
${MINGW_PREFIX}/bin/python selftest.py || true
|
|
|
|
#setup.py test
|
|
}
|
|
|
|
package() {
|
|
local _mingw_prefix=$(cygpath -am ${MINGW_PREFIX})
|
|
local _pybasever=$(${MINGW_PREFIX}/bin/python -c "import sys;sys.stdout.write('.'.join(map(str, sys.version_info[:2])))")
|
|
|
|
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 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE"
|
|
install -dm755 "${pkgdir}${MINGW_PREFIX}/include/python${_pybasever}/"
|
|
install -m644 -t "${pkgdir}${MINGW_PREFIX}/include/python${_pybasever}/" src/libImaging/*.h
|
|
}
|