updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / gcc-python-plugin / PKGBUILD
blob79f4707b8d93bb7817adebe942fa9a0bd0d18d96
1 # Maintainer: Allan McRae <allan@archlinux.org>
3 pkgname=gcc-python-plugin
4 pkgver=0.8
5 _gccver=4.6.2
6 pkgrel=1
7 pkgdesc="Allows the invoking of arbitrary Python scripts from inside the compiler"
8 arch=('i686' 'x86_64')
9 url="https://fedorahosted.org/gcc-python-plugin/"
10 license=('GPL3')
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
19 build() {
20   cd $srcdir/$pkgname-$pkgver
22   # build python3 plugin
23   make PLUGIN_PYTHONPATH=${_plugindir}/${pkgname} plugin
24   mv python.so python3.so
25   rm -f *.o
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
34   # not working...
35   #make -C docs man
38 # TODO - run test-suite
40 package() {
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}
49   
50   install -dm755 $pkgdir/${_plugindir}/$pkgname/libcpychecker
51   install -m644 libcpychecker/* $pkgdir/${_plugindir}/$pkgname/libcpychecker
52   
53   install -m755 gcc-with-python $pkgdir/usr/bin/
54   #install -m644 docs/_build/man/gcc-python-plugin.1 $pkgdir/usr/share/man/man1/