diff options
Diffstat (limited to 'community/py-cparser')
-rw-r--r-- | community/py-cparser/APKBUILD | 46 |
1 files changed, 26 insertions, 20 deletions
diff --git a/community/py-cparser/APKBUILD b/community/py-cparser/APKBUILD index a1b2271e17..c2ce5efb9c 100644 --- a/community/py-cparser/APKBUILD +++ b/community/py-cparser/APKBUILD @@ -2,37 +2,43 @@ # Maintainer: William Pitcock <nenolod@dereferenced.org> pkgname=py-cparser pkgver=2.14 -pkgrel=0 +pkgrel=1 pkgdesc="a C parser written in Python" url="https://github.com/eliben/pycparser" arch="noarch" license="BSD" -depends="python" -depends_dev="" -makedepends="python-dev py-setuptools" +depends="" +makedepends="python-dev python3-dev py-setuptools" install="" -subpackages="" +subpackages="py3-${pkgname/py-/}:_py3 py2-${pkgname/py-/}:_py2" source="https://files.pythonhosted.org/packages/source/p/pycparser/pycparser-$pkgver.tar.gz" - -_builddir="$srcdir"/pycparser-$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 -} +builddir="$srcdir"/pycparser-$pkgver build() { - cd "$_builddir" - python setup.py build || return 1 + cd "$builddir" + python2 setup.py build || return 1 + python3 setup.py build || return 1 } package() { - cd "$_builddir" - python setup.py install --prefix=/usr --root="$pkgdir" || return 1 + mkdir -p "$pkgdir" +} + +_py() { + local python=$1 + pkgdesc="$pkgdesc - $python" + + cd "$builddir" + $python setup.py install --prefix=/usr --root="$subpkgdir" +} + +_py2() { + _py python2 + replaces="$pkgname" +} + +_py3() { + _py python3 } md5sums="a2bc8d28c923b4fe2b2c3b4b51a4f935 pycparser-2.14.tar.gz" |