5 pkgdesc="Runtime library for the D programming language including libphobos, compiled from source"
7 url="http://www.digitalmars.com/d/1.0/"
8 install="${mypkgname}.install"
9 source=(http://ftp.digitalmars.com/dmd.${pkgver}.zip
13 noextract="dmd.${pkgver}.zip"
17 conflicts=('libtango1' 'dmd1' 'libphobos1')
18 provides=('dmd1' 'libphobos1')
19 md5sums=('fd2c3f8dd46d0fe4597e9d96b4ab86b2'
20 'e1154aeeb871b12cb59c76cfe207ab2e'
21 '452824c5c619c637775dc81bfa245f9c'
22 '48d97c5d156caf6012250a5e096cb107')
27 # bsdtar fails, unpack using unzip
28 unzip dmd.${pkgver}.zip
31 patch -p0 -i "${srcdir}"/stackelf.patch || return 1
32 patch -p0 -i "${srcdir}"/makefile.patch || return 1
33 patch -p0 -i "${srcdir}"/slotcompat.patch || return 1
35 # remove unnecessary files
37 rm -r freebsd html osx linux/lib/* \
38 linux/bin/{README.TXT,dmd,dmd.conf} windows \
39 samples README.TXT || return 1
44 # filer out --as-needed
45 export LDFLAGS="${LDFLAGS//-Wl,--as-needed}"
46 export LDFLAGS="${LDFLAGS//,--as-needed}"
47 export LDFLAGS="${LDFLAGS//--as-needed}"
50 cd "${srcdir}"/dmd/src/dmd
51 make -f linux.mak || return 1
52 cp dmd idgen impcnvgen optabgen "${srcdir}"/dmd/linux/bin || return 1
53 chmod +x ../../linux/bin/dmd
56 cd "${srcdir}"/dmd/src/phobos
57 # zlib 1.2.5 will be statically linked
58 make -j1 -f linux.mak "DMD="${srcdir}"/dmd/linux/bin/dmd" || return 1
59 cp libphobos.a "${srcdir}"/dmd/linux/lib || return 1
62 cd "${srcdir}"/dmd/src/dmd
63 make -f linux.mak clean
64 find "${srcdir}"/dmd \( -name "*.c" -o -name "*.h" -o -name "*.mak" \
65 -o -name "*.obj" -o -name "*.ddoc" -o -name "*.asm" \) -exec rm -v {} \; || return 1
74 install -Dm644 "${srcdir}"/dmd/linux/lib/libphobos.a "${pkgdir}"/usr/lib/libphobos.a
77 install -Dm755 "${srcdir}"/dmd/linux/bin/dmd "${pkgdir}"/usr/bin/dmd
78 install -Dm755 "${srcdir}"/dmd/linux/bin/dumpobj "${pkgdir}"/usr/bin/dumpobj
79 install -Dm755 "${srcdir}"/dmd/linux/bin/obj2asm "${pkgdir}"/usr/bin/obj2asm
80 install -Dm755 "${srcdir}"/dmd/linux/bin/rdmd "${pkgdir}"/usr/bin/rdmd
84 cat > dmd1.conf << END
86 DFLAGS=-I/usr/include/d -L-L/usr/lib
88 install -Dm644 "${srcdir}"/dmd/dmd1.conf "${pkgdir}"/etc/dmd1.conf
91 install -d "${pkgdir}"/usr/include/d
92 cd "${srcdir}"/dmd/src/phobos
93 cp -Rf std "${pkgdir}"/usr/include/d
94 cp -Rf etc "${pkgdir}"/usr/include/d
95 cp -Rf internal "${pkgdir}"/usr/include/d
96 cp -f {crc32,object,gcstats}.d "${pkgdir}"/usr/include/d
98 # Get rid of this subdirectory; it's just an unpacked zlib source
100 rm -rf "${pkgdir}"/usr/include/d/etc/c/zlib
102 # Insure that files and directories under /usr/include/d have
103 # correct permissions.
104 find "${pkgdir}/usr/include/d" -type d -print0 |xargs -0 chmod 755
105 find "${pkgdir}/usr/include/d" -type f -print0 |xargs -0 chmod 644
106 install -Dm644 "${srcdir}"/dmd/license.txt "${pkgdir}"/usr/share/licenses/${mypkgname}/LICENSE
109 for x in "${srcdir}"/dmd/man/man1/*.1; do
110 install -Dm644 "$x" "$pkgdir/usr/share/man/man1/$(basename "$x")" || return 1
113 for x in "${srcdir}"/dmd/man/man1/*.5; do
114 install -Dm644 "$x" "$pkgdir/usr/share/man/man5/$(basename "$x")" || return 1