Commit graph

9800 commits

Author SHA1 Message Date
riastradh
89445637ce New target test-env, like build-env and configure-env. 2020-03-23 00:33:48 +00:00
rillig
a739837b20 mk/configure/replace-interpreter.mk: add missing empty line
The optional /usr/bin/env is independent from sh. It applies to all
languages.
2020-03-22 21:31:21 +00:00
joerg
3430630848 Add a ulimit flag for address space limits. Support it on NetBSD for
now.
2020-03-22 21:17:30 +00:00
rillig
7d0baa0a1f mk/subst.mk: only create cookie after everything is finished
When fixing the SUBST definitions in a package, it can hapen that the
substitution aborts in the middle. In such a case the cookie should not
be written and the substitution should be retried. Otherwise the build
may continue with half the substitutions done.
2020-03-22 18:43:46 +00:00
rillig
b885ff75ea mk/subst.mk: ignore directories in SUBST_FILES
Seen in multimedia/libmp4v2, where a pattern also matches the CVS
directory from the distfiles.
2020-03-22 13:19:50 +00:00
rillig
4d12683e99 mk/subst.mk: use the same severity for all messages
The severity now depends only on the setting of SUBST_NOOP_OK. Right now
this means that some former warnings will be reported as info only, but
that will change after switching the default of SUBST_NOOP_OK after
2020Q1. Then they will all be reported as warnings, followed by the final
error saying that the pattern has no effect.

This change makes it easier to detect inconsistencies and outdated
definitions, for example by setting the global SUBST_NOOP_OK=no and
redefining WARNING_MSG to actuall fail.
2020-03-22 12:15:59 +00:00
rillig
12053e22a2 mk/bsd.prefs.mk: add PREFIX to show-all-dirs 2020-03-22 11:07:14 +00:00
rillig
c61b55368a mk/wrapper/transform-gcc: pass -Werror=* without warning 2020-03-22 11:05:50 +00:00
nia
88d9bac28d mk/fonts.mk: Empty USE_LANGUAGES 2020-03-22 09:46:10 +00:00
rillig
fdc3adecd5 mk/subst.mk: run diff in the default locale
The diff program is only used to produce informative output in the build
logs, nevertheless its output might be translated if there are lines that
do not end with a newline.
2020-03-21 19:26:12 +00:00
rillig
8e82112864 mk/subst.mk: add global SUBST_SHOW_DIFF variable
This is useful in bulk builds or when trying to understand what happens
under the hood, since the SUBST code leaves no .orig files around.
2020-03-21 13:30:35 +00:00
rillig
68730ad3f1 mk/subst.mk: fix bmake warnings in case of duplicate SUBST classes 2020-03-21 12:22:31 +00:00
rillig
53a584aaf8 mk/djbware.mk: make the errno.h hack configurable
This hack is mostly needed for older software like sysutils/daemontools
that was created when errno was still a global variable. Newer packages
like devel/bglibs don't need that hack anymore. Therefore make it
configurable, to avoid build failures when subst.mk does not find any
error.h to patch.
2020-03-20 19:40:39 +00:00
rillig
3059f09896 mk/extract/bsd.extract-vars.mk: make documentation more user-friendly
The variables are now sorted chronologically instead of alphabetically,
to express the order in which the actions happen. The sentences are a bit
shorter than before.

The visual layout has been changed to make the whole variable name stick
out more. Before, the part that was easily visible was the same "EXTRACT_"
for all of them.
2020-03-20 17:16:34 +00:00
rillig
caf5567d50 show-all: fix output for list variables containing dollar characters
Before, variables containing dollar characters displayed so wrong that it
was hard to explain.

To fix the problem, I typed almost random characters into the code until
the output was exactly as expected. I still do not understand:

* why the list variables need 8 dollars to survive the @x@ loop,
* why the code only works if the dollars come from an external variable
  instead of being written inline,
* why the backslash in the :C modifier needs to be doubled.

Anyway, the output of "bmake show-all-extract" now contains the shell
variable $${extract_file}, just as it should. The dollars are now doubled
in the output and thereby match the source code from the Makefile
exactly.
2020-03-20 16:39:03 +00:00
rillig
172f1091af mk/extract/extract.mk: enclose extract_file in quotes
This prevents unintended shell word expansion.

