aboutsummaryrefslogtreecommitdiffstats
path: root/main/py-cairo/APKBUILD
blob: e4da9517f91a457c90130db559fef502ec3d29f4 (plain)
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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=py-cairo
pkgver=1.16.3
pkgrel=0
pkgdesc="Python bindings for the cairo graphics library"
url="http://cairographics.org/pycairo/"
arch="all"
license="LGPL-2.0-or-later"
depends=""
makedepends="python2-dev python3-dev cairo-dev"
install=""
subpackages="$pkgname-dev py2-cairo:_py py3-cairo:_py"
source="https://github.com/pygobject/pycairo/releases/download/v$pkgver/pycairo-$pkgver.tar.gz
	"
builddir="$srcdir"/pycairo-$pkgver

build() {
	cd "$builddir"
	python2 setup.py build
	python3 setup.py build
}

check() {
	cd "$builddir"
	python2 setup.py check
	python3 setup.py check
}

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

_py() {
	local py=${subpkgname%-*}
	local pyver=${py#py}
	local python="python$pyver"
	pkgdesc="$pkgdesc (for $python)"
	install_if="$pkgname=$pkgver-r$pkgrel $python"
	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/$python* "$subpkgdir"/usr/lib/
}

dev() {
	default_dev
	replaces="py2-cairo-dev py3-cairo-dev"
}

sha512sums="d60978f85eb0430f2038b0e7d0bce23602e8c180a7611eea424fd8bc3cdd8ce249af364abd0e77ab3b7ab439761721cba5c2398f51af2a89add3fb7fda8aa5db  pycairo-1.16.3.tar.gz"