1 # Maintainer: Zenja Ivkovic <izenja@gmail.com> aka izenja
3 true && pkgname=('dmd2-git' 'druntime-git' 'libphobos2-git')
7 url="http://www.digitalmars.com/d/2.0/"
10 options=('!strip' 'docs')
12 _gitroot=("git://github.com/D-Programming-Language/dmd.git" "git://github.com/D-Programming-Language/druntime.git" "git://github.com/D-Programming-Language/phobos.git")
13 _gitname=('dmd' 'druntime' 'phobos')
15 if [ $CARCH = 'x86_64' ] ; then
18 if [ $CARCH = 'i686' ] ; then
24 msg "Retrieving from repository: dmd"
25 if [ -d ${_gitname[0]} ] ; then
26 cd ${_gitname[0]} && git pull origin
28 git clone ${_gitroot[0]} ${_gitname[0]}
32 msg "Retrieving from repository: druntime"
33 if [ -d ${_gitname[1]} ] ; then
34 cd ${_gitname[1]} && git pull origin
36 git clone ${_gitroot[1]} ${_gitname[1]}
40 msg "Retrieving from repository: phobos"
41 if [ -d ${_gitname[2]} ] ; then
42 cd ${_gitname[2]} && git pull origin
44 git clone ${_gitroot[2]} ${_gitname[2]}
48 rm -rf "$srcdir/${_gitname[0]}-build"
49 git clone "$srcdir/${_gitname[0]}" "$srcdir/${_gitname[0]}-build"
50 cd "$srcdir/${_gitname[0]}-build/src"
51 make -f posix.mak MODEL=$archstr
54 rm -rf "$srcdir/${_gitname[1]}-build"
55 git clone "$srcdir/${_gitname[1]}" "$srcdir/${_gitname[1]}-build"
56 cd "$srcdir/${_gitname[1]}-build"
57 # stacktrace.d fails to compile on 64 bit, at least for me, and probably pointless to have on linux anyway
58 patch posix.mak <<-'ENDPATCH'
60 < src/core/sys/windows/stacktrace.d \
62 < $(IMPDIR)/core/sys/windows/stacktrace.di \
64 PATH="$srcdir/${_gitname[0]}-build/src:$PATH" make -f posix.mak MODEL=$archstr
67 rm -rf "$srcdir/${_gitname[2]}-build"
68 git clone "$srcdir/${_gitname[2]}" "$srcdir/${_gitname[2]}-build"
69 cd "$srcdir/${_gitname[2]}-build"
70 # phobos' makefile tries to make ../druntime - make that the build directory we use
71 patch posix.mak <<-ENDPATCH
73 < DRUNTIME_PATH = ../druntime
75 > DRUNTIME_PATH = ../${_gitname[1]}-build
77 PATH="$srcdir/${_gitname[0]}-build/src:$PATH" make -f posix.mak MODEL=$archstr
81 provides=("dmd2" "d-compiler")
83 cd "$srcdir/${_gitname[0]}-build/src"
86 install -Dm755 ./dmd $pkgdir/usr/bin/dmd
87 echo -e "[Environment]\nDFLAGS=-m$archstr -I/usr/include/d -I/usr/include/d/druntime/import -L-L/usr/lib -L-lrt" > $srcdir/dmd.conf
88 install -Dm644 $srcdir/dmd.conf $pkgdir/etc/dmd.conf
90 msg "Packaging dmd man files"
91 cd "$srcdir/${_gitname[0]}-build/docs/man/man1"
93 install -Dm644 $x "$pkgdir/usr/share/man/man1/$(basename $x)"
96 install -Dm644 $x "$pkgdir/usr/share/man/man5/$(basename $x)"
100 package_druntime-git() {
101 provides=("druntime")
102 conflicts=("druntime")
103 msg "Packaging druntime"
105 install -Dm644 $srcdir/${_gitname[1]}-build/lib/libdruntime.a $pkgdir/usr/lib/libdruntime.a
106 mkdir -p $pkgdir/usr/include/d/druntime
107 cp -Rf $srcdir/${_gitname[1]}-build/import $pkgdir/usr/include/d/druntime
110 package_libphobos2-git() {
111 provides=("libphobos2")
112 conflicts=("libphobos2" "libtango")
113 msg "Packaging phobos"
115 cd "$srcdir/${_gitname[2]}-build"
116 install -Dm644 ./generated/linux/release/$archstr/libphobos2.a $pkgdir/usr/lib/libphobos2.a
117 mkdir -p $pkgdir/usr/include/d
118 cp -Rf std $pkgdir/usr/include/d
119 cp -Rf etc $pkgdir/usr/include/d
120 cp -f {crc32,index,unittest}.d $pkgdir/usr/include/d
123 pkgdesc="Digital Mars D compiler, runtime and standard library (git master branch)"