It also makes that argument visible in "bmake show-all-extract". Before,
it was left out entirely from the output. Now it is printed as an empty
string literal, which at least gives a hint that "there is something".
2020-03-20 15:00:45 +00:00
rillig
d1f0656e94 mk/subst.mk: evaluate SUBST_MESSAGE only once, and late
The default value of SUBST_MESSAGE is based on SUBST_FILES, and that
variable may use the :sh modifier to list files from WRKSRC, which may
not exist at load time.
2020-03-20 09:00:44 +00:00
rillig
59545c5e44 mk/subst.mk: fix early evaluation of SUBST_FILES
In the case of pkglocaledir, the SUBST_FILES are generated by a shell
command. That command assumes that the WRKDIR already exists. Therefore
SUBST_FILES must be evaluated as late as possible.

See mk/configure/replace-localedir.mk; an example package that fails is
devel/gettext-tools.
2020-03-20 06:17:48 +00:00
rillig
a99bca4dad mk/subst.mk: add SUBST_NOOP_OK to catch typos and outdated definitions
In a bulk build with very strict settings (WARNING_MSG fails, as well as
no-op substitutions), it became clear that nearly all of the cases where
SUBST didn't replace anything were bugs in the package definition.

Most of them were just outdated, which is no surprise given that some
packages are already over 20 years old.

For backwards compatibility, SUBST_NOOP_OK defaults to "yes" right now.
After correcting the affected packages, the default will change to "no".
2020-03-19 16:57:35 +00:00
joerg
0837007143 Increase developer friendliness by including the line number. 2020-03-18 17:47:40 +00:00
tnn
788d7e0251 iscsi -> iSCSI 2020-03-16 22:09:54 +00:00
gdt
edc827c20c mk/wxGTK.mk: Remove (no users, almost no point)
This file allowed one to in theory specify a wxGTK version, but only
two programs used it.  Both now directly include a preferred version.
Generally, packages should use wxGTK30, unless there is a good reason
to use 28.

A major motivation earlier was not being able to install 28 and 30 at
once, but this has been solved.

As briefly discussed on pkgsrc-users.
2020-03-16 16:55:41 +00:00
rillig
2ebc134b4f mk/linux-pam: replace obsolete _PKG_SILENT with RUN 2020-03-15 23:03:03 +00:00
gutteridge
8e35d11866 options.description: document rust-llvm 2020-03-15 21:32:11 +00:00
rillig
035bd00993 mk/mysql.buildlink3.mk: fix fatal error when no MySQL version is found
This happened in a bulk build with PKGSRC_RUN_TEST=yes.
2020-03-15 17:50:28 +00:00
rillig
ef473259f9 mk/pkg-build-options: fail immediately if pkgbase is not set 2020-03-15 10:33:42 +00:00
wiz
e397308403 mk: fix typo in example 2020-03-14 13:28:38 +00:00
rillig
7ae24c3684 mk/pkg-build-options.mk: fix example
In most cases this pattern is used to query the options of the package
to which the buildlink3.mk file belongs.
2020-03-14 11:56:29 +00:00
rillig
6d39619f3d mk/pkg-build-options.mk: make the documentation more precise 2020-03-14 10:32:30 +00:00
nia
f4ab3d48e8 mk: default to gfortran on aarch64, there's no g95 for aarch64 2020-03-14 10:00:37 +00:00
gdt
52d38b3cdb mk/extract: move EXTRACT_USING earlier
In an attempt to resolve problems on SunOS, move EXTRACT_USING to the
early variables file, in the hopes that it will be defined before code
that checks it is executed.
2020-03-14 00:14:35 +00:00
rillig
c166122011 mk/tools: in show-all-tools, sort tool variables by relevance
Before, these variables were sorted alphabetically, which made the output
more difficult to read.
2020-03-13 17:33:02 +00:00
tnn
dfc42e92b5 mk: document iscsi PKG_OPTION 2020-03-13 13:26:34 +00:00
nia
af217bc787 *: Remove mysql51 - EOL since 2013, completely broken with OpenSSL 1.1 2020-03-13 10:05:41 +00:00
rillig
774a30f68e mk/check: revert collateral damage from previous commit
Killing the editor does not stop cvs from committing; to achieve that, it
is necessary to remove the file containing the commit message being
edited.
2020-03-13 08:11:36 +00:00
rillig
f481cb99f6 mk/check/check-perms: allow packages to skip the check completely
When all files are skipped, the tool dependency is not added as well.
This allows packages to skip the check without defining the user-settable
variable CHECK_PERMS.
2020-03-13 08:04:08 +00:00
rillig
5efaae1b1b mk/check/check-portability: exclude REPLACE_BASH by default
Since the portability checks are concerned about bashisms, it doesn't make
sense to apply them to programs that will later be run in bash anyway.

