aboutsummaryrefslogtreecommitdiffstats
path: root/community/py3-sip/APKBUILD
blob: e10eaf769db421d1e5a88fcb4cd940796970c957 (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
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.22
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="4d366e589945e589f69a3caf979076ef37e319ac0efdd8ec3cee4869da89e112832462215ca2e235036bacfade7efc4d530aa93e7492c283dc1b2503e08feea5  sip-4.19.22.tar.gz"