Commit graph

67 commits

Author SHA1 Message Date
obache
0491e08655 Move show-depends-options target from bsd.options.mk to flavor/pkg/utility.mk
to work with option-less packages.
2008-02-18 14:30:40 +00:00
obache
708435ea65 Add target "show-depends-options" to show depends's options recursively. 2008-02-18 12:38:35 +00:00
tron
74302ef9bd Protect against multiple inclusion. This fixes the "sane-frontends"
package which includes "bsd.options.mk" via its own "options.mk" and
via "graphics/gimp/buildlink3.mk".
2007-10-28 11:29:06 +00:00
dsl
d24555b956 Fix the .include lines so that make looks in the right place first.
Remember .include "foo.mk" is looked for (first) in the directory that
contains the makefile being processed (like in C), so remove all the
${.PARSEDIR} and ../ sequences that just cause grief.
2007-10-13 11:04:15 +00:00
rillig
0c31da43e2 Added _VARGROUPS. 2007-10-07 21:48:30 +00:00
rillig
a57e707ad8 Hey Johnny, I thought you could still write code that also works with
Solaris' /bin/sh.
2007-08-29 15:59:52 +00:00
jlam
bf456958e2 Avoid checking whether PKG_OPTIONS_DEPRECATED_WARNINGS is defined in
the makefile and simply handle it in the shell code.  This allows for
appending to PKG_OPTIONS_DEPRECATED_WARNINGS in a makefile even after
bsd.options.mk is included.
2007-08-14 19:03:25 +00:00
rillig
12764e49b0 Removed the outer .if ... .endif, so that I don't need to indent the
other conditionals. Indented all conditionals according to pkglint's
idea of correct indentation.

All packages that use this file must also have some options. Otherwise,
why should they use it at all?

All errors are _appended_ to PKG_FAIL_REASON, instead of overwriting
older ones.
2007-06-06 07:12:31 +00:00
rillig
e7e1da6834 Split the documentation into a user and a developer part. 2007-03-07 00:33:24 +00:00
rillig
02fa6bfec1 The value of PKG_OPTIONS_VAR is printed as is in an error message. This
makes "double quotes" visible when they are accidentally included by the
pkgsrc user.
2006-10-01 14:51:03 +00:00
ghen
b255a2482c PR pkg/33876: use the actual package name instead of "this package" in
supported-options-message.  ok with wiz.
2006-09-25 08:23:59 +00:00
seb
e9dd4864d7 Make show-options target output shorter as requested by dillo@ 2006-06-06 00:15:45 +00:00
jlam
e5eb2c56af First pass at implementing support for package system flavors other
than pkgsrc's current one.  This is an important lead-up to any project
that redesigns the pkg_* tools in that it doesn't tie us to past design
(mis)choices.  This commit mostly deals with rearranging code, although
there was a considerable amount of rewriting done in cases where I
thought the code was somewhat messy and was difficult to understand.

The design I chose for supporting multiple package system flavors is
that the various depends, install, package, etc.  modules would define
default targets and variables that may be overridden in files from
pkgsrc/mk/flavor/${PKG_FLAVOR}.  The default targets would do the
sensible thing of doing nothing, and pkgsrc infrastructure would rely
on the appropriate things to be defined in pkgsrc/mk/flavor to do the
real work.  The pkgsrc/mk/flavor directory contains subdirectories
corresponding to each package system flavor that we support.  Currently,
I only have "pkg" which represents the current pkgsrc-native package
flavor.  I've separated out most of the code where we make assumptions
about the package system flavor, mostly either because we directly
use the pkg_* tools, or we make assumptions about the package meta-data
directory, or we directly manipulate the package meta-data files, and
placed it into pkgsrc/mk/flavor/pkg.

There are several new modules that have been refactored out of bsd.pkg.mk
as part of these changes: check, depends, install, package, and update.
Each of these modules has been slimmed down by rewriting them to avoid
some recursive make calls.  I've also religiously documented which
targets are "public" and which are "private" so that users won't rely
on reaching into pkgsrc innards to call a private target.

The "depends" module is a complete overhaul of the way that we handle
dependencies.  There is now a separate "depends" phase that occurs
before the "extract" phase where dependencies are installed.  This
differs from the old way where dependencies were installed just before
extraction occurred.  The reduce-depends.mk file is now replaced by
a script that is invoked only once during the depends phase and is
used to generate a cookie file that holds the full set of reduced
dependencies.  It is now possible to type "make depends" in a package
directory and all missing dependencies will be installed.