Suggested by gdt via private mail.
2020-03-13 06:31:43 +00:00
rillig
8f5b373f2f mk/check/check-portability: check plain Makefiles as well
Like Makefile.in, these files contain shell commands but don't start with
a #! line.

Suggested by gdt via private mail.
2020-03-12 19:09:41 +00:00
rillig
0418380975 mk/check/check-portability: don't check Makefile.am
These files typically come with a corresponding Makefile.in file, and the
same portability issue is in the .in file as well. For building the
package it is only necessary to patch the .in file. Patching the .am file
as well would mean additional work for the pkgsrc package maintainer.

Nevertheless, such fixes should be reported upstream. The upstream
maintainer is more interested in a patch for Makefile.am, since the .in
file is only generated.

Suggested by wiz via private mail.
2020-03-12 18:54:59 +00:00
rillig
a05002b399 mk/check/check-portability: support file names with spaces
Before, file names that start or end with spaces were trimmed by read(1),
as specified by POSIX 2004 and POSIX 2018.

https://pubs.opengroup.org/onlinepubs/9699919799/utilities/read.html

This edge case bug had been present since the very beginning of this
code, in November 2006.

Filenames containing backslashes or newlines are still not supported, and
probably never will be intentionally supported.
2020-03-12 18:40:06 +00:00
gdt
8088666ab9 mk/platform/NetBSD.mk: Default to bsdtar
Native tar on NetBSD <=8 (and later, if MKBSDTAR is no) does not
handle archive formats increasingly being seen in pkgsrc.  bsdtar
("libarchive tar") does, and is natively provided on NetBSD >=9.

pkgsrc already has a mechanism to use /bin/tar as the bsdtar tool when
it is bsdtar, so this change should not cause anything different on
NetBSD >= 9.   On <=8, it will depend on archivers/bsdtar, which can
be built without using an extract tool, and which will then be broadly
usable.

As broadly discussed over multiple days on tech-pkg.
2020-03-12 17:01:39 +00:00
gdt
e06c5526b7 mk: Disable default assignment of EXTRACT_USING
This is unnecessary, becuse extract/extract.mk has the same default
assignment.  It is harmful, because it prevents setting a value in
platform/Foo.mk.

Change the comment to say this is platform specific (which will be
true soon).
2020-03-12 16:57:23 +00:00
gdt
b9c8f5d661 extract.mk: Fix comment about nbtar
Maybe long ago nbtar was pkgsrc's pax-as-tar, but now this is just
${TOOL_PLATFORM.tar} which might be anything.
2020-03-12 16:55:31 +00:00
rillig
b0fc62a5e2 mk/check/check-portability: check Makefile.am and Makefile.in as well
Up to now, these files had been skipped because they didn't start with a
#! line. Still, they contain shell programs, therefore it makes sense to
check them.
2020-03-12 08:44:15 +00:00
rillig
19807d1dcd mk/bsd.pkg.use.mk: add more keywords for "bmake help"
The added empty line separates this help topic from the header comment of
this file, since USE_BSD_MAKEFILE does not add any dependencies and
therefore doesn't fit that description.
2020-03-12 00:12:23 +00:00
rillig
a08feb9dad mk/check/check-portability: document why *.am and *.in must be checked
Thanks gdt for noticing this.
2020-03-11 23:59:27 +00:00
rillig
1e7918cf88 mk/check: reduce running time of portability check
Since several years, the portability check only checks for shell files.
Instead of opening each extracted file to see whether it is a shell file,
it is more efficient to filter the files based on their names. This saves
a few system calls and in the case of lang/gcc9, half of the total
running time.

