Gentoo Archives: gentoo-dev

From: Alexandre Rostovtsev <tetromino@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] New eclass: oasis.eclass for oasis-based ocaml packages.
Date: Fri, 23 Mar 2012 17:10:23
Message-Id: 1332522577.28660.22.camel@rook
In Reply to: Re: [gentoo-dev] New eclass: oasis.eclass for oasis-based ocaml packages. by Mike Gilbert
1 On Fri, 2012-03-23 at 12:50 -0400, Mike Gilbert wrote:
2 > On Fri, Mar 23, 2012 at 12:02 PM, Ciaran McCreesh
3 > <ciaran.mccreesh@××××××××××.com> wrote:
4 > > On Fri, 23 Mar 2012 11:58:47 -0400
5 > > Mike Gilbert <floppym@g.o> wrote:
6 > >> > oasis_src_compile() {
7 > >> > oasis_src_compile_no_doc
8 > >> > if has doc ${IUSE} && use doc; then
9 > >> > ocaml setup.ml -doc || die
10 > >> > fi
11 > >> > }
12 > >>
13 > >> This should probably call use_if_iuse from eutils.eclass, which
14 > >> handles IUSE="[+-]doc".
15 > >
16 > > Actually, neither way works. The spec says:
17 > >
18 > > Global variables must only contain invariant values
19 > > (see~\ref{sec:metadata-invariance}). If a global variable's value is
20 > > invariant, it may have the value that would be generated at any
21 > > given point in the build sequence.
22 > >
23 > > So you can't rely upon IUSE having the "merged" value in an eclass.
24 > >
25 >
26 > use_if_iuse is called from functions in several eclasses already in
27 > the tree. See chromium, kde4-base, qt4-build, and toolchain.
28 >
29 > Are all of these usages incorrect? Do you have an alternate solution?
30
31 By my count, there are already at least 19 eclasses in the tree that
32 access an ebuild's IUSE from eclass code (autotools-utils, chromium,
33 clutter, db, enlightenment, eutils, gnome2, gnome-python-common,
34 java-ant-2, java-pkg-2, java-utils-2, mozconfig-3, pam, qt4-build,
35 qt4-r2, ruby-ng, xfconf, x-modular, and xorg-2).
36
37 -Alexandre Rostovtsev.

Replies