summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMatthieu Sozeau <mattam@gentoo.org>2004-08-21 18:09:03 +0000
committerMatthieu Sozeau <mattam@gentoo.org>2004-08-21 18:09:03 +0000
commitdbd6aa57bfac05315fbcc7b4e9c9cd5fb89f6448 (patch)
treeaaae9fd2851fde4e0eed79757cc812c987e33cb4 /eclass
parentfix orbit deps (Manifest recommit) (diff)
downloadgentoo-2-dbd6aa57bfac05315fbcc7b4e9c9cd5fb89f6448.tar.gz
gentoo-2-dbd6aa57bfac05315fbcc7b4e9c9cd5fb89f6448.tar.bz2
gentoo-2-dbd6aa57bfac05315fbcc7b4e9c9cd5fb89f6448.zip
Initial import
Diffstat (limited to 'eclass')
-rw-r--r--eclass/findlib.eclass46
1 files changed, 46 insertions, 0 deletions
diff --git a/eclass/findlib.eclass b/eclass/findlib.eclass
new file mode 100644
index 000000000000..d5e990439bc5
--- /dev/null
+++ b/eclass/findlib.eclass
@@ -0,0 +1,46 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/eclass/findlib.eclass,v 1.1 2004/08/21 18:09:03 mattam Exp $
+#
+# Author : Matthieu Sozeau <mattam@gentoo.org>
+#
+# ocamlfind (a.k.a. findlib) eclass
+#
+
+ECLASS="findlib"
+INHERITED="$INHERITED $ECLASS"
+
+# From this findlib version there is proper stublibs support.
+DEPEND=">=dev-ml/findlib-1.0.4-r1"
+
+check_ocamlfind() {
+ if [ ! -x /usr/bin/ocamlfind ]
+ then
+ ewarn "In findlib.eclass: could not find the ocamlfind executable"
+ ewarn "Please report this bug on gentoo's bugzilla, assigning to ml@gentoo.org"
+ exit 1
+ fi
+}
+
+# Prepare the image for a findlib installation.
+# We use the stublibs style, so no ld.conf needs to be
+# updated when a package installs C shared libraries.
+findlib_src_preinst() {
+ check_ocamlfind
+
+ # destdir is the ocaml sitelib
+ local destdir=`ocamlfind printconf destdir`
+
+ dodir ${destdir}
+ export OCAMLFIND_DESTDIR=${D}${destdir}
+
+ # stublibs style
+ dodir ${destdir}/stublibs
+ export OCAMLFIND_LDCONF=ignore
+}
+
+# Install with a properly setup findlib
+findlib_src_install() {
+ findlib_src_preinst
+ make DESTDIR=${D} "$@" install
+}