The file extensions to be excluded from the check have been sorted by
their count in the PLISTs. This data does not accurately represent the
source files of the package, but it's better than nothing.
2020-03-11 22:30:59 +00:00
rillig
203bc78cac mk/check: remove obsolete SKIP_PORTABILITY_CHECK variable
Marking a variable as obsolete for 12 years should be enough for everyone
to migrate.
2020-03-11 19:58:45 +00:00
rillig
edf2ea6495 mk/check: enable check-portability for [[
Since pkgtools/check-portability is not installed by default, it will not
harm any existing pkgsrc setup. To activate it, it has to be installed
manually. After a testing phase, it will be installed whenever
PKG_DEVELOPER is set.
2020-03-11 19:21:00 +00:00
gdt
be3d0fb820 Document proj-grids option 2020-03-10 16:19:35 +00:00
maya
400c25c7eb Match indentation. 2020-03-07 15:19:20 +00:00
maya
ea06e5b0d2 Test that the lang/gccN exists before defaulting to N as the gfortran version.
Issue most immediately obvious when trying GCC 9, but probably applies to
some other versions as well.
2020-03-07 15:18:19 +00:00
bacon
fe59885718 mk/compiler/gfortran: Default to same major version as base GCC
GFORTRAN_VERSION should match CC_VERSION as closely as possible for
ABI compatibility.  This update tries to match GFORTRAN_VERSION
to CC_VERSION if the base compiler is GCC.  If base compiler is not
GCC, default to a mainstream version likely to work with base clang/llvm.
2020-02-26 15:58:20 +00:00
tnn
78df98ea63 put back bsdtar as host tool, conditional on MKBSDTAR
http://mail-index.netbsd.org/source-changes/2020/01/17/msg112935.html
2020-02-25 11:20:28 +00:00
rillig
75b71a024b mk/build: make the documentation for build-env more precise 2020-02-25 05:30:14 +00:00
rillig
0867698634 mk/configure: fix configure-env to cd to the correct directory
The previous "cd ${d}" had been a left-over from the .for loop around
CONFIGURE_DIRS.
2020-02-23 20:24:46 +00:00
maya
b1fd52c5a5 Make sure _MAKE_JOBS_N has a valid value even if MAKE_JOBS is unset. 2020-02-18 16:10:37 +00:00
schmonz
79011abf80 Document the ikiwiki-sudo option. 2020-02-13 19:05:40 +00:00
kamil
0e2f37cee8 tools/tools.NetBSD.mk: Register TOOLS_PLATFORM.realpath 2020-02-13 00:40:35 +00:00
rillig
538c9b877c mk/pkginstall/files: allow spaces in configuration file names
Fixes PR pkg/42191.
2020-02-11 01:59:30 +00:00
rillig
944799cea6 mk/pkginstall/files: properly quote all shell variables
This prepares for CONF_FILES containing spaces in their names.
See pkg/42191.
2020-02-11 01:21:25 +00:00
rillig
3d253ab785 mk/bsd.pkg.mk: support spaces in PATH directories
Fixes PR pkg/53959.
2020-02-09 22:39:20 +00:00
rillig
2275f2d46a mk/configure: add configure-env target
This allows easy inspection of the realistic environment in which the
configure scripts are run.

The code is copied from the similar build-env target.

This might help to find the cause for pkg/54894, where "gcc -dumpversion"
is said to output 0 as the version number.
2020-02-09 20:33:38 +00:00
kamil
c9d555d7a0 options.description: Document the spice option (Spice-Space) 2020-02-06 22:07:06 +00:00
fox
c489fb420d options.description: Add security/wolfssl 2020-02-04 20:33:02 +00:00
nia
6a5e6c7a47 mk: Remove some now-unused unrealircd-* option descriptions. 2020-01-28 13:20:36 +00:00
rillig
d6a0479fc0 mk/platform/Linux: fix detection of GLIBC_VERSION on Debian
Running "/lib/x86_64-linux-gnu/libc.so.6 --version" on Debian unstable
inside WSL says:

GNU C Library (Debian GLIBC 2.29-9) stable release version 2.29.

In this case, there is a simple period, not a comma after the version
number.
2020-01-28 08:38:47 +00:00
jaapb
828c3820e9 Added gtksourceview3 option 2020-01-24 14:50:57 +00:00
nia
49d28e1bd7 mk/platform/Linux.mk: Use _OPSYS_LIB_DIRS to find glibc paths.
This seems more correct as it handles Debian/others already.
2020-01-24 12:36:28 +00:00
nia
3ecc5529cb mk/platform/Linux.mk: Fix glibc detection on Debian.
Problem identified and patch reviewed/tested by gutteridge, thanks
2020-01-24 12:32:21 +00:00
kamil
ca614b1505 Allow USE_X11=weak that allows X11 paths without having them reachable
Useful in certain packages (python) where X11 paths are needed in wrappers,
but optional in build and runtime.
2020-01-21 10:56:54 +00:00
kamil
a1b18a2bf5 Set native X11BASE on NetBSD to /usr/X11R7 unconditionally
This is the default option for more than a decade now.
2020-01-21 10:50:48 +00:00
nia
3e162c3b3e *: Remove esound support from pkgsrc
Enlightened Sound Daemon was one of the earlier solutions to the old
"multiple programs can't open /dev/audio at once" problem that was once
a thing we had to worry about.

Eventually, it was adopted as part of GNOME. GNOME lost interest in it
about a decade ago and dropped it in favour of PulseAudio, newer
applications are generally uninterested in supporting it. Last release
was in 2008 and support for newer OS APIs is pretty nonexistent.

Several years ago the original website disappeared.

https://en.wikipedia.org/wiki/Enlightened_Sound_Daemon
https://tracker.debian.org/news/999428/removed-0241-11-from-unstable/
2020-01-20 21:54:00 +00:00
pho
865567336f Build ${WRKSRC}/Setup in the do-configure phase
Doing it in pre-configure makes it unable to do SUBST in that phase.
2020-01-20 14:14:33 +00:00
pho
a1f59741bc Use _MAKE_JOBS_N defined in build/build.mk 2020-01-19 23:45:06 +00:00
maya
25acf4336b Rename EFFECTIVE_MAKE_JOBS -> _MAKE_JOBS_N, suggested by gdt.
I am under the impression we use _THING to mean "defined by the
implementation", which would be similar to the C meaning of __ prefix,
rather than "private to this file".
2020-01-19 18:20:45 +00:00
maya
55b59a0062 Add a visible EFFECTIVE_MAKE_JOBS, a tunable resembling _MAKE_JOBS,
but is defined as 1 in the case of no jobs.

No -j prefix for maximum usability.
(XXX: is _DEF_VARS the right place to add it?)
2020-01-19 16:51:47 +00:00
pho
9bbb8420be Configurable optimization level and compilation parallelism 2020-01-18 01:39:01 +00:00
jaapb
04005267d6 Updated mk/ocaml.mk to deal with changes from devel/ocaml-dune
.install files are now installed somewhere else, I've updated the
ocaml.mk file accordingly.
2020-01-17 09:19:03 +00:00
joerg
1389f0e895 Don't escape newline and tab in regex, newer gawk complains. 2020-01-16 22:53:11 +00:00
rillig
7f191db6be 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.
2020-01-15 20:11:11 +00:00
rillig
8b2c7d624a 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.
2020-01-15 20:03:10 +00:00
rillig
1498fcf3dd mk/pkgformat: fix documentation 2020-01-14 22:22:34 +00:00
rillig
1f7df547ed mk/pkgformat: fix documentation 2020-01-14 22:21:19 +00:00
joerg
07c8de54f9 Sort the list of files included during a scan run and remove duplicates.
This avoids some sources of entropy and can save a bit space too.
2020-01-13 22:08:33 +00:00
rillig
48d051044f mk/pkgformat: update documentation in list-dependencies 2020-01-13 07:31:53 +00:00
taca
ca4fe2672a mk/pkgformat/pkg/metadata.mk: Fix awk syntax
Fix awk syntax.
2020-01-13 06:52:57 +00:00
ryoon
bf792e6f39 mk: Add missing line continuation, fix post-install 2020-01-13 03:38:01 +00:00
gutteridge
73513866b8 options.description: add virtfs-proxy-helper 2020-01-13 02:52:28 +00:00
ryoon
8be8affe7f Add lang/adoptopenjdk11-bin support 2020-01-13 01:53:50 +00:00
joerg
43c574a4a9 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.
2020-01-12 23:38:42 +00:00
rillig
ea514da7f0 mk/bsd.pkg.update.mk: fix indentation 2020-01-11 19:30:50 +00:00
pho
024aad2263 Switch from ghc7 to ghc88 2020-01-11 07:47:18 +00:00
pho
ee9f90656c Use hashed package keys for (un)installing Cabal packages
Starting from somewhere around GHC 7.8, Cabal installs packages with a
hashed package key instead of just "{NAME}-{VERSION}". In other words,
the pair of the plain package name and the version is no longer unique
in the package DB, and using it for uninstallation may also remove
packages that we didn't mean to remove.

This is paricularly problematic because GHC comes with several bundled
Cabal packages. Installing and uninstalling a package with the same
name could break GHC itself, if the uninstallation is performed
without hashed keys.
2020-01-09 12:29:32 +00:00
rillig
b1aad323dc mk/plist: make documentation for GENERATE_PLIST more precise 2020-01-05 21:38:54 +00:00
wiz
cb9e56c003 Document jp2 option. Sort. 2020-01-04 19:01:51 +00:00
pho
0215d2d16a Be explicit about shared libraries
Recent versions of Cabal appears to build shared libraries by default unless --disable-shared is explicitly given.
2020-01-02 16:45:15 +00:00
pho
f20c406612 Pass -v to ./Setup when PKG_VERBOSE is defined 2020-01-02 16:34:47 +00:00
rhialto
727e0af859 Rename options for vice to have a "vice-" prefix (x64, cpuhistory). 2020-01-01 16:30:37 +00:00
pho
d3ea0027a2 Suppress an error occurs when buildlink is not present 2020-01-01 04:54:10 +00:00