# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils flag-o-matic versionator major=$(get_version_component_range 1) type=`expr match $(get_version_component_range 2) '\([a-z]*\)'` minor=`expr match $(get_version_component_range 2) '[a-z]*\([0-9]*\)'` MY_P="MetaOCaml_${major}_${type}_${minor}" DESCRIPTION="A compiled, type-safe, multi-stage programming language" HOMEPAGE="http://www.metaocaml.org/" SRC_URI="http://www.metaocaml.org/dist/old/${MY_P}.tar.gz" LICENSE="QPL-1.0 GPL-2-with-linking-exception" SLOT="0" KEYWORDS="~x86" IUSE="ncurses tcltk threads native" RESTRICT="nostrip" DEPEND="virtual/libc ncurses? ( >=sys-libs/ncurses-5.4-r6 ) tcltk? ( >=dev-lang/tk-8.4.9 ) !dev-lang/ocaml" PROVIDE="dev-lang/ocaml" S=${WORKDIR}/${MY_P} src_compile() { filter-flags "-fstack-protector" replace-flags "-O?" -O2 local myconf if use !ncurses; then myconf="${myconf} -no-curses" fi if use !tcltk; then myconf="${myconf} -no-tk" fi if use threads; then myconf="${myconf} -with-pthread" else myconf="${myconf} -no-pthread" fi ./configure \ ${myconf} \ -host ${CHOST} \ -prefix /usr \ -bindir /usr/bin \ -libdir /usr/$(get_libdir)/ocaml \ -mandir /usr/share/man || die "./configure failed" sed -i -e "s/\(BYTECCCOMPOPTS=.*\)/\1 ${CFLAGS}/" config/Makefile sed -i -e "s/\(NATIVECCCOMPOPTS=.*\)/\1 ${CFLAGS}/" config/Makefile local makeOptions="-j1" emake ${makeOptions} world || die "emake world failed" emake ${makeOptions} bootstrap # If the first bootstrap fails, we try bootstrapping again # to get to a fixpoint. if [ ${?} != 0 ]; then #not at fix point... emake ${makeOptions} bootstrap || die "Second emake bootstrap failed" fi if use native; then #make world.opt does not produce metaocaml[c]; do it manually emake ${makeOptions} opt || die "emake opt failed" emake ${makeOptions} opt.opt || die "emake opt.opt failed" fi } src_install() { make BINDIR=${D}/usr/bin \ LIBDIR=${D}/usr/$(get_libdir)/ocaml \ MANDIR=${D}/usr/share/man \ install || die # removes sandbox dir from ld.conf dosed "s:${D}::g" /usr/$(get_libdir)/ocaml/ld.conf dodoc Changes INSTALL LICENSE README Upgrading }