# 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.18 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=('2e0049a97d0e2d24b68b3d3f5a24e705049d972f6762595857d0f9f9f33ae64e') 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" }