Subject: Re: Consistent "Optional Dependecy" handling
To: Nate Hill <vugdeox@freeshell.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-pkg
Date: 07/31/2003 15:12:09
On Thu, 31 Jul 2003, Nate Hill wrote:

> I find it humorous that kdegraphics is the only package depending on
> GTK+ on my entire system. Is there a consistent way to disable use of
> GTK+ in packages which do not _require_ it? For instance can I set
> something like USE_GTK=YES|NO or PREFER_GTK2=YES|NO in mk.conf?

This depends if the pkgsrc maintainer has provided an option variable do
do this.

The options should be all listed in pkgsrc/mk/bsd.pkg.defaults.mk.

There is not a USE_GTK defined there. There are a few package specific
variables though: BITCHX_WITH_GTK, LAME_USE_GTK, and PILRC_USE_GTK.

Another way it is done is by having separate packages, for example, see:
chat/gaim-gtk1
comms/efax-gtk
editors/vim-gtk
editors/vim-gtk2
games/freeciv-client-gtk
graphics/libexif-gtk
net/firewalk-gtk
net/mtr-gtk
time/asclock-gtk
wip/nvtv-gtk2
x11/asclock-gtk

I agree it would be good to have a "USE_GTK" variable.

There is similiar ideas already used by various packages, like: USE_CUPS,
USE_IDEA, USE_INET6, USE_INN, USE_LIBCRACK, USE_MMX, USE_OPENLDAP,
USE_OSS, USE_PAM, and more.

(I do see some naming problems; variables that start with "USE_" should
apply to a variety of packages, but I see that bsd.pkg.defaults.mk has
notes for USE_CRYPTO, USE_DB2, USE_GIF, USE_I586, and a few others that
appear to be that they are specific for one single package each. If that
is true, they should be renamed, like XEMACS_USE_XFACE or GNUPG_USE_I586.)

> Another example is kdepim which currently requires pilot-link-libs, I
> know that it can be built without this library and without the KPilot
> tool.
>
> Anyways, I'm looking for something similar to Gentoo's "USE Flags"
> system...

Can you describe that Gentoo feature?

Maybe someone will soon work on the OpenBSD-like "flavours" feature. Where
one pkgsrc can be used to multiple binary packages.

   Jeremy C. Reed
   http://www.reedmedia.net/