diff options
author | Olivier Mauras <olivier@mauras.ch> | 2016-09-14 22:55:28 +0200 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2016-09-14 23:41:02 +0200 |
commit | ebee8376cadf635d062db76c49455ffcbd025c3e (patch) | |
tree | 81c300168adf4d30232449cec7abfafe5a972bf3 /testing/py-pygit2/APKBUILD | |
parent | 42737101590cb4129c055e495e7b454460305270 (diff) | |
download | aports-ebee8376cadf635d062db76c49455ffcbd025c3e.tar.bz2 aports-ebee8376cadf635d062db76c49455ffcbd025c3e.tar.xz |
testing/py-pygit2: refactor abuild to support py2/py3
Diffstat (limited to 'testing/py-pygit2/APKBUILD')
-rw-r--r-- | testing/py-pygit2/APKBUILD | 66 |
1 files changed, 40 insertions, 26 deletions
diff --git a/testing/py-pygit2/APKBUILD b/testing/py-pygit2/APKBUILD index 6b988025c6..35b5282e7d 100644 --- a/testing/py-pygit2/APKBUILD +++ b/testing/py-pygit2/APKBUILD @@ -1,37 +1,51 @@ # Contributor: Pierre-Gildas MILLON <pgmillon@gmail.com> -# Maintainer: +# Maintainer: Olivier Mauras <olivier@mauras.ch> pkgname=py-pygit2 +_pkgname=pygit2 pkgver=0.24.1 -pkgrel=0 +pkgrel=1 pkgdesc="Python bindings for libgit2" -url=https://github.com/libgit2/pygit2 -arch=all -license=GPLv2 -depends= -makedepends="py-setuptools py-cffi python-dev libgit2-dev" -source=pygit2-${pkgver}.tar.gz::https://github.com/libgit2/pygit2/archive/v${pkgver}.tar.gz - -_builddir=$srcdir/pygit2-$pkgver -prepare() { - local i - cd "$_builddir" - for i in $source; do - case $i in - *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; - esac - done -} +url="https://github.com/libgit2/pygit2" +arch="noarch" +license="GPLv2" +subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3" +makedepends="python2-dev python3-dev py-setuptools py2-cffi py3-cffi py2-six py3-six + libgit2-dev libssh2-dev openssl-dev" +source="$pkgname-$pkgver.tar.gz::https://github.com/libgit2/$_pkgname/archive/v${pkgver}.tar.gz" +builddir="$srcdir/$_pkgname-$pkgver" build() { - cd "$_builddir" - python setup.py build + cd "$builddir" + python2 setup.py build || return 1 + python3 setup.py build || return 1 } package() { - cd "$_builddir" - python setup.py install --root "$pkgdir" + mkdir -p "$pkgdir" +} + +_py2() { + replaces="$pkgname" + depends="py2-cffi py2-six" + _py python2 +} + +_py3() { + depends="py3-cffi py3-six" + _py python3 +} + +_py() { + local python=$1 + arch="all" + pkgdesc="$pkgdesc - $python" + depends="libgit2 $python" + install_if="$pkgname=$pkgver-r$pkgrel $python" + + cd "$builddir" + $python setup.py install --prefix=/usr --root="$subpkgdir" || return 1 } -md5sums="d9915e3f8a7da65af3ea70f5bc02967d pygit2-0.24.1.tar.gz" -sha256sums="e62bd35c39b4dec64a8a35ab688e98352603c21a6b254473763868a45110fb47 pygit2-0.24.1.tar.gz" -sha512sums="a6ac980d20f9342cefbb3646cef0b99b75037813d11e64797a62c8df5f0cc2d4a8397c266caf25f49d9c2e2cb47b0087e38e64527ef59385ddb00023cb04ab0f pygit2-0.24.1.tar.gz" +md5sums="d9915e3f8a7da65af3ea70f5bc02967d py-pygit2-0.24.1.tar.gz" +sha256sums="e62bd35c39b4dec64a8a35ab688e98352603c21a6b254473763868a45110fb47 py-pygit2-0.24.1.tar.gz" +sha512sums="a6ac980d20f9342cefbb3646cef0b99b75037813d11e64797a62c8df5f0cc2d4a8397c266caf25f49d9c2e2cb47b0087e38e64527ef59385ddb00023cb04ab0f py-pygit2-0.24.1.tar.gz" |