# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils MY_P=${P/0./} MY_P=${MY_P/-/.} DESCRIPTION="Digital Mars D Programming Language Compiler" HOMEPAGE="http://www.digitalmars.com/d/" SRC_URI="http://ftp.digitalmars.com/${MY_P}.zip" LICENSE="DMD" RESTRICT="nomirror" SLOT="${PV}" KEYWORDS="~amd64 ~x86" IUSE="" MY_D="/opt/dmd/${SLOT}" S="${WORKDIR}/${PM}" RDEPEND="virtual/libc sys-devel/gcc amd64? ( app-emulation/emul-linux-x86-compat )" DEPEND="${RDEPEND} sys-apps/findutils" src_unpack() { unpack ${A} # remove Windows files rm -r ${S}/dm rm ${S}/dmd/lib/*.LIB ${S}/dmd/lib/*.lib rm ${S}/dmd/bin/*.exe ${S}/dmd/bin/sc.ini rm ${S}/dmd/bin/*.dll rm ${S}/dmd/bin/windbg.hlp } src_install() { cd ${S}/dmd # cleanup line ends edos2unix `find . -name '*.c' -type f` edos2unix `find . -name '*.d' -type f` edos2unix `find . -name '*.ddoc' -type f` edos2unix `find . -name '*.h' -type f` edos2unix `find . -name '*.mak' -type f` edos2unix `find . -name '*.txt' -type f` edos2unix `find samples -name '*.html' -type f` # configuration cat < bin/dmd.conf [Environment] DFLAGS=-I${MY_D}/src/phobos EOF # bypass broken dmd.conf search # http://d.puremagic.com/issues/show_bug.cgi?id=278 mv bin/dmd bin/dmd-${PV}.bin cat < "bin/dmd-${PV}" #!/bin/sh ${MY_D}/bin/dmd-${PV}.bin -I${MY_D}/src/phobos -L-L${MY_D}/lib \$* EOF # fix permissions fperms guo=r `find . -type f` fperms guo=rx bin/dmd-${PV}* bin/dumpobj bin/obj2asm bin/rdmd fperms guo=rx `find . -type d` # documentation dodoc license.txt dodoc src/phobos/phoboslicense.txt dodoc html/d/changelog.html dodoc html/d/changelog1.html doman man/man1/dmd.1 doman man/man1/dumpobj.1 doman man/man1/obj2asm.1 # install dodir ${MY_D} cp -pRf ${S}/dmd/* ${D}${MY_D} dodir /usr/bin dosym ${MY_D}/bin/dmd-${PV} ${MY_D}/bin/dmd dosym ${MY_D}/bin/dmd-${PV} /usr/bin/dmd-${SLOT} }