aboutsummaryrefslogtreecommitdiffstats
path: root/community/py3-sip/APKBUILD
blob: 8c9a7d43e1f49ba8fa87e2c812774ee30a48c71d (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
55
56
57
58
59
60
61
62
63
64
65
66
# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer:  Francesco Colista <fcolista@alpinelinux.org>
pkgname=py3-sip
_pkgname=sip
pkgver=4.19.21
pkgrel=0
pkgdesc="A tool that makes it easy to create Python bindings for C and C++ libraries"
options="!check" # No testsuite
url="http://www.riverbankcomputing.com/software/sip/"
arch="all"
license="custom:sip"
makedepends="python3-dev"
subpackages="
	$pkgname-pyqt5
	$pkgname-dev::noarch
	$pkgname-doc"
source="https://www.riverbankcomputing.com/static/Downloads/$_pkgname/$pkgver/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver

replaces="py-sip" # Backwards comptibility
provides="py-sip=$pkgver-r$pkgrel" # Backwards comptibility

prepare() {
	default_prepare
	mkdir -p "$srcdir"/python3-sip
	mkdir -p "$srcdir"/python3-PyQt5.sip
}

build() {
	cd "$srcdir"/python3-sip
	python3 "$builddir"/configure.py CFLAGS="$CFLAGS" LFLAGS="$LDFLAGS"

	cd "$srcdir"/python3-PyQt5.sip
	python3 "$builddir"/configure.py CFLAGS="$CFLAGS" LFLAGS="$LDFLAGS" --sip-module PyQt5.sip --no-tools
}

package() {
	cd "$srcdir"/python3-sip
	make DESTDIR="$pkgdir" install

	# Move sip.h to /usr/include
	mv "$pkgdir"/usr/include/python3*/sip.h "$pkgdir"/usr/include/sip.h
	rm -rf "$pkgdir"/usr/include/python3*

	install -Dm644 "$builddir"/LICENSE "$pkgdir"/usr/share/licenses/custom/$pkgname/LICENSE
}

pyqt5() {
	pkgdesc="Python3 SIP bindings for C and C++ libraries"

	replaces="" # Reset
	provides="" # Reset

	cd "$srcdir"/python3-PyQt5.sip
	make DESTDIR="$subpkgdir" install
}

dev() {
	replaces="py-sip-dev" # Backwards compatibility
	provides="py-sip-dev=$pkgver-r$pkgrel" # Backwards compatibility

	depends_dev="py3-sip" # Depend on the package that provides the sip binary
	default_dev
}

sha512sums="441e1fe6b3eb6820638f9b4436e820da39b72dd70b402afa5237979ac671978c081d92e1e78920bb754bbc66b159bad08edb3bbb497b7e72dee6ff1d69cd1b60  sip-4.19.21.tar.gz"