updated on Tue Jan 10 04:01:21 UTC 2012
[aur-mirror.git] / gcc-python-plugin / PKGBUILD
blobb0e71702c8832f34c2f7a09fdc0241f42589056a
1 # Maintainer: Allan McRae <allan@archlinux.org>
3 pkgname=gcc-python-plugin
4 pkgver=0.7
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}" '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
19 build() {
20   cd $srcdir/$pkgname-$pkgver
21   
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
28   rm -f *.o
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
37   make -C docs man
40 # TODO - run test-suite
42 package() {
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}
51   
52   install -dm755 $pkgdir/${_plugindir}/$pkgname/libcpychecker
53   install -m644 libcpychecker/* $pkgdir/${_plugindir}/$pkgname/libcpychecker
54   
55   install -m755 gcc-with-python $pkgdir/usr/bin/
56   install -m644 docs/_build/man/gcc-python-plugin.1 $pkgdir/usr/share/man/man1/