public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Karl Trygve Kalleberg <karltk@gentoo.org>
To: gentoo-dev@gentoo.org
Subject: Re: [gentoo-dev] Ebuild programming question
Date: Wed, 20 Nov 2002 15:05:59 +0100	[thread overview]
Message-ID: <20021120150559.15804837.karltk@gentoo.org> (raw)
In-Reply-To: <200211200852.07995.joba123@arcor.de>

On Wed, 20 Nov 2002 08:52:07 +0100
Johannes Ballé <joba123@arcor.de> wrote:

> Am Wednesday 20 November 2002 02:15 schrieb Michael Cummings:
> > Check the configure script that comes with the program (assuming there
> > is one :) ). Usually, you can do something like (not perfect syntax,
> 
> This particular package seems to have almost no configure options (I
> already checked that). I was asking merely because I wanted to know
> whether the user should get the chance to say "yes, I have gtk installed
> but I don't want those tools anyway" ...

If gtk is not among the useflags, you should _NOT_ build the gtk support. 

> Using auto-configuration, the USE option would have no influence on
> building the tools or not, but only on pulling in gtk as a dependency
> (as far as I understand).

It is _not_ okay for a package's build script to automatically detect and
depend on gtk only if it is installed. 

If your package depends on gtk, it must be in the DEPEND (and possibly
also RDEPEND, unless DEPEND == RDEPEND) env var.

If your package can build without gtk, you must heed the gtk useflag; ie,
turn off gtk support altogether if gtk is not among the current useflags.


The big problem with hidden deps that are pulled automatically, and that
Portage doesn't know about, is that it that users may do "emerge -eop
world | grep gtk", and see that no packages seem to depend of gtk. Then
they happily remove gtk+ from their system and things start breaking...

A real life story: I have USE="-opengl" in my /etc/make.conf, but I have
OpenGL headers and libraries installed. I installed qt-3.1.0, which
decided that I had OpenGL, so it compiled in support for it. I removed the
OpenGL libraries for a while (driver transition), and qt apps started
breaking mysteriously. Now qt-3.1.0 has an opengl useflag which it adheres
to, and things have stopped breaking mysteriously.


In general, the idiom wrt any given useflag is:

use foo && myconf="${myconf} --with-foo" || myconf="${myconf}
--without-foo"

Ie, you should _ALWAYS_ turn on or off foo-support explicitly in your
ebuild. Don't rely on the configure script's defaults, because:

1) Usually if you don't specify --with-foo or --without-foo, it is
auto-detected. This is bad for the reasons I stated above.
2) Sometimes, --without-foo or --with-foo is the default, but the default
may change with the next release of the package, and then you're going to
have to rewrite the ebuild, which nobody bothers doing, so it makes sense
to get it right the first time around.


Kind regards,

Karl T

--
gentoo-dev@gentoo.org mailing list


  reply	other threads:[~2002-11-20 14:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-20  0:32 [gentoo-dev] Ebuild programming question Johannes Ballé
2002-11-20  1:15 ` Michael Cummings
2002-11-20  7:52   ` Johannes Ballé
2002-11-20 14:05     ` Karl Trygve Kalleberg [this message]
2002-11-21 15:42       ` Johannes Ballé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021120150559.15804837.karltk@gentoo.org \
    --to=karltk@gentoo.org \
    --cc=gentoo-dev@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox