archrelease: copy trunk to community-x86_64
[ArchLinux/community.git] / python-pillow / trunk / PKGBUILD
blob348efcf8b00a2daf169f539905f6a57382357a61
1 # Maintainer: George Rawlinson <grawlinson@archlinux.org>
2 # Maintainer: Kyle Keen <keenerd@gmail.com>
3 # Contributor: minder
5 pkgname=python-pillow
6 pkgver=9.5.0
7 pkgrel=2
8 pkgdesc='Python Imaging Library (PIL) fork'
9 arch=('x86_64')
10 url='https://python-pillow.org'
11 license=('BSD')
12 depends=(
13   'python'
14   'freetype2'
15   'lcms2'
16   'libraqm'
17   'libtiff'
18   'openjpeg2'
19   'libimagequant'
20   'libxcb'
22 makedepends=(
23   'git'
24   'python-build'
25   'python-installer'
26   'python-wheel'
27   'python-setuptools'
28   'libwebp'
29   'tk'
31 checkdepends=('python-pytest')
32 optdepends=(
33   'libwebp: for webp images'
34   'tk: for the ImageTK module'
35   'python-olefile: OLE2 file support'
36   'python-pyqt5: for the ImageQt module'
38 _commit='204590600c6a8c5246d0564d3312abd6e6b0ed70'
39 source=("$pkgname::git+https://github.com/python-pillow/Pillow#commit=$_commit")
40 b2sums=('SKIP')
42 pkgver() {
43   cd "$pkgname"
45   git describe --tags | sed 's/^v//'
48 build() {
49   cd "$pkgname"
51   python -m build --wheel --no-isolation
54 check() {
55   cd "$pkgname"
57   local python_version=$(python -c 'import sys; print("".join(map(str, sys.version_info[:2])))')
58   export PYTHONPATH="$PWD/build/lib.linux-$CARCH-cpython-$python_version"
59   python selftest.py
60   pytest -v
63 package() {
64   cd "$pkgname"
66   python -m installer --destdir="$pkgdir" dist/*.whl
68   local python_version=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
69   install -vDm644 -t "$pkgdir/usr/include/python$python_version" src/libImaging/*.h
71   # license
72   install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE