updated on Wed Jan 18 08:00:29 UTC 2012
[aur-mirror.git] / gdc1-hg / PKGBUILD
blobe30154df07243510b8bcc6c13929ff924a9a7e10
1 # Contributor: Jerome Berger <jeberger@free.fr>
2 pkgname=gdc1-hg
3 pkgver=566
4 _gccver=4.5.1
5 pkgrel=1
6 pkgdesc="GDC, Digital Mars D Programing Language (DMD) frontend for GCC (D1 version)"
7 arch=(i686 x86_64)
8 url="http://bitbucket.org/goshawk/gdc/wiki/Home"
9 license="GPL"
10 provides=('gdc')
11 depends=("gcc>=$_gccver")
12 makedepends=('mercurial')
13 conflicts=('gdc' 'gdc-svn' 'gdc2-hg')
14 options=('!libtool' '!emptydirs')
15 source=(ftp://gcc.gnu.org/pub/gcc/releases/gcc-${_gccver}/gcc-core-${_gccver}.tar.bz2
16         gdc-stdlib)
17 md5sums=('dc8959e31b01a65ce10d269614815054'
18          '53aa15db4c14ed98ee8bda2707537a2e')
20 _hgroot=http://bitbucket.org/goshawk
21 _hgrepo=gdc
23 build() {
24    cd $srcdir
26    rm -rf $srcdir/gcc-$_gccver-build $srcdir/gcc-build
27    mv $srcdir/gcc-$_gccver $srcdir/gcc-$_gccver-build
28    ln -s $srcdir/gdc/d $srcdir/gcc-$_gccver-build/gcc
30    cd gcc-$_gccver-build
31    ./gcc/d/setup-gcc.sh
33    export MAKEFLAGS="-j1"
35    # Don't install libiberty 
36    sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in
38    # Don't run fixincludes
39    sed -i -e 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
41    mkdir ../gcc-build
42    cd ../gcc-build
43    # Note: the "CC=$(which gcc)" is necessary to work around a gcc bug that
44    # causes the build to fail if "." is in the path.
45    CC=$(which gcc) ../gcc-$_gccver-build/configure --prefix=/usr \
46        --enable-languages=d --enable-threads=posix  --enable-__cxa_atexit \
47        --disable-multilib --libdir=/usr/lib --libexecdir=/usr/lib \
48        --disable-shared --disable-bootstrap
49    make
52 package() {
53    cd $srcdir/gcc-build
55    DESTDIR=$pkgdir make install-target-libgcc install-target-libphobos
56    DESTDIR=$pkgdir make -C gcc d.install-common d.install-man d.install-normal
57    install -Dm 755 gcc/cc1d $pkgdir/usr/bin/cc1d
59    cd $pkgdir/usr
60    if [[ $CARCH == "x86_64" ]]; then
61       mv lib64/libgphobos.a lib/libgphobos.a
62       rmdir lib64
63    fi
65    cd $pkgdir/usr/include/d/${_gccver}
66    mv object.d object.d.phobos
67    ln -s object.d.phobos object.d
68    mv std std.phobos
69    ln -s std.phobos std
71    install -Dm 755 $startdir/gdc-stdlib $pkgdir/usr/bin