updated on Wed Jan 25 20:08:56 UTC 2012
[aur-mirror.git] / codeviz / PKGBUILD
blob4291d8dda50078ef82d4d8c878fbc9f9f66a738c
1 # Maintainer: Lukas Jirkovsky <l.jirkovsky@gmail.com>
2 pkgname=codeviz
3 pkgver=1.0.11
4 _gccver=3.4.6
5 pkgrel=1
6 pkgdesc="A call graph generation utility for C/C++"
7 arch=('i686' 'x86_64')
8 url="http://www.csn.ul.ie/~mel/projects/codeviz/"
9 license=('GPL2')
10 depends=('perl' 'graphviz')
11 source=(http://www.csn.ul.ie/~mel/projects/codeviz/codeviz-$pkgver.tar.gz \
12         ftp://ftp.gnu.org/pub/gnu/gcc/gcc-$_gccver/gcc-$_gccver.tar.gz \
13         gcc_build_fixes.diff \
14         gcc_pure64.diff)
15 install=codeviz.install
16 md5sums=('9de2506f8d87eebea86a93197ee58316'                                                                                                                                                                                                  
17          'b0c915e554aaf475dde0571677c15a9c'                                                                                                                                                                                                  
18          '6796b290d7f734ee9d92e1e38f363bd7'                                                                                                                                                                                                  
19          'eb834abd7620a5f11492ee2c243b8346')
21 _gccprefix=/opt/gccgraph
23 build() {
24   #####################
25   # build patched gcc #
26   #####################
27   # unset the C(XX)FLAGS because they would break the compilation if they contained
28   # options not supported in $_gccver
29   unset CFLAGS
30   unset CXXFLAGS
31   cd "$srcdir"/gcc-$_gccver
32   # apply codeviz patches
33   patch -Np1 < "$srcdir"/$pkgname-$pkgver/compilers/gcc-patches/gcc-$_gccver-cdepn.diff || true
34   # apply fixes needed for build
35   patch -Np1 < "$srcdir"/gcc_build_fixes.diff || true
36   # apply pure64 patch
37   if [ "${CARCH}" = "x86_64" ]; then
38     patch -Np1 < "$srcdir"/gcc_pure64.diff || true
39   fi
41   if [ ! -d "$srcdir"/gcc-build ]; then
42     mkdir "$srcdir"/gcc-build
43   fi
44   cd "$srcdir"/gcc-build
45   ../gcc-$_gccver/configure --prefix=$_gccprefix --enable-shared --enable-languages=c,c++ \
46                             --enable-threads=posix --enable-__cxa_atexit --disable-multilib \
47                             --enable-clocale=gnu --libdir=$_gccprefix/lib \
48                             --libexecdir=$_gccprefix/lib
49   make || true
50   # now the build most likely failed
51   # we have to fix some problems and try to build gcc again
52   sed 's/.*undef HAVE_LIMITS_H.*/\#define HAVE_LIMITS_H 1/' -i $CHOST/libiberty/config.h
53   sed 's/.*undef HAVE_STDLIB_H.*/\#define HAVE_STDLIB_H 1/' -i $CHOST/libiberty/config.h
54   sed 's/.*undef HAVE_UNISTD_H.*/\#define HAVE_UNISTD_H 1/' -i $CHOST/libiberty/config.h
55   echo "#undef HAVE_SYS_STAT_H" >> $CHOST/libiberty/config.h
56   echo "#define HAVE_SYS_STAT_H 1" >> $CHOST/libiberty/config.h
57   # repeat the build
58   make
61 package() {
62   # install gcc
63   cd "$srcdir"/gcc-build
64   make DESTDIR="$pkgdir" install
65   
66   # install codeviz
67   cd "$srcdir/$pkgname-$pkgver"
68   # install perl libs
69   install -d -m755 "$pkgdir"/usr/lib/perl5/vendor_perl/CodeViz
70   install -m444 lib/CodeViz/* "$pkgdir"/usr/lib/perl5/vendor_perl/CodeViz/
71   # install codeviz binaries
72   install -d -m755 "$pkgdir"/usr/bin
73   install -m755 bin/* "$pkgdir"/usr/bin/
76 # vim:set ts=2 sw=2 et: