--- geneweb-5.00.ebuild 2007-08-28 19:23:02.000000000 +0200 +++ geneweb-5.01.ebuild 2008-01-02 20:36:39.000000000 +0100 @@ -4,6 +4,8 @@ inherit eutils +EAPI="1" + DESCRIPTION="Genealogy software program with a Web interface." HOMEPAGE="http://cristal.inria.fr/~ddr/GeneWeb/" SRC_URI="ftp://ftp.inria.fr/INRIA/Projects/cristal/${PN}/Src/${P}.tgz" @@ -11,18 +13,40 @@ LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~x86" -IUSE="" +IUSE="+ocamlopt" + +DEPEND="dev-lang/ocaml + dev-ml/camlp5" -DEPEND="dev-lang/ocaml" +pkg_setup() { + if use ocamlopt && ! built_with_use --missing true dev-lang/ocaml ocamlopt; then + eerror "In order to build ${PN} with native code support from ocaml" + eerror "You first need to have a native code ocaml compiler." + eerror "You need to install dev-lang/ocaml with ocamlopt useflag on." + die "Please install ocaml with ocamlopt useflag" + fi +} src_unpack() { unpack ${A} cd "${S}" - epatch "${FILESDIR}"/${P}-gentoo.patch + epatch "${FILESDIR}"/${PN}-5.00-gentoo.patch sed -i -e "s:@GENTOO_DATADIR@:/usr/share/${PN}:" \ setup/setup.ml || die "Failed sed for gentoo path" } +src_compile() { + econf + if use ocamlopt; then + emake || die "Compiling native code executables failed" + else + emake OCAMLC="ocamlc" out || die "Compiling native code executables failed" + # If using bytecode we dont want to strip the binary as it would remove the + # bytecode and only leave ocamlrun... + export STRIP_MASK="*/bin/*" + fi +} + src_install() { # Install binaries dobin src/{consang,check_base,gwc,gwd,gwu} \