separate file pkgsrc/mk/bsd.pkg.patch.mk. Also, include this file
ahead of the inclusion of bsd.tools.mk so that tools required to
patch are created by the tools framework.
at the time that they're defined: ${AWK}, ${GREP}, ${SED}, ${TRUE}.
Move the inclusion of compiler.mk below the inclusion of bsd.tools.mk
so that these variables are properly defined by the time they are
used. This should fix problems where pkgsrc gcc was not being properly
detected when using the new tools framework.
This change has the side effect of changing the relative order of the
compiler directories and the tool directory in the PATH, but this has
no impact on existing packages, and actually makes more sense anyway.
check for whether ${PATCHDIR} exists or not, or whether PATCHFILES is
defined or not. This avoids the use of != in a variable definition
just to find out if we need patch or not.
bsd.pkg.mk under the new tools framework. Instead, just note that if
we set PKGSRC_LOCKTYPE, that pkgsrc will require shlock. Remove
"shlock" from the large PKGSRC_USE_TOOLS list since we don't need it
all of the time. This fixes PKGSRC_LOCKTYPE != none when using the
new tools framework.
loop are only used afterwards, split out the EVAL_PREFIX code into a
separate file find-prefix.mk that can be included at any point to
generate a prefix-computation for the variables specified by FIND_PREFIX
at the inclusion point.
separate file pkgsrc/mk/bsd.pkg.extract.mk. Also, include this file
ahead of the inclusion of bsd.tools.mk so that tools required to
extract are created by the tools framework.
This makes more sense since there is never going to be a pkgsrc
replacement for ldconfig. We now always create an ldconfig tool in
${TOOLS_DIR} that either calls the system-supplied one if it exists,
or is a no-op.
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.
packages to strip installed executables. If INSTALL_UNSTRIPPED ==
"yes", then we create a "strip" wrapper in ${TOOLS_DIR} that just
calls ${TRUE} by considering ${TRUE} the system-supplied strip command.
default value for each platform. Currently, the replacement tools
comes from sysutils/coreutils, but where there is no native BSD install
program, bootstrap-pkgsrc should probably be made to provide an install
shell script as an alternative, and mk/tools/bootstrap.mk should be
amended accordingly.
Also remove one use of ${TYPE} in pkgsrc (bsd.pkg.mk) under the new tools
framework.
* 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.
added if GNU_CONFIGURE is specified - the arla and forthcoming openafs
packages are ones that need to be able to let the GNU configure script
guess for itself, rather than hardcoding the value.
Add a switch called USE_GNU_CONFIGURE_HOST to determine whether the
--host argument is provided to the GNU configure script. This is
switched on (it has a "yes" value) by default, so the previous
behaviour applies, but allows us to specify this value on a
package-by-package basis.
Documentation changes for this are also forthcoming.
"${PKGVULNDIR}" (one $, not two). This was causing the vulnerabilities
file to be looked for in the wrong place. This fix makes the
check-vulnerable target actually parse the vulnerabilities file and
look for vulnerable installed packages again.
redundant because we explicitly pass MAKEFLAGS to a sub-process
through command line arguments.
This fixes the problem reported in PR pkg/29874 that PKGNAME_REQD is
not overridden in recursive MAKE calls.
sourcing any config file, if it's defined. With thanks to Julio M.
Merino Vidal for the first pass at a fix, and for keeping me honest
and up-to-date with variable checks in portable shell constructs.
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.
o If origfile is already downloaded (size ok) and there's
a temp file with incomplete size, don't try to resume the
transfer on the temp file, remove it.
o Clean the code a bit.