# Maintainer: Samir Benmendil # Contributor: Felix Yan # Contributor: Justin Dray # Contributor: Alexander Rødseth # Contributor: lang2 pkgbase=python-pycparser pkgname=(python3-pycparser python2-pycparser) pkgver=2.14 pkgrel=1 pkgdesc='C parser and AST generator written in Python' url='https://github.com/eliben/pycparser' makedepends=('python3-ply' 'python2-ply' 'git') arch=('any') license=('BSD') source=("https://github.com/eliben/pycparser/archive/release_v$pkgver.zip") sha256sums=('8612b94df49ce0c69a56b7ba23530e69cfb91bf788cc7fde14e17a099feb4e25') prepare() { cp -r pycparser-release_v${pkgver}{,-py2} } build() { cd pycparser-release_v${pkgver} python3 setup.py build cd pycparser python3 _build_tables.py cd "$srcdir/pycparser-release_v${pkgver}-py2" python2 setup.py build cd pycparser python2 _build_tables.py } check() { cd pycparser-release_v${pkgver} python3 tests/all_tests.py cd "$srcdir/pycparser-release_v${pkgver}-py2" python2 tests/all_tests.py } package_python3-pycparser() { depends=('python3-ply') cd pycparser-release_v${pkgver} python3 setup.py install --root="$pkgdir" --optimize=1 install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" } package_python2-pycparser() { depends=('python2-ply') cd pycparser-release_v${pkgver}-py2 python2 setup.py install --root="$pkgdir" --optimize=1 install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" }