Up to [cvs.NetBSD.org] / pkgsrc / mk / pkgformat / pkg
Request diff between arbitrary revisions
Keyword substitution: kv
Default branch: MAIN
*: remove OWNER definition OWNER, when it was introduced, was to protect packages deep in the infrastructure by emphasizing that they should not be touched by non-MAINTAINERs. No infrastructure package still sets OWNER. Note: non-trivial change to packages should be passed by MAINTAINERs. As discussed on tech-pkg.
mk: fix bug in BUILD_INFO file
Below ${FILESDIR}, checksums were generated for all files, including
files/CVS/*. Skip */CVS/* files (since they might be in subdirs).
Update comment while here.
mk: Fix SUPERSEDES generation. Each SUPERSEDES entry must be listed on its own line so that pkg_summary(5) can be parsed correctly, similar to all other fields. This should fix pkgin being able to handle packages that have multiple SUPERSEDES entries. Reported and reviewed by wiz.
mk/pkgformat/mk/metadata.mk: Include TOOL_DEPENDS in @blddep. This is necessary to trigger certain critical rebuilds: https://mail-index.netbsd.org/tech-pkg/2023/10/12/msg028291.html We should consider creating a separate @tooldep or something, but it's not clear whether that's needed and fixing native builds now is higher priority than sorting out semantics for cross builds. XXX pullup-2023Q3 even though this changes mk/
mk: pkgformat performance improvements.
Inline ${RUN} calls where appropriate. Only call mkdir when necessary.
Remove useless use of cat(1). Avoid unnecessary expr(1). Use bmake
loop expansion. Avoid unnecessary temporary files.
Saves around 50 execs per build.
mk: Cross-eyed hacks to support cross-libtool.
For a long time, when cross-building, say from native=amd64 to
target=powerpc, it was necessary to:
1. cross-build a _powerpc_ package called cross-libtool-base-powerpc,
and then
2. install the powerpc package _natively_ with `pkg_add -m x86_64' to
override the architecture check that normally forbids this kind of
shenanigans,
in order to cross-build anything that uses libtool as a tool.
This is partly because libtool doesn't follow the normal GNU
convention of `./configure --build=<native platform> --host=<platform
package will run on> --target=<platform package is configured to
operate on>' -- in this example, build=amd64, host=amd64,
target=powerpc.
Instead, libtool expects to be cross-built itself, even if it's going
to run as a tool. It's not as bonkers as it sounds at first: libtool
is just a shell script, and it caches various information about the
(cross-building!) toolchain it is built with so it can use that
information later when it is run as a tool itself to cross-compile
other software.
To make this work, we need to create the toolchain wrappers for
libtool _as if_ we were cross-building even if we are building a
native package. So mk/tools uses a new flag TOOLS_USE_CROSS_COMPILE
instead of USE_CROSS_COMPILE, and libtool internally sets
MACHINE_ARCH=${TARGET_ARCH} (in the example above, powerpc) to make
it look like we're cross-building. The new TOOLS_CROSS_DESTDIR is an
alias for the (defaulted) CROSS_DESTDIR, which must now be set
unconditionally in mk.conf in order for libtool to know where the
cross-destdir will be; _CROSS_DESTDIR remains empty when building any
native packages (including the native cross-libtool package).
Finally, we need to make the resulting package be a native package,
with MACHINE_ARCH set to the one that it will be installed on (in the
example above, amd64), so I added an indirection _BUILD_DEFS.${var}
to replace var on its own in the build definitions that get baked
into the package, shown by `pkg_info -B'. Setting
_BUILD_DEFS.MACHINE_ARCH=${NATIVE_MACHINE_ARCH} ensures that this
mutant hybrid cross-built libtool still produces a native package.
All of this logic is gated on setting USE_CROSS_COMPILE in mk.conf or
LIBTOOL_CROSS_COMPILE in the package makefile, so it should be safe
for non-cross-builds -- when USE_CROSS_COMPILE=no and you're not
building cross-libtool, everything is as before.
Also substitute SYSCONFBASE in MESSAGE files
mk: Exclude /System/Library on Big Sur too. As expected this is necessary, as early as requring the CoreFoundation framework for devel/gettext-lib.
mk: Handle missing system libraries on Big Sur.
The new release of macOS removes system libraries from the file system, only
providing access to them via a linker cache and dlopen(). This obviously
breaks many assumptions about how libraries work on Unix systems, and so we
unfortunately need to cripple various checks when running on those systems.
Introduce DARWIN_NO_SYSTEM_LIBS which, when defined, will trigger alternate
behaviour in the infrastructure. Currently this is in two places:
* In CHECK_SHLIBS, skip any path beginning with /usr/lib.
* In registered package metadata, any path beginning with /usr/lib is
removed from REQUIRES.
The former fixes all package builds, while the second will be necessary for
package managers such as pkgin, as they will no longer be able to verify that
those files are available on the target system.
This is obviously a gross hack, and removes our ability to ensure that the
target system is suitable for the packages we are attempting to install, but
Apple have left us with no alternative, and users will unfortunately be left
to find out at runtime instead.
It's likely this will need to be extended to /System/Library paths too, but
this is required first to actually get packages building before we can start
running bulk builds.
Pullup ticket #6263 - requested by maya mk: NetBSD 7 build fix Revisions pulled up: - mk/pkgformat/pkg/metadata.mk 1.29 --- Module Name: pkgsrc Committed By: maya Date: Mon Jul 6 18:29:12 UTC 2020 Modified Files: pkgsrc/mk/pkgformat/pkg: metadata.mk Log Message: revert metadata.mk:1.24, keep passing useless flag -U. It wasn't useless in older pkg_create, as used by netbsd-7. Reported by sborrill.
revert metadata.mk:1.24, keep passing useless flag -U. It wasn't useless in older pkg_create, as used by netbsd-7. Reported by sborrill.
mk/.../metadata.mk: properly clean up loops after removing "" There is no evidence that any shell needs the empty string literal in 'for i in "" $var' to loop over a simple variable. This would only be necessary if the shell code were generated by a preprocessor such as bmake or autoconf, and the list of items might end up empty. In such a case, the empty string literal prevents to generate 'for i in ; do', which would produce a syntax error.
mk/.../metadata.mk: fix reference to undefined shell variable When RUN includes the -u shell option (see the pkgsrc guide, section bulk.var.shvar), there is a stray "requires: parameter not set" error. This error doesn't make the build fail immediately since it is on the left-hand side of a pipe, where the exit status is ignored. It would fail if the shell for bmake were set to bash and its option "pipefail" were enabled.
Add a missing redirect to ensure that all files are picked up for hashing.
mk/pkgformat/metadata.mk: fix relative paths in PATCHDIR and FILESDIR
Before, relative paths had been stored as-is. This affected those
packages that defined PATCHDIR or FILESDIR as relative directory instead
of prefixing it with ${.CURDIR}.
Since there are already several other paths that are interpreted relative
to the package directory (CONFLICTS, DEPENDS), allow PATCHDIR and
FILESDIR to be specified as relative paths, too. This makes the package
Makefiles a bit shorter.
pkg_create -U doesn't do anything, don't pass the flag.
Suppress unnecessary output when not debugging
mk/pkgformat: include only relevant ident strings in +BUILD_VERSION Before, not only files containing an RCS Id were recorded in the +BUILD_VERSION file but also files containing text that looked similar to an RCS Id were recorded, even though these didn't contain any valuable version information. The effect was that before this change, pkgtools/pkglint was built over and over again by the bulk builds since pbulk uses a different regular expression for detecting modified files. The regular expression for unexpanded RCS Ids is added to record files that have never been checked in to CVS, just to have them recorded and to distinguish them from the final committed version. See https://mail-index.netbsd.org/tech-pkg/2020/01/11/msg022489.html.
mk/pkgformat: include only relevant ident strings in +BUILD_VERSION Before, not only files containing an RCS Id were recorded in the +BUILD_VERSION file but also files containing text that looked similar to an RCS Id were recorded, even though these didn't contain any valuable version information. The effect was that before this change, pkgtools/pkglint was built over and over again by the bulk builds since pbulk uses a different regular expression for detecting modified files. The regular expression for unexpanded RCS Ids is added to record files that have never been checked in to CVS, just to have them recorded and to distinguish them from the final committed version. See https://mail-index.netbsd.org/tech-pkg/2020/01/11/msg022489.html.
mk/pkgformat/pkg/metadata.mk: Fix awk syntax Fix awk syntax.
mk: Add missing line continuation, fix post-install
Add USE_PKG_ADMIN_DIGEST flag for switching between $NetBSD$ and SHA256 digests to identify file versions. Defaults to no for now. For digest mode, recursive into FILESDIR, so that e.g. the majority of pkg_install itself is recorded as well SMF manifests.
mk: Ensure only the first NetBSD rcsid is used. There are a couple of places in pkgsrc where rcsid's are generated, and these were leaking into "pkg_info -b" output. This had the side effect of causing those packages and all their dependencies to be rebuilt for every bulk build as the output and the respective files always mis-matched.
mk: Support MESSAGE.rcd and MESSAGE.smf. Previously packages configured these manually based on INIT_SYSTEM, this centralises support for them so they only need to exist to be pulled in accordingly.
mk/pkgformat: Only pass "-C" option to pkg_create(1) if it's valid.
Only pass "-C ${CONFLICTS}" to pkg_create(1) if ${CONFLICTS} is
non-empty; otherwise, a fatal error occurs. This allows CONFLICTS
to be defined, but empty.
Provide switch to activate new frameworks to replace "pkginstall".
If ${_USE_NEW_PKGINSTALL} is "yes", then use the new "pkgtasks",
"init", and "pkgformat/pkg"-scripts frameworks instead of the
existing "pkginstall" framework.
Remove support for USE_DESTDIR=no.
Remove USE_X11BASE and X11PREFIX.
Put back MESSAGE_SRC_DFLT.
Revert introduce MESSAGE_SRC_DFLT, same as PLIST_SRC_DFLT for PLIST_SRC. proposed/discussed is required for such changes.
introduce MESSAGE_SRC_DFLT, same as PLIST_SRC_DFLT for PLIST_SRC.
Skip automatic shlib permission fix for files in CHECK_SHLIBS_SKIP.
reduce dependencies, to avoid unwanted binary package regeneration.
* ${_BUILD_INFO_FILE} only depends on ${_PLIST_NOKEYWORDS}, not plist target.
* plist target is not required to create +CONTENTS
${_SIZE_PKG_FILE} only require ${PLIST}, so restrict dependency to it.
This change avoid to regeneration the file, it may cause pemission issue
with PKG_DESTDIR_SUPPORT=destdir.
Temporary skip REQUIRE metadata collection for PE (Cygwin), some DLL lead `ldd' command to hung up.
Add REQUIRE/PROVIDER metadata detection support for OBJECT_FMT=PE (Cygwin).
Set LD_TRACE_LOADED_OBJECTS_FMT{1,2} for OpenBSD so that output of ldd will be
expected format.
workaround of PR 38838.
Be a bit less aggressive in the required version of pkg_install encoded into binary packages.
Rename "flavor" to "pkgformat". This is from Anton Panev's GSoC 2011 project to add RPM and DPKG support to pkgsrc. (I am not adding that further support in this commit.) This is just a rename of the existing functionality. Now it will be easy to test the GSoC work by simply putting in a single directory (such as "rpm" or "deb"). See http://addpackageforma.sourceforge.net/ for some details. This is from Anton's CVS, but I made some minor changes: - changed plural pkgformats to singular pkgformat (to be consistent) - fixed a few places (in comments) that were missed - catch up on some additions to flavor not in the pkgforma cvs: PKGSRC_SETENV and _flavor-destdir-undo-replace and undo-destdir-replace-install.