# Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/dev-lang/dmd-bin/dmd-bin-2.008-r1.ebuild,v 1.2 2008/03/22 17:51:23 coldwind Exp $ inherit eutils MY_P=${P/-bin/} MY_P=${MY_P/-/.} DESCRIPTION="Digital Mars D Compiler" HOMEPAGE="http://www.digitalmars.com/d/" SRC_URI="http://ftp.digitalmars.com/${MY_P}.zip" LICENSE="DMD" RESTRICT="mirror strip" SLOT="0" KEYWORDS="~amd64 ~x86" LOC="/opt/dmd" S="${WORKDIR}/dmd" DEPEND="sys-apps/findutils app-arch/unzip" RDEPEND="amd64? ( app-emulation/emul-linux-x86-compat ) x86? ( sys-libs/libstdc++-v3 )" src_unpack() { unpack "${A}" # Cleanup line endings cd "${S}" # Fix permissions and clean up fperms ug=rw `find . -type f` fperms ug=rwx `find . -type d` fperms ug=rwx bin/dmd bin/dumpobj bin/obj2asm bin/rdmd 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` sed -i -e "s:DMD=.*:DMD=${S}/bin/dmd:" `find . -name '*.mak' -type f` sed -i -e "s:CC=.*:CC=gcc -m32:" `find . -name '*.mak' -type f` sed -i -e "s:CFLAGS=.*:CFLAGS=${CFLAGS}:" `find . -name '*.mak' -type f` } src_compile() { # Can't use emake, customized build system make -C "${S}/src/phobos" -f linux.mak } src_install() { # Setup dmd.conf cat < "bin/dmd.conf" [Environment] DFLAGS=-I/opt/dmd/src/phobos -L/opt/dmd/lib END insinto /etc doins bin/dmd.conf # Man pages for file in man/man1/* ; do doman "${file}" done # Documentation dohtml html/d/* html/d/phobos/* # Install exeinto /opt/dmd/bin doexe bin/dmd doexe bin/dumpobj doexe bin/obj2asm doexe bin/rdmd insinto /opt/dmd/lib doins src/phobos/libphobos2.a insinto /opt/dmd/samples for file in samples/d/* ; do doins "${file}" done insinto /opt/dmd/samples/mydll for file in samples/d/mydll/* ; do doins "${file}" done # Set PATH doenvd "${FILESDIR}/25dmd" } pkg_postinst () { ewarn "You may need to run: " ewarn "env-update && source /etc/profile " ewarn "to be able to use the compiler immediately. " einfo " " einfo "The bundled samples and sources may be found in " einfo "/opt/dmd/samples and /opt/dmd/src respectively. " einfo " " }