From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12415 invoked by uid 1002); 20 Nov 2002 14:16:43 -0000 Mailing-List: contact gentoo-dev-help@gentoo.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@gentoo.org Received: (qmail 12406 invoked from network); 20 Nov 2002 14:16:43 -0000 Date: Wed, 20 Nov 2002 15:05:59 +0100 From: Karl Trygve Kalleberg To: gentoo-dev@gentoo.org Message-Id: <20021120150559.15804837.karltk@gentoo.org> In-Reply-To: <200211200852.07995.joba123@arcor.de> References: <200211200132.40258.joba123@arcor.de> <20021120011536.GA10585@datanode.net> <200211200852.07995.joba123@arcor.de> Organization: Gentoo Technologies, Inc X-Mailer: Sylpheed version 0.8.5 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [gentoo-dev] Ebuild programming question X-Archives-Salt: 6a0a30b1-7da1-4dec-9f89-b11bb58805ca X-Archives-Hash: 0f64a8879c48d3c4569ef45e3853722b On Wed, 20 Nov 2002 08:52:07 +0100 Johannes Ball=E9 wrote: > Am Wednesday 20 November 2002 02:15 schrieb Michael Cummings: > > Check the configure script that comes with the program (assuming ther= e > > is one :) ). Usually, you can do something like (not perfect syntax, >=20 > 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 installe= d > but I don't want those tools anyway" ... If gtk is not among the useflags, you should _NOT_ build the gtk support.= =20 > 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.=20 If your package depends on gtk, it must be in the DEPEND (and possibly also RDEPEND, unless DEPEND =3D=3D 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=3D"-opengl" in my /etc/make.conf, but I hav= e 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 th= e OpenGL libraries for a while (driver transition), and qt apps started breaking mysteriously. Now qt-3.1.0 has an opengl useflag which it adhere= s to, and things have stopped breaking mysteriously. In general, the idiom wrt any given useflag is: use foo && myconf=3D"${myconf} --with-foo" || myconf=3D"${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