tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

disabling unsupported options



In my mk.conf I turn off various options with PKG_OPTIONS.pkg+= -foo.
If a package uses the options variable PKG_OPTIONS.pkg, though, and
does not support the option `foo', this makes it fail to build, which
seems awfully silly.

For example, I have PKG_OPTIONS.mplayer+= -mplayer-real to disable
proprietary codecs -- but since that option is supported only on i386,
powerpc, and alpha, mplayer fails to build on amd64 with that setting,
even though I'm turning it off.

Any objections to the following patch to stop failing packages because
the user disabled options that aren't supported?


Index: mk/bsd.options.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/bsd.options.mk,v
retrieving revision 1.67
diff -p -u -r1.67 bsd.options.mk
--- mk/bsd.options.mk   18 Feb 2008 14:30:40 -0000      1.67
+++ mk/bsd.options.mk   16 Jan 2013 06:55:01 -0000
@@ -284,7 +284,7 @@ _opt_:=             ${_popt_}
 _opt_:=                -${_popt_}
 .    endif
 .  endif
-.  if empty(PKG_SUPPORTED_OPTIONS:M${_popt_})
+.  if empty(_opt_:M-*) && empty(PKG_SUPPORTED_OPTIONS:M${_popt_})
 _OPTIONS_UNSUPPORTED:=${_OPTIONS_UNSUPPORTED} ${_opt_}
 .  else
 .    if defined(_PKG_OPTIONS_GROUP_MAP.${_popt_})


Home | Main Index | Thread Index | Old Index