Subject: options: NO_FOO -> -foo?
To: None <tech-pkg@NetBSD.org>
From: Thomas Klausner <wiz@NetBSD.org>
List: tech-pkg
Date: 05/23/2005 13:39:56
--Bn2rw/3z4jIqBvZU
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi!

Should PKG_OPTIONS_LEGACY_VARS currently support converting
NO_FOO variables to -foo options?

I tried this in audio/gqmpeg, but it doesn't seem to work.
Did I make a mistake, or is it just not working currently?

How do we want to name package-local variables like in this case?

Cheers,
 Thomas

(The GQMPEG_NO_JAPANESE line in the diff is only for testing,
of course).

--Bn2rw/3z4jIqBvZU
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="options.mk"

# $NetBSD$

PKG_OPTIONS_VAR=	PKG_OPTIONS.gqmpeg
PKG_SUPPORTED_OPTIONS=	gqmpeg_japanese gqmpeg_russian
PKG_SUGGESTED_OPTIONS=	gqmpeg_japanese gqmpeg_russian
PKG_OPTION_LEGACY_VARS= GQMPEG_NO_JAPANESE:-gqmpeg_japanese GQMPEG_NO_RUSSIAN:-gqmpeg_russian

.include "../../mk/bsd.options.mk"

.if !empty(PKG_OPTIONS:Mgqmpeg_japanese)
CONFIGURE_ARGS+=	--enable-japanese
.endif

.if !empty(PKG_OPTIONS:Mgqmpeg_russian)
CONFIGURE_ARGS+=	--enable-russian
.endif

--Bn2rw/3z4jIqBvZU
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="gqmpeg.diff"

? options.mk
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/audio/gqmpeg/Makefile,v
retrieving revision 1.84
diff -u -r1.84 Makefile
--- Makefile	11 Apr 2005 21:44:52 -0000	1.84
+++ Makefile	23 May 2005 11:36:33 -0000
@@ -22,14 +22,9 @@
 
 DEINSTALL_EXTRA_TMPL+=	${.CURDIR}/DEINSTALL
 
-.include "../../mk/bsd.prefs.mk"
+GQMPEG_NO_JAPANESE=	YES
+.include "options.mk"
 
-.if !defined(GQMPEG_NO_JAPANESE)
-CONFIGURE_ARGS+=	--enable-japanese
-.endif
-.if !defined(GQMPEG_NO_RUSSIAN)
-CONFIGURE_ARGS+=	--enable-russian
-.endif
 CONFIGURE_ARGS+=	--without-included-gettext
 CONFIGURE_ENV+=		GNOME_DATADIR=${PREFIX}/share
 

--Bn2rw/3z4jIqBvZU--