Subject: Re: graphics/gd with/without X11 support.
To: Juan RP <juan@xtraeme.unixbsd.org>
From: Julio M. Merino Vidal <jmmv@menta.net>
List: tech-pkg
Date: 06/10/2004 09:45:04
What's wrong with...

DEPENDS+=	gd{,-nox11}>=version

?

I guess that gd{,-nox11} could pick gd by default, while gd{-nox11,}
could pick gd-nox11.  If this works, you only need a variable to specify
the order in which the dependency is specified (i.e., GD_USE_X11=yes)
and use it from the right buildlink3.mk file.

Adding an extra mk file for just this looks like making things more
complicated...

And a question.  Why does gd need X11?  For xpm output support _only_?
If so, I think it could make more sense to make gd use no x11 at all and
create a new gd-x11 package that provides everything.  Only people
wanting xpm support (anybody?) will have to deal with setting a variable,
but the _default_ could be more sane.  (i.e., beeing able to install php
with gd in a server without X, a quite normal setup).

Cheers


On Thu, 10 Jun 2004 09:06:05 +0200
Juan RP <juan@xtraeme.unixbsd.org> wrote:

> 
> Yesterday I imported the new gd packages into pkgsrc-wip, with
> or without X11 support, and I would like to commit them after the freeze.
> 
> ------ gd.mk ------
> 
> # $NetBSD$
> #
> # Makefile fragment to choose the correct gd package.
> #
> 
> .if !defined(GD_MK)
> GD_MK=          1
> 
> .include "../../mk/bsd.prefs.mk"
> 
> GD_NOX11_INSTALLED!=    \
>         if ${PKG_INFO} -qe gd-nox11; then       \
>                 ${ECHO} "yes";                  \
>         else                                    \
>                 ${ECHO} "no";                   \
>         fi
> 
> .if (${GD_NOX11_INSTALLED} == "yes" || (defined(PKG_GD_DEFAULT) && \
>         !empty(PKG_GD_DEFAULT:Mgd-nox11)))
> .  include "../../wip/gd-nox11/buildlink3.mk"
> .else
> .  include "../../wip/gd/buildlink3.mk"
> .endif
> 
> .endif # GD_MK
> 
> ------ gd.mk ------
> 
> So, we could use PKG_GD_DEFAULT to choose the default gd package or otherwise
> check if we have gd-nox11 and use it, we'll have to modify all packages
> requiring graphics/gd/buildlink3.mk to use this file (there are 10 packages more
> or less).
> 
> Is there any objection?
> 
> -- 
> 	Juan RP <juan@xtraeme.unixbsd.org>
> 


-- 
Julio M. Merino Vidal <jmmv@menta.net>
The NetBSD Project - http://www.NetBSD.org/