# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils DESCRIPTION="Standard ML optimizing compiler and libraries" SRC_URI="!binary? ( http://mlton.org/pages/Download/attachments/${P}-1.src.tgz ) http://mlton.org/pages/Download/attachments/mlton-${PV}-1.${ARCH}-linux.tgz" HOMEPAGE="http://www.mlton.org" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="binary doc" DEPEND="virtual/libc dev-libs/gmp !dev-lang/mlton-bin" # Both ebuilds share files src_compile() { if use binary; then einfo "Nothing to compile." else # changing mlton paths to match the temporary binary mlton epatch "${FILESDIR}"/makefile-benchmark-${PV}.patch epatch "${FILESDIR}"/makefile-front-end-${PV}.patch epatch "${FILESDIR}"/makefile-mllex-${PV}.patch epatch "${FILESDIR}"/makefile-mlnlffigen-${PV}.patch epatch "${FILESDIR}"/makefile-mlprof-${PV}.patch epatch "${FILESDIR}"/makefile-mlton-${PV}.patch epatch "${FILESDIR}"/makefile-mlyacc-${PV}.patch epatch "${FILESDIR}"/upgrade-basis-${PV}.patch # dynamic patching needed for absolute path cp "${FILESDIR}"/${PN}-bin-${PV}.patch . sed -i -e "s&+lib='&+lib='${WORKDIR}&" ${PN}-bin-${PV}.patch epatch ${PN}-bin-${PV}.patch # Does not support parallel make emake -j1 || die fi } src_install() { if use binary; then cd ${WORKDIR}/usr dobin bin/* insinto /usr/lib/mlton cp -Rp lib/mlton/* ${D}/usr/lib/mlton doman man/man1/*.1.gz cd share/doc/mlton dodoc changelog README dodoc license/* if use doc; then cp -R cmcat examples ${D}/usr/share/doc/${P}/ dohtml user-guide/* dodoc *.ps.gz fi else emake DESTDIR=${D} install-no-docs if use doc; then make DESTDIR=${D} TDOC=${D}/usr/share/doc/${P} install-docs else cd doc && dodoc changelog license/* fi fi }