Commit graph

9741 commits

Author SHA1 Message Date
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