1 # Maintainer: Allan McRae <allan@archlinux.org>
3 pkgname=gcc-python-plugin
7 pkgdesc="Allows the invoking of arbitrary Python scripts from inside the compiler"
9 url="https://fedorahosted.org/gcc-python-plugin/"
11 depends=("gcc=${_gccver}" 'python-six')
12 makedepends=('python2' 'python-sphinx')
13 optdepends=('python2-six: for the Python-2 plugin')
14 source=(https://fedorahosted.org/releases/g/c/$pkgname/$pkgname-$pkgver.tar.gz)
15 md5sums=('53887aec8c3a82bbe2e92f719d7aeb9c')
17 _plugindir=/usr/lib/gcc/${CHOST}/${_gccver}/plugin
20 cd $srcdir/$pkgname-$pkgver
22 # headers are in a different place for gcc-4.6...
23 sed -i "s#c-family/##" gcc-python.c gcc-python-compat.h gcc-python-option.c generate-tree-c.py
25 # build python3 plugin
26 make PLUGIN_PYTHONPATH=${_plugindir}/${pkgname} plugin
27 mv python.so python3.so
30 # build python2 plugin
31 make PYTHON=python2 PYTHON_CONFIG=python2-config PLUGIN_PYTHONPATH=${_plugindir}/${pkgname} plugin
32 mv python.so python2.so
34 # adjust gcc-with-python script to use global plugin
35 sed -i 's#$(pwd)/python.so#python#' gcc-with-python
40 # TODO - run test-suite
43 cd $srcdir/$pkgname-$pkgver
45 install -dm755 $pkgdir/${_plugindir}/$pkgname $pkgdir/usr/{bin,share/man/man1}
47 install -m755 python{2,3}.so $pkgdir/${_plugindir}
48 ln -s python3.so $pkgdir/${_plugindir}/python.so
50 install -m644 gccutils.py $pkgdir/${_plugindir}/${pkgname}
52 install -dm755 $pkgdir/${_plugindir}/$pkgname/libcpychecker
53 install -m644 libcpychecker/* $pkgdir/${_plugindir}/$pkgname/libcpychecker
55 install -m755 gcc-with-python $pkgdir/usr/bin/
56 install -m644 docs/_build/man/gcc-python-plugin.1 $pkgdir/usr/share/man/man1/