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}-6" 'python-six')
12 makedepends=('python2' 'python-sphinx' 'docutils')
13 optdepends=('python2-six: for the Python-2 plugin')
14 source=(https://fedorahosted.org/releases/g/c/$pkgname/$pkgname-$pkgver.tar.gz)
15 md5sums=('dcca1c91c385a41d2cd297598a46719c')
17 _plugindir=/usr/lib/gcc/${CHOST}/${_gccver}/plugin
20 cd $srcdir/$pkgname-$pkgver
22 # build python3 plugin
23 make PLUGIN_PYTHONPATH=${_plugindir}/${pkgname} plugin
24 mv python.so python3.so
27 # build python2 plugin
28 make PYTHON=python2 PYTHON_CONFIG=python2-config PLUGIN_PYTHONPATH=${_plugindir}/${pkgname} plugin
29 mv python.so python2.so
31 # adjust gcc-with-python script to use global plugin
32 sed -i 's#$(pwd)/python.so#python#' gcc-with-python
38 # TODO - run test-suite
41 cd $srcdir/$pkgname-$pkgver
43 install -dm755 $pkgdir/${_plugindir}/$pkgname $pkgdir/usr/{bin,share/man/man1}
45 install -m755 python{2,3}.so $pkgdir/${_plugindir}
46 ln -s python3.so $pkgdir/${_plugindir}/python.so
48 install -m644 gccutils.py $pkgdir/${_plugindir}/${pkgname}
50 install -dm755 $pkgdir/${_plugindir}/$pkgname/libcpychecker
51 install -m644 libcpychecker/* $pkgdir/${_plugindir}/$pkgname/libcpychecker
53 install -m755 gcc-with-python $pkgdir/usr/bin/
54 #install -m644 docs/_build/man/gcc-python-plugin.1 $pkgdir/usr/share/man/man1/