/[gentoo-x86]/eclass/findlib.eclass
Gentoo

Diff of /eclass/findlib.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.2 Revision 1.11
1# Copyright 1999-2004 Gentoo Foundation 1# Copyright 1999-2011 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/findlib.eclass,v 1.2 2004/08/24 14:32:56 mattam Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/findlib.eclass,v 1.11 2011/08/22 04:46:31 vapier Exp $
4# 4
5# @ECLASS: findlib.eclass
6# @MAINTAINER:
7# ml@gentoo.org
8# @AUTHOR:
5# Author : Matthieu Sozeau <mattam@gentoo.org> 9# Original author: Matthieu Sozeau <mattam@gentoo.org> (retired)
6# 10# @BLURB: ocamlfind (a.k.a. findlib) eclass
11# @DESCRIPTION:
7# ocamlfind (a.k.a. findlib) eclass 12# ocamlfind (a.k.a. findlib) eclass
8#
9 13
10ECLASS="findlib" 14
11INHERITED="$INHERITED $ECLASS"
12 15
13# From this findlib version there is proper stublibs support. 16# From this findlib version there is proper stublibs support.
14DEPEND=">=dev-ml/findlib-1.0.4-r1" 17DEPEND=">=dev-ml/findlib-1.0.4-r1"
18[[ ${FINDLIB_USE} ]] && DEPEND="${FINDLIB_USE}? ( ${DEPEND} )"
15 19
16check_ocamlfind() { 20check_ocamlfind() {
17 if [ ! -x /usr/bin/ocamlfind ] 21 if [ ! -x "${EPREFIX}"/usr/bin/ocamlfind ]
18 then 22 then
19 ewarn "In findlib.eclass: could not find the ocamlfind executable" 23 eerror "In findlib.eclass: could not find the ocamlfind executable"
20 ewarn "Please report this bug on gentoo's bugzilla, assigning to ml@gentoo.org" 24 eerror "Please report this bug on gentoo's bugzilla, assigning to ml@gentoo.org"
21 exit 1 25 die "ocamlfind executabled not found"
22 fi 26 fi
23} 27}
24 28
29# @FUNCTION: findlib_src_preinst
30# @DESCRIPTION:
25# Prepare the image for a findlib installation. 31# Prepare the image for a findlib installation.
26# We use the stublibs style, so no ld.conf needs to be 32# We use the stublibs style, so no ld.conf needs to be
27# updated when a package installs C shared libraries. 33# updated when a package installs C shared libraries.
28findlib_src_preinst() { 34findlib_src_preinst() {
35 has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
36 has "${EAPI:-0}" 0 1 2 && use !prefix && ED="${D}"
29 check_ocamlfind 37 check_ocamlfind
30 38
31 # destdir is the ocaml sitelib 39 # destdir is the ocaml sitelib
32 local destdir=`ocamlfind printconf destdir` 40 local destdir=`ocamlfind printconf destdir`
33 41
42 # strip off prefix
43 destdir=${destdir#${EPREFIX}}
44
34 dodir ${destdir} || die "dodir failed" 45 dodir ${destdir} || die "dodir failed"
35 export OCAMLFIND_DESTDIR=${D}${destdir} 46 export OCAMLFIND_DESTDIR=${ED}${destdir}
36 47
37 # stublibs style 48 # stublibs style
38 dodir ${destdir}/stublibs || die "dodir failed" 49 dodir ${destdir}/stublibs || die "dodir failed"
39 export OCAMLFIND_LDCONF=ignore 50 export OCAMLFIND_LDCONF=ignore
40} 51}
41 52
53# @FUNCTION: findlib_src_install
54# @DESCRIPTION:
42# Install with a properly setup findlib 55# Install with a properly setup findlib
43findlib_src_install() { 56findlib_src_install() {
44 findlib_src_preinst 57 findlib_src_preinst
45 make DESTDIR=${D} "$@" install || die "make failed" 58 make DESTDIR="${D}" "$@" install || die "make failed"
46} 59}

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.11

  ViewVC Help
Powered by ViewVC 1.1.20