updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / dmd2 / PKGBUILD
blob5ab777340a593fda46ffd61ac487cccfe6168912
1 # Maintainer: Mihail Strashun <m.strashun@gmail.com> aka Volfram
2 pkgname=dmd2
3 pkgver=2.057
4 pkgrel=1
5 pkgdesc="The Digital Mars D compiler (D2 version)"
6 arch=('i686' 'x86_64')
7 url="http://www.digitalmars.com/d/2.0/"
8 source=(http://ftp.digitalmars.com/dmd.$pkgver.zip)
9 md5sums=('531c4b60eb002ea8abbe5c80b2eb677d')
10 provides=('d-compiler='$pkgver 'dmd2='$pkgver)
11 license=('custom')
12 options=('!strip' 'docs')
13 conflicts=('dmd2-complete' 'dmd2-bin')
14 depends=('gcc-libs')
16 if [ $CARCH = 'x86_64' ]
17 then
18         archstr="64"
21 if [ $CARCH = 'i686' ]
22 then 
23         archstr="32"
26 build() {
27    # Build and install dmd binary
28    cd $srcdir/dmd2/src/dmd 
29    make -f posix.mak MODEL=$archstr
30    install -Dm755 ./dmd $pkgdir/usr/bin/dmd 
32    oldpath=$PATH
33    export PATH=$PATH:`pwd`
35    # Copy additional tools
36    install -Dm755 $srcdir/dmd2/linux/bin$archstr/dumpobj $pkgdir/usr/bin/dumpobj 
37    install -Dm755 $srcdir/dmd2/linux/bin$archstr/obj2asm $pkgdir/usr/bin/obj2asm 
38    install -Dm755 $srcdir/dmd2/linux/bin$archstr/rdmd $pkgdir/usr/bin/rdmd 
39    echo -e "[Environment]\nDFLAGS=-m$archstr -I/usr/include/d -I/usr/include/d/druntime/import -L-L/usr/lib -L-lrt" > $startdir/dmd.conf
40    install -Dm644 $startdir/dmd.conf $pkgdir/etc/dmd.conf 
42    # Copy the license
43    install -Dm644 $srcdir/dmd2/license.txt $pkgdir/usr/share/licenses/dmd/COPYING 
45    # Copy man files   
46    for x in $srcdir/dmd2/man/man1/*.1; do
47        install -Dm644 $x "$pkgdir/usr/share/man/man1/$(basename $x)"
48    done
50    for x in $srcdir/dmd2/man/man1/*.5; do
51        install -Dm644 $x "$pkgdir/usr/share/man/man5/$(basename $x)"
52    done
54    # Copy documentation
55    mkdir -p $pkgdir/usr/share/doc/d/phobos
56    docs="$srcdir/dmd2/html/d"
57    for x in $(find $docs/*.html $docs/*.gif $docs/*.ico $docs/*.jpg $docs/*.css); do
58        install -Dm644 $x "$pkgdir/usr/share/doc/d/$(basename $x)"
59    done
61    for x in $(find $docs/phobos/*.html $docs/phobos/*.gif $docs/phobos/*.css); do
62        install -Dm644 $x "$pkgdir/usr/share/doc/d/phobos/$(basename $x)"
63    done