using it in a test to set _MAKE. With this change pkgsrc works on
NetBSD/i386 3.0 to build with an empty environment (env -i sh).
Tested with my ~100 favourite server packages. Does not affect
the case when PATH is already set. To have a per OPSYS default path
the include of platform/${OPSYS}.mk will probably need to be at
the top of bsd.prefs.mk - arguably it should be there already.
There are bound to be assumptions made by some packages which will
be broken by an empty env, but the bulk of pkgsrc and in particular
the infrastructure works fine.
ALLOW_VULNERABLE_PACKAGES settings that applies to all packages, there can
now be per-package lists of allowed vulnerability ids:
ALLOW_VULNERABILITIES.<pkgname>=<space separated list of vulnids>
To avoid duplication of code, audit-packages is now used to do these checks.
It can be skipped altogether by setting:
SKIP_AUDIT_PACKAGES=yes
blocks can override it without running the commands at all.
Move Interix [LOWER_]OS_VERSION speedup hack into bsd.prefs.mk, since it
must happen early at runtime.
While here, speed up the OS_VERSION calculation slightly for OSF1.
tools listed in USE_TOOLS -- some of them are required by the pkgsrc
infrastructure in variable assignment statements that look like:
VARIABLE!= ${AWK} ...
These tools are actually *required* by pkgsrc to be installed on the
system before it can even work (bootstrap situation). For these tools,
only override the "TOOL" name representing the tool if we're really
using the pkgsrc version of the tool.
We accomplish this by adding a new :pkgsrc modifier that is appended
to these tools listed in USE_TOOLS. We also list these tools in
bsd.prefs.mk so that all packages pick them up fairly early on.
that a package needs. Tools that pkgsrc needs are listed in
PKGSRC_USE_TOOLS, and tools that a package needs on top of that are
listed in USE_TOOLS.
Define "TOOL" variables, e.g. SED, AWK, MKDIR, etc. for each of the
tools that pkgsrc needs, and "TOOLS_TOOL" variables, e.g. TOOLS_SED,
TOOLS_AWK, TOOLS_MKDIR, etc. for each of the tools that a package
needs. These variables contain the full command line to the real
command and arguments needed to invoke the tool.
caches variable definitions that were computed by make. These variables
are specified by listing them in MAKE_VARS, e.g.,
.if !defined(FOO)
FOO!= very_time_consuming_command
.endif
MAKE_VARS+= FOO
bsd.pkg.mk will include only the one generated during the most recent
phase. A particular phase's makevars.mk file consists of variable
definitions that are a superset of all of the ones produced in previous
phases of the build.
The caching is useful because bsd.pkg.mk invokes make recursively,
which in the example above has the potential to run the very time-consuming
command each time unless we cause FOO to be defined for the sub-make
processes. We don't cache via MAKE_FLAGS because MAKE_FLAGS isn't
consistently applied to every invocation of make, and also because
MAKE_FLAGS can overflow the maximum length of a make variable very
quickly if we add many values to it.
One important and desirable property of variables cached via MAKE_VARS
is that they only apply to the current package, and not to any
dependencies whose builds may have been triggered by the current
package.
The makevars.mk files are generated by new targets fetch-vars,
extract-vars, patch-vars, etc., and these targets are built during
the corresponding real-* target to ensure that they are being invoked
with PKG_PHASE set to the proper value.
Also, remove the variables cache file that bsd.wrapper.mk was generating
since the new makevars.mk files provide the same functionality at a
higher level. Change all WRAPPER_VARS definitions that were used by
the old wrapper-phase cache file into MAKE_VARS definitions.
* Get rid of an explicit check for ${_IMAKE_MAKE} == ${GMAKE} in
bsd.pkg.mk to check for whether we need to depend on gmake or not.
Instead, we now note in Linux.mk that packages that need imake will
also need to use gmake by setting _IMAKE_TOOLS+=gmake.
* Push the definition of MAKE_PROGRAM from bsd.pkg.mk into make.mk where
it's closer to related code.
to provide "TOOL" definitions for tools used by a top-level make process
(usually because it uses them in a != variable definition). This allows
USE_TOOLS to be defined before bsd.prefs.mk is included by a package
Makefile, where USE_TOOLS lists the additional (non-default) tools that
are required to build the package.
Also, drop the fallback to existing "TOOL" definitions because we now
have TOOLS_PLATFORM.* for each platform in pkgsr/mk/tools/tools.*.mk.
to tech-pkg:
=====
* USE_BUILDLINK3=YES will be unconditional. (In fact, USE_BUILDLINK3 will
be ignored altogether by mk/; but see below.)
* NO_BUILDLINK and NO_WRAPPER will be ignored by mk/. If a build happens,
these phases will happen.
* The existing NO_BUILD will imply the previous NO_BUILDLINK and NO_WRAPPER.
If no build happens, those phases are not needed.
* NO_TOOLS will be ignored by mk/. The tools phase, which provides much
more than just the C compiler, will always happen regardless of package.
This will make metapackage builds only slightly slower, in trade for far
less user error.
(...and if it were optional, it should have been an .sinclude anyway.)
Sanity: If mk/platform/${OPSYS}.mk is missing, don't assume NetBSD is it.
pkgsrc now depends on a valid platform file for an OS, so require it.
(Still includes NetBSD.mk, but sets PKG_FAIL_REASON.)
spot that will come before compiler.mk (in bsd.prefs.mk). Previously,
LOCALBASE/bin was appearing earlier in the path than work/.<compiler>/bin,
which could cause the Wrong Thing to happen.
decides to set PKGSRCDIR to a relative path as seen in several old PRs
and which prompted the original switch to make PKGSRCDIR private in
revision 1.881 of bsd.pkg.mk.
as it's only used internally by bsd.prefs.mk.
* Make _PKGSRCDIR a public variable by renaming it to PKGSRCDIR.
Also, generate its value from ${_PKGSRC_TOPDIR} so it's less fragile
than the old method of stripping off the last two components of
${.CURDIR}. PKGSRCDIR may now be used after bsd.prefs.mk is defined.
* Change all references to _PKGSRCDIR to PKGSRCDIR.