1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit eutils multilib flag-o-matic
11 DESCRIPTION="Digital Mars D Compiler"
12 HOMEPAGE="http://www.digitalmars.com/d/"
13 SRC_URI="http://ftp.digitalmars.com/${MY_P}.zip"
15 # License doesn't allow redistribution
22 DEPEND="sys-apps/findutils
29 # remove unnecessary files
30 rm -r freebsd html osx linux/lib/* \
31 linux/bin/{README.TXT,dmd,dmd.conf} windows \
32 samples README.TXT license.txt || die "something went wrong"
36 # patch for slot-compatibility
37 epatch "${FILESDIR}/slot-compat.patch"
39 epatch "${FILESDIR}/${P}-makefile.patch"
41 epatch "${FILESDIR}/stackelf.patch"
43 append-ldflags $(no-as-needed)
51 cp dmd idgen impcnvgen optabgen "${S}"/linux/bin || die "failed"
52 fperms guo=rx ../../linux/bin/dmd
56 # zlib 1.2.5 will be statically linked
57 emake -j1 -f linux.mak "DMD="${S}"/linux/bin/dmd"
58 cp libphobos.a "${S}"/linux/lib || die "failed"
61 emake -f linux.mak clean
62 find "${S}" \( -name "*.c" -o -name "*.h" -o -name "*.mak" -o -name "*.txt" \
63 -o -name "*.obj" -o -name "*.ddoc" -o -name "*.asm" \) -exec rm -v {} \; || die "failed"
68 dolib.a linux/lib/libphobos.a
70 # Install dmd compiler
71 newbin linux/bin/dmd dmd1
74 cat > dmd1.conf << END
76 DFLAGS=-I/usr/include/phobos1 -L-L/usr/$(get_libdir)
82 insinto /usr/include/phobos1
86 newman man/man1/dmd.1 dmd1.1
87 newman man/man1/dmd.conf.5 dmd1.conf.5
90 doman man/man1/dumpobj.1
91 doman man/man1/obj2asm.1
95 dobin linux/bin/{dumpobj,obj2asm,rdmd}
101 ewarn "DMD1 uses "dmd1.conf", not "dmd.conf"! "