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

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

  ViewVC Help
Powered by ViewVC 1.1.20