Future work on this project include:

    * Resolve the workflow design in anticipation of future work on
      staged installations where "package" conceptually happens before
      "install".

    * Rewrite the buildlink3 framework to not assume the use of the
      pkgsrc pkg_* tools.

    * Rewrite the pkginstall framework to provide a standard pkg_*
      tool to perform the actions, and allowing a purely declarative
      file per package to describe what actions need to be taken at
      install or deinstall time.

    * Implement support for the SVR4 package flavor.  This will be
      proof that the appropriate abstractions are in place to allow
      using a completely different set of package management tools.
2006-06-03 23:11:42 +00:00
seb
faa9aeac73 I usually have the following stuffed in a mk.conf target or a script
and that is 3 make process to run...
make show-options; v=$(make show-var VARNAME=PKG_OPTIONS_VAR); echo $v=$(make sh
ow-var VARNAME=$v)

Hence add trailing part about PKG_OPTIONS_VAR and its value to
show-options target like the one found in supported-options-message target.
2006-06-03 08:44:46 +00:00
ghen
a4b367e139 Adapt pkgsrc documentation examples to the new databases/openldap-client
package.
2006-05-31 18:54:32 +00:00
jlam
1e2d98e634 Make the display of show-options more readable when there are lots of
options, e.g. x11/xorg-server, by wordwrapping the output.
2006-04-14 17:15:03 +00:00
wiz
0719006c41 Update path from cyrus-sasl2 to cyrus-sasl. 2006-04-13 21:45:12 +00:00
rillig
9ed2937efe Removed trailing white-space from a comment. 2005-11-14 04:25:50 +00:00
dillo
7eb75ea07a Improve warning for deprecated variables, prompted by wiz. 2005-09-05 15:24:08 +00:00
dillo
c9294e90d1 Fix some more typos, noted by Leonard Schmidt. 2005-07-28 15:17:55 +00:00
wiz
a6c70eb6d7 Fix typo in comment, from Leonard Schmidt via tech-pkg. 2005-07-28 13:22:08 +00:00
dillo
228b1f9528 Fix typos in last, noted by wiz. 2005-07-26 16:09:34 +00:00
dillo
a6f3882d40 Add support for sets of options where at least one option from each
set must be selected, requested and reviewed by wiz:

PKG_OPTIONS_NONEMPTY_SETS
       This is a list of names of sets of options.  At
       least one option from each set must be selected.
       The options in each set are listed in
       PKG_OPTIONS_SET.<setname>.  Options from the sets
       will be automatically added to PKG_SUPPORTED_OPTIONS.
2005-07-26 09:00:42 +00:00
dillo
f3e77304f9 Also print deprecated warnings in show-options target. 2005-07-19 10:30:22 +00:00
dillo
6701dc8ba7 PKG_OPTIONS_LEGACY_OPTS: only issue deprecated warning if the old
option is used.  Noted by adrianp.
2005-07-19 09:28:50 +00:00
dillo
91ba937bb4 Allow this file to be included even if no options are supported
(as may be the case if all options are platform specific).  In that
case set PKG_OPTIONS to empty and skip the rest of the file.

Okayed by jlam.
2005-06-11 16:12:13 +00:00
jlam
c285ef536b Fix harmless typo. 2005-06-09 18:44:26 +00:00
wiz
774ace527b Fix variable name in comment: it is PKG_OPTIONS_VAR, with an S. 2005-06-08 22:36:52 +00:00
dillo
db9aee67d2 fix variable name in example comment 2005-06-08 16:19:08 +00:00
dillo
a55c83b93b make legacy variables external:
PKG_LEGACY_OPTIONS
	PKG_OPTIONS_DEPRECATED_WARNINGS
