| 1 |
# Copyright 1999-2012 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/dev-ml/findlib/findlib-1.3.2.ebuild,v 1.1 2012/06/10 20:17:01 aballier Exp $
|
| 4 |
|
| 5 |
EAPI=2
|
| 6 |
|
| 7 |
inherit multilib
|
| 8 |
|
| 9 |
RESTRICT="installsources"
|
| 10 |
|
| 11 |
DESCRIPTION="OCaml tool to find/use non-standard packages."
|
| 12 |
HOMEPAGE="http://projects.camlcity.org/projects/findlib.html"
|
| 13 |
SRC_URI="http://download.camlcity.org/download/${P}.tar.gz"
|
| 14 |
IUSE="doc +ocamlopt tk"
|
| 15 |
|
| 16 |
LICENSE="MIT"
|
| 17 |
|
| 18 |
SLOT="0"
|
| 19 |
KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd"
|
| 20 |
|
| 21 |
DEPEND=">=dev-lang/ocaml-4.00.0_alpha[ocamlopt?,tk?]"
|
| 22 |
RDEPEND="${DEPEND}"
|
| 23 |
|
| 24 |
ocamlfind_destdir="/usr/$(get_libdir)/ocaml"
|
| 25 |
stublibs="${ocamlfind_destdir}/stublibs"
|
| 26 |
|
| 27 |
src_configure() {
|
| 28 |
local myconf
|
| 29 |
use tk && myconf="-with-toolbox"
|
| 30 |
./configure -bindir /usr/bin -mandir /usr/share/man \
|
| 31 |
-sitelib ${ocamlfind_destdir} \
|
| 32 |
-config ${ocamlfind_destdir}/findlib/findlib.conf \
|
| 33 |
${myconf} || die "configure failed"
|
| 34 |
}
|
| 35 |
|
| 36 |
src_compile() {
|
| 37 |
emake all || die
|
| 38 |
if use ocamlopt; then
|
| 39 |
emake opt || die # optimized code
|
| 40 |
else
|
| 41 |
# If using bytecode we dont want to strip the binary as it would remove the
|
| 42 |
# bytecode and only leave ocamlrun...
|
| 43 |
export STRIP_MASK="*/bin/*"
|
| 44 |
fi
|
| 45 |
}
|
| 46 |
|
| 47 |
src_install() {
|
| 48 |
dodir `ocamlc -where`
|
| 49 |
|
| 50 |
emake prefix="${D}" install || die
|
| 51 |
|
| 52 |
dodir "${stublibs}"
|
| 53 |
|
| 54 |
cd "${S}/doc"
|
| 55 |
dodoc QUICKSTART README DOCINFO
|
| 56 |
use doc && dohtml -r ref-html guide-html
|
| 57 |
}
|
| 58 |
|
| 59 |
check_stublibs() {
|
| 60 |
local ocaml_stdlib=`ocamlc -where`
|
| 61 |
local ldconf="${ocaml_stdlib}/ld.conf"
|
| 62 |
|
| 63 |
if [ ! -e ${ldconf} ]
|
| 64 |
then
|
| 65 |
echo "${ocaml_stdlib}" > ${ldconf}
|
| 66 |
echo "${ocaml_stdlib}/stublibs" >> ${ldconf}
|
| 67 |
fi
|
| 68 |
|
| 69 |
if [ -z `grep -e ${stublibs} ${ldconf}` ]
|
| 70 |
then
|
| 71 |
echo ${stublibs} >> ${ldconf}
|
| 72 |
fi
|
| 73 |
}
|
| 74 |
|
| 75 |
pkg_postinst() {
|
| 76 |
check_stublibs
|
| 77 |
}
|