updated on Mon Jan 23 20:11:11 UTC 2012
[aur-mirror.git] / ldc / PKGBUILD
blob71cb17ea586718beaf904bfcdab1d0af9d4d055a
1 # author: MrSunshine
2 pkgname=ldc
3 pkgver=1574
4 pkgrel=1
5 pkgdesc="A D Compiler based on the LLVM Compiler Infrastructure including D runtime and tango revision 4699 lib and imports"
6 arch=('i686' 'x86_64')
7 url="http://www.dsource.org/projects/ldc"
8 license=('BSD')
9 depends=('llvm-svn=72227')
10 makedepends=('gcc' 'mercurial' 'cmake' 'subversion' 'libconfig')
11 #provides=()
12 conflicts=('ldc-hg')
13 source=(ldc.conf)
14 #install=(${pkgname}.install)
15 md5sums=('9fc4c49d917fa6319a266438d9f313df')
16 _hroot=http://hg.dsource.org/projects/ldc
17 _hgrepo=ldc
18 _hgrev=1574
19 _strunk=http://svn.dsource.org/projects/tango/trunk
20 _svnmod=tango
21 svnrev=4699
23 build() {
24         cd $srcdir
25         if [ -d ${_hgrepo} ]; then
26                 cd ${startdir}/src/${_hgrepo}
27                 hg pull -r${_hgrev} -u
28         else
29                 hg clone -r${_hgrev} ${_hroot}/${_hgrepo} || return 1
30         fi
32         cd $srcdir
34         svn export --force ${_strunk} ${_hgrepo}/${_svnmod} -r${svnrev} || return 1
36         cd ${startdir}/src/${_hgrepo}
37         
38         cmake -DCMAKE_CXX_FLAGS:string=-DLLVM_REV=72227 -DCMAKE_INSTALL_PREFIX=/usr .
39         make
41         # install ldc binary
42         install -d -m755 $startdir/pkg/usr/bin
43         install -m755 $startdir/src/${_hgrepo}/bin/ldc $startdir/pkg/usr/bin
45         # install ldc.conf
46 #       install -d -m755 $startdir/pkg/etc
47 #       install -m755 $startdir/ldc.conf $startdir/pkg/etc
49         install -d -m755 $startdir/pkg/usr/etc
50         install -m755 $startdir/ldc.conf $startdir/pkg/usr/etc
52         export PATH=$startdir/src/ldc/bin:$PATH
54 #       make patch
55         
56         cp -r $startdir/src/ldc/runtime/internal/ldc $startdir/src/ldc/tango
57         cp -r $startdir/src/ldc/runtime/import/ldc/* $startdir/src/ldc/tango/ldc
59 #       make runtime
61         cd tango/lib
63         ./build-ldc.sh
65         ./build-tango.sh --debug --verbose ldc
67         install -d -m755 $startdir/pkg/usr/include/d/tango
69         cp -r $startdir/src/ldc/runtime/internal/ldc $startdir/pkg/usr/include/d/tango/
70         cp -r $startdir/src/ldc/runtime/import/ldc/* $startdir/pkg/usr/include/d/tango/ldc
71         cp -r $startdir/src/ldc/tango/{object.di,tango,std} $startdir/pkg/usr/include/d/tango
73         install -d -m755 $startdir/pkg/usr/include/d/tango/lib
75         cp -r $startdir/src/ldc/tango/lib/common $startdir/pkg/usr/include/d/tango/lib
77         install -d -m755 $startdir/pkg/usr/lib
79         cp $startdir/src/ldc/tango/lib/libtango-base-ldc.a $startdir/pkg/usr/lib
80         cp $startdir/src/ldc/tango/lib/libtango-user-ldc.a $startdir/pkg/usr/lib
82         install -Dm755 $startdir/src/ldc/ldc-posix-tango $startdir/pkg/etc/rebuild/ldc-posix-tango