2005-06-06 13:54:51 +00:00
dillo
dff8372404 Improve the way option groups are displayed in show-options.
While here, rename _cls_ to _grp_, as they are called groups.
2005-06-04 16:30:19 +00:00
seb
5feada633d Fix variable names in usage example. 2005-06-04 10:11:24 +00:00
dillo
5fa9d959f6 don't requrie PKG_SUPPORTED_OPTIONS to be set when groups are in use 2005-06-03 14:25:47 +00:00
dillo
f91dd9c279 add group options to PKG_SUPPORTED_OPTIONS before includeing
mk/defaults/obsolete.mk so socks and kerberos work when listed in
groups
2005-06-02 21:55:05 +00:00
wiz
0303df72aa Whitespace nit. 2005-06-02 20:43:55 +00:00
dillo
7f874cf6f0 add support for groups of mutually exclusive options via
PKG_OPTIONS_REQUIRED_GROUPS and PKG_OPTIONS_OPTIONAL_GROUPS.
2005-06-02 20:38:09 +00:00
dillo
b05a793493 fix bug in legacy vars handling for option names containing `-',
found by jmmv.
2005-06-01 13:40:14 +00:00
jmmv
33a592167e PKG_FAIL_REASON must be (double-)quoted to achieve the correct output. 2005-05-31 18:25:37 +00:00
wiz
8dfa9a3aa9 Show a deprecated warning even if the deprecated variable is set to
something other than [yY][eE][sS].
If a deprecated warning is defined, interpret it as YES (because some
variables in defaults/mk.conf have defined/not defined as yes/no).

Reviewed by dillo.
2005-05-31 16:03:41 +00:00
rillig
66c9dd0de7 The available options are shown before the dependencies are installed.
Many package options influence the dependencies, so this order is more
likely to be useful.
2005-05-31 15:05:13 +00:00
dillo
8cda012601 Rename describe-options to show-options, replacing the old show-options
target.
2005-05-31 12:10:07 +00:00
dillo
42816a484c To ease cleanup of the options namespace, add code to support legacy
option names:

PKG_OPTIONS_LEGACY_OPTS+=	old:new

If PKG_DEFAULT_OPTIONS or PKG_OPTIONS.foo contains option old (or
-old) it is rewritten to new (or -new) and a warning is issued by
the supported-options-message target.
2005-05-31 11:05:31 +00:00
dillo
7940fef51d set PKG_FAIL_REASON if any unsupported option is listed in PKG_OPTIONS.xxx 2005-05-28 12:14:34 +00:00
dillo
a60e646ed0 fix typo in documentation
add support for negative options in PKG_OPTIONS_LEGACY_VARS (NO_FOO:-foo)
undef temporary variables after for loop
2005-05-25 11:18:35 +00:00
jlam
15cc40e17f The example is missing a definition for PKG_OPTIONS_VAR. 2005-05-19 01:15:57 +00:00
rillig
7168c9aa72 Changed option processing to evaluate the options strictly from left to
right in each variable, starting with the most generic one. Later
definitions override earlier ones. This makes the ``order'' testcase in
regress/pkg-options succeed.
2005-05-16 09:08:29 +00:00
rillig
fc4a97a8d8 Don't process the file if either of PKG_SUPPORTED_OPTIONS or PKG_OPTIONS_VAR
is undefined. This avoids many unnecessary make(1) warnings. As this file
is only intended to be used from packages, don't look for obsolete.mk in
other directories than ../../mk/defaults/.
2005-05-14 02:17:43 +00:00
dillo
56dffda7c7 Rewrite how PKG_OPTIONS is computed:
- PKG_SUGGESTED_OPTIONS (set by pkg maintainer in pkg Makefile)
	lists options enabled by default.
- PKG_DEFAULT_OPTIONS (set by user in /etc/mk.conf)
	enables or disables (when prefixed with `-') options for
	all packages, takes precedence over PKG_SUGGESTED_OPTIONS
- PKG_OPTIONS.foo (set by user in /etc/mk.conf)
	enables or disables (when prefixed with `-') options for
	a specific package, takes precedence over PKG_DEFAULT_OPTIONS
	and PKG_SUGGESTED_OPTIONS

Also simplify conversion of legacy USE_XXX variables to options
via the new PKG_OPTIONS_LEGACY_VARS variable and emit warnings if
legacy variables are in use.

Add a new target describe-options that lists all supported options
with a one-line description, the options enabled by default and
the currently enabled optoions.

Reviewed by jlam and wiz.

XXX: defaults/options.description has to be filled in
XXX: the pkgsrc guide has to be updated
2005-05-08 13:43:30 +00:00
jlam
12e799d380 Make the pretty-printing actually work by passing all of the options on
different lines to the word-wrap script.
2005-04-28 21:58:44 +00:00
jlam
15a56127d9 We don't need to use ${SORT} to sort the options list. VAR:O will do
nicely.
2005-04-28 21:48:14 +00:00