Subject: Re: CVS commit: pkgsrc/graphics/imlib2
To: Johnny Lam <jlam@NetBSD.org>
From: Dieter Baron <dillo@danbala.tuwien.ac.at>
List: pkgsrc-changes
Date: 06/11/2005 01:55:59
--sm4nu43k4a2Rpi4c
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

In article <42A9F2D5.4060406@NetBSD.org> Johnny wrote:
: > I think that the best way to achieve this is to only add mmx to
: > PKG_SUPPORTED_OPTIONS when on i386.  This way you can handle the
: > PKG_OPTIONS:Mmmx unconditionally.  (FWIW, this is what I did in
: > mplayer during the switch and proved to be very useful.)

: FWIW, I agree with Julio as PKG_SUPPORTED_OPTIONS is naturally expected 
: to contain options that are truly supported.  I think it's okay for the 
: same package on different platforms to support different options.

  If we want to go that route, bsd.options.mk should handle the case
where there are no supported options.  With the applied patch, if
there are no supported options, PKG_OPTIONS is set to empty and the
rest of the file is skipped.  This makes it seem to the user that the
package does not use the options framework, while no special treatment
is needed in the package Makefile or options.mk.  What do you think?

					yours,
					dillo


--sm4nu43k4a2Rpi4c
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="no-supported-options.diff"

Index: bsd.options.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/bsd.options.mk,v
retrieving revision 1.40
diff -u -r1.40 bsd.options.mk
--- bsd.options.mk	8 Jun 2005 22:36:52 -0000	1.40
+++ bsd.options.mk	10 Jun 2005 23:45:59 -0000
@@ -52,8 +52,10 @@
 #		A list of warnings about deprecated variables or
 #		options used, and what to use instead.
 #
-#       At least one of PKG_SUPPORTED_OPTIONS, PKG_OPTIONS_OPTIONAL_GROUPS,
-#	and PKG_OPTIONS_REQUIRED_GROUPS must be defined.
+#       If none of PKG_SUPPORTED_OPTIONS, PKG_OPTIONS_OPTIONAL_GROUPS,
+#	and PKG_OPTIONS_REQUIRED_GROUPS are defined, PKG_OPTIONS is
+#	set to the empty list and the package is otherwise treated as
+#	not using the options framework.
 #		
 #
 # Optionally, the user may define the following variables in /etc/mk.conf:
@@ -141,10 +143,11 @@
 PKG_OPTIONS=		# empty
 
 # Check for variable definitions required before including this file.
-.if !defined(PKG_SUPPORTED_OPTIONS) && !defined(PKG_OPTIONS_OPTIONAL_GROUPS) && !defined(PKG_OPTIONS_REQUIRED_GROUPS)
-PKG_FAIL_REASON+=	"bsd.options.mk: At least one of PKG_SUPPORTED_OPTIONS, PKG_OPTIONS_OPTIONAL_GROUPS, and PKG_OPTIONS_REQUIRED_GROUPS must be defined."
-.elif !defined(PKG_OPTIONS_VAR)
+.if !defined(PKG_OPTIONS_VAR)
 PKG_FAIL_REASON+=	"bsd.options.mk: PKG_OPTIONS_VAR is not defined."
+.elif !defined(PKG_SUPPORTED_OPTIONS) && !defined(PKG_OPTIONS_OPTIONAL_GROUPS) && !defined(PKG_OPTIONS_REQUIRED_GROUPS)
+# no supported options: set PKG_OPTIONS to empty and skip rest of file
+PKG_OPTIONS=	#empty
 .else # process the rest of the file
 
 #

--sm4nu43k4a2Rpi4c--