diff options
Diffstat (limited to 'main/py3-cparser')
-rw-r--r-- | main/py3-cparser/APKBUILD | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/main/py3-cparser/APKBUILD b/main/py3-cparser/APKBUILD new file mode 100644 index 0000000000..31858dd71b --- /dev/null +++ b/main/py3-cparser/APKBUILD @@ -0,0 +1,52 @@ +# Contributor: +# Maintainer: +pkgname=py-cparser +_pkgname=pycparser +pkgver=2.19 +pkgrel=2 +pkgdesc="A C parser written in Python" +url="https://github.com/eliben/pycparser" +arch="noarch" +license="BSD" +depends="" +makedepends="python2-dev python3-dev py-setuptools" +subpackages="py3-${pkgname#py-}:_py3 py2-${pkgname#py-}:_py2" +source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz" +builddir="$srcdir/$_pkgname-$pkgver" + +build() { + cd "$builddir" + python2 setup.py build || return 1 + python3 setup.py build || return 1 +} + +check() { + cd "$builddir" + python2 tests/all_tests.py + python3 tests/all_tests.py +} + +package() { + mkdir -p "$pkgdir" +} + +_py() { + local python="$1" + pkgdesc="$pkgdesc ${python#python}" + depends="$depends $python" + install_if="$pkgname=$pkgver-r$pkgrel $python" + + cd "$builddir" + $python setup.py install --prefix=/usr --root="$subpkgdir" +} + +_py2() { + replaces="$pkgname" + _py python2 +} + +_py3() { + _py python3 +} + +sha512sums="7f830e1c9066ee2d297a55e2bf6db4bf6447b6d9da0145d11a88c3bb98505755fb7986eafa6e06ae0b7680838f5e5d6a6d188245ca5ad45c2a727587bac93ab5 pycparser-2.19.tar.gz" |