Gentoo Archives: gentoo-dev

From: Karl Trygve Kalleberg <karltk@g.o>
To: gentoo-dev@g.o
Subject: Re: [gentoo-dev] Ebuild programming question
Date: Wed, 20 Nov 2002 14:16:43
Message-Id: 20021120150559.15804837.karltk@gentoo.org
In Reply to: Re: [gentoo-dev] Ebuild programming question by "Johannes Ballé"
1 On Wed, 20 Nov 2002 08:52:07 +0100
2 Johannes Ballé <joba123@×××××.de> wrote:
3
4 > Am Wednesday 20 November 2002 02:15 schrieb Michael Cummings:
5 > > Check the configure script that comes with the program (assuming there
6 > > is one :) ). Usually, you can do something like (not perfect syntax,
7 >
8 > This particular package seems to have almost no configure options (I
9 > already checked that). I was asking merely because I wanted to know
10 > whether the user should get the chance to say "yes, I have gtk installed
11 > but I don't want those tools anyway" ...
12
13 If gtk is not among the useflags, you should _NOT_ build the gtk support.
14
15 > Using auto-configuration, the USE option would have no influence on
16 > building the tools or not, but only on pulling in gtk as a dependency
17 > (as far as I understand).
18
19 It is _not_ okay for a package's build script to automatically detect and
20 depend on gtk only if it is installed.
21
22 If your package depends on gtk, it must be in the DEPEND (and possibly
23 also RDEPEND, unless DEPEND == RDEPEND) env var.
24
25 If your package can build without gtk, you must heed the gtk useflag; ie,
26 turn off gtk support altogether if gtk is not among the current useflags.
27
28
29 The big problem with hidden deps that are pulled automatically, and that
30 Portage doesn't know about, is that it that users may do "emerge -eop
31 world | grep gtk", and see that no packages seem to depend of gtk. Then
32 they happily remove gtk+ from their system and things start breaking...
33
34 A real life story: I have USE="-opengl" in my /etc/make.conf, but I have
35 OpenGL headers and libraries installed. I installed qt-3.1.0, which
36 decided that I had OpenGL, so it compiled in support for it. I removed the
37 OpenGL libraries for a while (driver transition), and qt apps started
38 breaking mysteriously. Now qt-3.1.0 has an opengl useflag which it adheres
39 to, and things have stopped breaking mysteriously.
40
41
42 In general, the idiom wrt any given useflag is:
43
44 use foo && myconf="${myconf} --with-foo" || myconf="${myconf}
45 --without-foo"
46
47 Ie, you should _ALWAYS_ turn on or off foo-support explicitly in your
48 ebuild. Don't rely on the configure script's defaults, because:
49
50 1) Usually if you don't specify --with-foo or --without-foo, it is
51 auto-detected. This is bad for the reasons I stated above.
52 2) Sometimes, --without-foo or --with-foo is the default, but the default
53 may change with the next release of the package, and then you're going to
54 have to rewrite the ebuild, which nobody bothers doing, so it makes sense
55 to get it right the first time around.
56
57
58 Kind regards,
59
60 Karl T
61
62 --
63 gentoo-dev@g.o mailing list

Replies

Subject Author
Re: [gentoo-dev] Ebuild programming question "Johannes Ballé" <joba123@×××××.de>