APKBUILD 1.72 KB
Newer Older
Fabian Affolter's avatar
Fabian Affolter committed
1
2
3
4
# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=py-pillow
_pkgname=Pillow
Leo's avatar
Leo committed
5
pkgver=6.2.2
6
pkgrel=1
prspkt's avatar
prspkt committed
7
pkgdesc="Python Imaging Library"
Leo's avatar
Leo committed
8
options="!check"
prspkt's avatar
prspkt committed
9
url="https://python-pillow.org"
Fabian Affolter's avatar
Fabian Affolter committed
10
arch="all"
11
license="custom:PIL"
12
depends="py-olefile"
13
makedepends="python2-dev python3-dev py2-setuptools py3-setuptools freetype-dev
14
15
	jpeg-dev libwebp-dev tiff-dev libpng-dev lcms2-dev libjpeg-turbo-dev
	zlib-dev"
prspkt's avatar
prspkt committed
16
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
17
18
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz
	py-pillow-fix-pytest-ver.patch"
19
builddir="$srcdir/$_pkgname-$pkgver"
Fabian Affolter's avatar
Fabian Affolter committed
20

Leo's avatar
Leo committed
21
22
23
24
25
26
27
28
# secfixes:
#   6.2.2-r0:
#     - CVE-2019-19911
#     - CVE-2020-5310
#     - CVE-2020-5311
#     - CVE-2020-5312
#     - CVE-2020-5313

Fabian Affolter's avatar
Fabian Affolter committed
29
build() {
30
31
	# zlib resides in lib
	export CFLAGS="$CFLAGS -L/lib"
32
33
	python2 setup.py build
	python3 setup.py build
Fabian Affolter's avatar
Fabian Affolter committed
34
35
}

36
check() {
Leo's avatar
Leo committed
37
	rm -f Tests/test_imageshow.py
38
39
	python2 setup.py test -v
	python3 setup.py test -v
40
41
}

Fabian Affolter's avatar
Fabian Affolter committed
42
package() {
43
44
45
46
47
	mkdir -p "$pkgdir"
}

_py2() {
	replaces="$pkgname py-imaging"
48
	depends="${depends//py-/py2-}"
49
50
51
52
	_py python2
}

_py3() {
53
	depends="${depends//py-/py3-}"
54
55
56
57
58
59
60
61
62
	_py python3
}

_py() {
	local python="$1"
	pkgdesc="$pkgdesc (for $python)"
	install_if="$pkgname=$pkgver-r$pkgrel $python"

	cd "$builddir"
prspkt's avatar
prspkt committed
63
	$python setup.py install --prefix=/usr --root="$subpkgdir"
Fabian Affolter's avatar
Fabian Affolter committed
64
65
}

Leo's avatar
Leo committed
66
sha512sums="517c971d4fb23a47466a7e8326c8c29291f7832d4521001c1898d6223ea25d4b0a8b7c8f7e78dd706f421229a8261b558b9fbdc43e47a0a2a7b2b4bbc1a21eff  Pillow-6.2.2.tar.gz
67
b33216541d7cdeb481d650b7cafeb44333244abbdab035ff5aa086c8dc9c5b2e1e9e294048f299f803d251c7a70ac4ea0a68ba28e7a9ced136287d61310708cf  py-pillow-fix-pytest-ver.patch"