summaryrefslogtreecommitdiff
path: root/user/py3-pillow/APKBUILD
blob: c995de7f540a299ad95065a5ec5e367d200a09f0 (plain) (blame)
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
# Contributor: Max Rees <maxcrees@me.com>
# Maintainer: Max Rees <maxcrees@me.com>
pkgname=py3-pillow
_pkgname=Pillow
pkgver=5.0.0
pkgrel=0
pkgdesc="A Python Imaging Library"
url="https://pypi.python.org/pypi/Pillow/$pkgver"
arch="all"
license="Custom"
depends="py3-olefile python3"
makedepends="python3-dev py3-setuptools freetype-dev jpeg-dev libwebp-dev
	tiff-dev libpng-dev lcms2-dev openjpeg-dev zlib-dev"
subpackages="$pkgname-doc"
_scripts_rev="f578e2c"
source="$pkgname-$pkgver.tar.gz::https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz
	$pkgname-scripts-$_scripts_rev.tar.gz::https://github.com/python-pillow/pillow-scripts/archive/$_scripts_rev.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

unpack() {
	default_unpack
	mv pillow-scripts-*/Scripts "$builddir/Scripts"
}

build() {
	cd "$builddir"
	# zlib resides in lib
	export CFLAGS="$CFLAGS -L/lib"
	python3 setup.py build
}

check() {
	cd "$builddir"
	PYTHONPATH="$(find 'build' -name 'lib.*')" python3 selftest.py
}

package() {
	cd "$builddir"
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

doc() {
	pkgdesc="Example scripts for $pkgname"
	depends="$pkgname"

	cd "$builddir"
	local destdir="$subpkgdir/usr/share/doc/$pkgname"
	install -d "$destdir"/Scripts
	install -m 644 Scripts/* "$destdir"/Scripts/
	install -Dm644 LICENSE "$subpkgdir/usr/share/licenses/$pkgname/LICENSE"
}

sha512sums="f6f1e138effe44a89897f48032a36406dab3c4ddff2a97b7d01e99c05865abad5cffa3ab0eefcacb243e422778063b49243b1a538012fe9c39a1e4329c0978f3  py3-pillow-5.0.0.tar.gz
1a2e6dc45127b3f0b706d5be4fdc8ddeb09a9e046a182eb48239572e1bdc62d1b1f1a1f11ef1f1f23766aaac1b498556cc9a9cf11d3b943c9f2834c9b41612e0  py3-pillow-scripts-f578e2c.tar.gz"