desktop/python-pycparser/PKGBUILD
2017-10-31 23:04:26 +01:00

62 lines
1.5 KiB
Bash

# Maintainer: Samir Benmendil <samir.benmendil@gmail.com>
# Contributor: Felix Yan <felixonmars@gmail.com>
# Contributor: Justin Dray <justin@dray.be>
# Contributor: Alexander Rødseth <rodseth@gmail.com>
# Contributor: lang2 <wenzhi.liang@gmail.com>
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"
}