diff options
-rw-r--r-- | community/py-sip/APKBUILD | 51 |
1 files changed, 40 insertions, 11 deletions
diff --git a/community/py-sip/APKBUILD b/community/py-sip/APKBUILD index 79c6a933ec..241ee0a6b5 100644 --- a/community/py-sip/APKBUILD +++ b/community/py-sip/APKBUILD @@ -2,33 +2,62 @@ # Maintainer: Francesco Colista <fcolista@alpinelinux.org> pkgname=py-sip _pkgname=sip -pkgver=4.19.2 +pkgver=4.19.6 pkgrel=0 pkgdesc="A tool that makes it easy to create Python bindings for C and C++ libraries" url="http://www.riverbankcomputing.com/software/sip/" arch="all" license="custom:sip" -makedepends="python2-dev" -subpackages="$pkgname-dev" +makedepends="python2-dev python3-dev" +subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3 $pkgname-dev" source="https://sourceforge.net/projects/pyqt/files/sip/sip-$pkgver/sip-$pkgver.tar.gz" - builddir="$srcdir"/$_pkgname-$pkgver +prepare() { + default_prepare + cp -r "$builddir" "$srcdir"/python2 + cp -r "$builddir" "$srcdir"/python3 +} + build() { - cd "$builddir" + _build python2 + _build python3 +} + +_build() { + local python="$1" + export PYTHON=$python + cd "$srcdir"/$python local sip_api_major_nr=$(sed -nre 's:^#define SIP_API_MAJOR_NR\s+([0-9]+):\1:p' siplib/sip.h.in) - python configure.py + $python configure.py make CC="${CC:-gcc}" \ CXX="${CXX:-g++}" \ CFLAGS="$CFLAGS -fPIC" \ - CXXFLAGS="$CXXFLAGS" \ - || return 1 + CXXFLAGS="$CXXFLAGS" } package() { - cd "$builddir" - make DESTDIR="$pkgdir" install || return 1 + mkdir -p "$pkgdir" +} + +_py2() { + replaces="$pkgname" + _py python2 +} + +_py3() { + _py python3 +} + +_py() { + local python="$1" + pkgdesc="$pkgdesc (for $python)" + install_if="$pkgname=$pkgver-r$pkgrel $python" + cd "$srcdir/$python" + make DESTDIR="$pkgdir" install + mkdir -p "$subpkgdir"/usr/lib + mv "$pkgdir"/usr/lib/${python}.* "$subpkgdir"/usr/lib/ install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/custom/${pkgname}/LICENSE } -sha512sums="6f14f387a899130cf15820d2b58d937d134a2eefd53c65a82af060e88a6ca039442b21f822880c4a3742d6f26328853a552239873c55d7b22de62a6cc5037b3e sip-4.19.2.tar.gz" +sha512sums="1bfd2da8b0ece6156aa94713d5e9ced6226b7f49427ca4a11b65452a67e9c740b93a1f90c00a0636d4eef8a31324988a84373c15194f64774b6f8c084d0464f7 sip-4.19.6.tar.gz" |