Commit graph

9840 commits

Author SHA1 Message Date
rillig
21aab909de mk/subst.mk: fix edge case in detection of identity substitutions
In a basic regular expression, a dollar-sign only means end-of-string if
it appears at the end of the pattern, or (at the choice of the
implementation) at the end of a \(...\) subexpression.

This affects the package converters/help2man that uses a regular
expression containing a dollar in a non-final position.  This regular
expression had not been detected as an identity substitution even though
it is one.
2020-05-11 19:52:13 +00:00
rillig
3c7198b683 mk/haskell.mk: allow to generate PLIST files
Since GHC 7.10 or 7.8, the Haskell packages are installed in directories
whose name contains the package hash.  This made it harder to predict the
exact pathname.  Havin the exact pathnames in the PLIST file is the
ideal, it also helps to record the general structure of the installed
files to see whether some file unexpectedly appear or disappear.

To enable this for Haskell packages, the various base directories are
replaced with placeholders during print-PLIST.  These placeholders are
translated back to their respective paths when the +PLIST is generated
from the PLIST in the package directory.

Except for 2 packages, all Haskell packages in main pkgsrc had their
package PLIST file removed.  To help in adding them back, the pkgsrc
developer can set HS_UPDATE_PLIST=yes in mk.conf, which will generate the
PLIST directly into ${PKGDIR}/PLIST upon installation.

Most packages in pkgsrc-wip still have their old PLIST, and these are
migrated automatically as well.
2020-05-10 17:46:59 +00:00
rillig
7f4b055291 mk/tools: don't create empty symlink for wrong tool definition
This case can only happen in the following special case:

TOOLS_CREATE+=		asdf
TOOLS_PATH.asdf=	# empty

If there is a lonely TOOLS_CREATE without a corresponding TOOLS_PATH, it
defaults to ${FALSE} and thus doesn't trigger this code.
2020-05-10 14:36:18 +00:00
rillig
2b1a9a3af0 mk/scripts: fix a few of the HTML injections in README generation
These are needed for the djb-errno-hack option, which includes the <>
characters.
2020-05-10 07:48:10 +00:00
rillig
026854da4d mk: move locking.mk from internal to misc
Locking is not really internal since it has user-settable variables.
2020-05-10 06:52:49 +00:00
rillig
10f1774814 mk/tools/perl.mk: allow to silence the USE_TOOLS+=perl warning
Packages that don't declare USE_TOOLS+=perl and whose configure script
invokes perl produce a warning.

Usually warnings are ignored, but they can also be configured as errors,
for example during a strict bulk build.  In this situation it is
necessary to override the default behavior of the perl tool to fail
silently.  Up to now, defining both TOOLS_BROKEN+=perl and
TOOLS_FAIL+=perl produced a duplicate make target.

To handle this situation, let TOOLS_BROKEN+=perl take precedence over
TOOLS_FAIL+=perl.  This is much easier than finding out in each case how
to disable the perl check in the configure script, which is most often
done by adding any of the following to CONFIGURE_ENV: PERL=#none,
ac_cv_prog_PERL=#none, ac_cv_path_PERL=#none.
2020-05-10 06:05:35 +00:00
rillig
3ab427f38a mk/tools/create.mk: make tool wrappers smaller
There is no need to include the comments from the shquote function.
2020-05-09 21:08:05 +00:00
rillig
959e1dbe9a mk/tools/bsd.tools.mk: include _TOOLS_VARNAME in show-all-tools
This information is useful for getting the variable name that corresponds
to a tool.  In most cases this is just the uppercase name of the tool,
but there are exceptions like ${SETENV} for env, ${HOSTNAME_CMD} for
hostname.
2020-05-09 21:04:14 +00:00
rillig
a17e4f77d6 mk/tools/create.mk: add new variable TOOLS_ALWAYS_WRAP for debugging 2020-05-09 20:50:20 +00:00
rillig
85f1197b55 mk/check/check-portability.mk: improve documentation 2020-05-09 19:40:10 +00:00
rillig
3e147f8edf mk/pkginstall: fix output of show-all-pkginstall 2020-05-09 16:48:57 +00:00
rillig
e4719c2d8a mk/subst.mk: allow identity substitutions with escaped dots
This fixes the build of converters/help2man in SUBST_NOOP_OK=no mode.
2020-05-06 06:14:56 +00:00
rillig
78ff56665f mk/check/check-portability: opt-in for newer portability checks
There are a few portability checks that have been existing for years.
Later additions need an opt-in phase to avoid breaking existing usages.

https://mail-index.netbsd.org/tech-pkg/2020/05/04/msg023084.html
2020-05-05 05:55:25 +00:00
rillig
80ac4ecc53 mk/check/check-portability: fix error message when no patches are found 2020-05-04 21:48:18 +00:00
rillig
4b2126055f mk/check/check-portability: skip X.in if X is patched
A commonly occuring scenario is that a package patches the configure
script, but that the corresponding configure.in contains shell code that
is not portable.  In cases like these, configure.in is typically not used
during the build, therefore there is no need to check it for portability.

This also applies to all other combinations where a file is patched and
the corresponding file.in contains unportable shell code.
2020-05-04 21:32:48 +00:00
rillig
8e20d19199 mk/configure/pkg-config-override.mk: ignore no-op SUBST blocks
There are many .pc files that don't have a "Libs:" line.  That is totally
ok, therefore just skip these files.
2020-05-04 18:06:56 +00:00
rillig
419777e0d9 mk/defaults/options.description: describe a few options 2020-05-03 19:11:31 +00:00
rillig
a58591ede9 mk/bsd.options.mk: make deprecated options more visible
Up to now, the generated warnings were not prefixed with anything.
2020-05-03 18:45:28 +00:00
rillig
7d303d13c4 mk/help: clean up code 2020-05-03 10:57:06 +00:00
rillig
71696d3d82 mk/help: remove negation from variable names 2020-05-03 10:51:06 +00:00
rillig
7b6dd6a591 mk/bsd.pkg.mk: improve documentation 2020-05-03 10:34:00 +00:00
rillig
6aaf94f2da mk/bsd.options.mk: fix comment for bmake help
Before, "bmake help" only printed the second section of the help topic.
2020-05-03 10:10:05 +00:00
rillig
1d397cf6b5 mk/bdb.buildlink3.mk: fix outdated comments 2020-05-03 10:00:42 +00:00
rillig
ff016ffa31 mk/help: do not treat continuation lines as textual comments 2020-05-03 09:51:07 +00:00
rillig
1673ec7820 mk/help: make variable more precise
The word "ignore" was too unspecific.  There are lines that should be
printed, and there are lines that should be evaluated.
2020-05-03 09:44:07 +00:00
rillig
df9c05e64b mk/bsd.pkg.mk: fix typos in documentation 2020-05-03 09:22:16 +00:00
rillig
1894997149 mk/help: clean up code for selecting relevant help topics 2020-05-03 09:06:59 +00:00
rillig
4e2bff9c98 mk/help: only list help topics that have associated keywords 2020-05-03 08:49:16 +00:00
rillig
35d85c0109 mk/wrapper/transform-gcc: pass -Wno-* without warning
Seen in lang/mono6.
2020-05-02 19:32:59 +00:00
rillig
25920342a9 sysutils/qlogtools: skip nonexistent error.h when fixing errno
Some packages using mk/djbware.mk do not have error.h but need to fix the
errno declaration in other files.  Up to now, there was no good way of
achieving exactly this.

Building packages like these in a SUBST_NOOP_OK=no build makes these
packages fail.  To fix these packages, the configuration of the files
needed to be a bit more flexible.
2020-05-02 11:49:40 +00:00
rillig
77b53694f0 mk/djbware.mk: indent nested .if and .include directives 2020-05-02 11:43:09 +00:00
rillig
ad23776a43 mk/subst.mk: fix shell parse error for special sed expressions
The escaping inside the backticks had been wrong.  Because of this,
parentheses and semicolons were interpreted as shell syntax.

Switching to $(...) command substitution removes the need for quoting
some of the characters and makes the whole command simpler to understand.
Doing the escaping for the backticks command properly would have involved
lots of special cases.

The $(...) command substitution was used sparingly in pkgsrc up to now
because some older or broken shells do not support it.  Since these
shells do not end up as the shell that runs the commands from Makefiles,
that's not a problem.
2020-05-02 05:52:09 +00:00
rillig
63aa1c16fe mk/fuse.buildlink3.mk: make patching of configure scripts optional
Some packages that don't need this patch are:
fuse-afpfs-ng-0.8.1nb5
fuse-bindfs-1.8.4nb1
fuse-chironfs-1.1.1nb1
fuse-cryptofs-0.6.0nb6
2020-05-01 21:12:05 +00:00
rillig
b51e961dae mk/subst.mk: fix typo in diagnostic 2020-05-01 19:53:48 +00:00
rillig
d834a09e98 mk/subst.mk: switch command substitution back to backticks
To work properly, the $(...) should have been $$(...).

In pkgsrc the command substitution is usually done via `backticks`, for
compatibility with /bin/sh from Solaris.  To fix the shell parse errors,
the special characters are properly escaped inside the command
substitution.
2020-05-01 06:42:32 +00:00
joerg
9e908222f3 Simplify 2020-04-30 23:52:30 +00:00
joerg
8298e916c9 Use $() as it gives more consistent quoting behavior as seen by
devel/ruby-redmine.
2020-04-30 23:51:45 +00:00
joerg
a6cd5059b6 Terminate case properly 2020-04-30 23:51:15 +00:00
joerg
495466824a Suppress unnecessary output when not debugging 2020-04-30 23:50:28 +00:00
plunky
1736d74179 add afl-3.0 to acceptable defaults 2020-04-30 08:43:25 +00:00
rillig
ac62ef6aaf mk/subst.mk: fix combination of SUBST_FILTER_CMD with SUBST_NOOP_OK=no
Since SUBST_FILTER_CMD is a shell command, it may contain arbitrary
characters.  The condition in mk/subst.mk that tested whether
SUBST_FILTER_CMD was the default filter command was evaluated at run
time.  In such an evaluation, the variables (lhs and rhs) are fully
expanded before parsing the condition.  This means that these variables
must not contain quotes or unquoted condition operators.

Exactly this situation came up in one of the regression tests.  The
quoted "0-9" was copied verbatimly into the condition, including the
quotes.  The resulting condition was:

	"tr -d "0-9"" == "LC_ALL=C /usr/bin/sed "

This produced a syntax error because of the left-hand side. Adding a :Q
modifier would have helped for the left-hand side, but this would have
been necessary for the right-hand side as well.  Since an empty SUBST_SED
is defined not to "contain only identity substitutions", the first
condition can simply be removed.

The whole condition in the shell program had not worked anyway since it
expanded to either "[ true ]" or to "[ false ]", and both of these
commands exited successfully.
2020-04-29 22:46:42 +00:00
rillig
4bafb8759a mk/subst.mk: allow identity substitutions in SUBST_NOOP_OK=no mode
There are several cases where patterns like s|man|${PKGMANDIR}| appear in
SUBST_SED.  Up to now, these had been categorized as no-ops and required
extra code to make the package build when SUBST_NOOP_OK was set to "no".

This was against the original intention of SUBST_NOOP_OK, which was to
find outdated substitution patterns that do not occur in SUBST_FILES
anymore, most often because the packages have been updated since.

The identity substitutions do appear in the files, they just don't change
them.  Typical cases are for PKGMANDIR, DEVOSSAUDIO, PREFIX, and these
variables may well be different in another pkgsrc setup.  These patterns
are therefore excluded from the SUBST_NOOP_OK check.
2020-04-29 18:33:56 +00:00
rillig
ec5b9249a5 mk/wrapper: allow "unwrap" to be a no-op SUBST block
Discovered in pkgtools/pkg, where libpkg/pkg.pc was left unmodified.
2020-04-27 05:23:11 +00:00
rillig
fe5c19b1df mk/check/check-wrkref.mk: fix shell quoting
Before, adding "Binary file matches" (including the quotes) to
CHECK_WRKREF_EXTRA_DIRS led to a syntax error. Adding this string is so
obvious that it should have been added a long time ago already.
2020-04-26 14:23:25 +00:00
rillig
363de64c50 mk/misc/can-be-built-here.mk: remove NOT_FOT_UNPRIVILEGED
It is unused, and its error message wrongly said "only for unprivileged",
which nobody complained about for 13 years.
2020-04-26 06:56:29 +00:00
gutteridge
94a653defe options.description: add openbox and xfce4-wm (used by LXQt) 2020-04-26 03:17:41 +00:00
rillig
ab30dd14be mk/build/build.mk: use the login shell by default for build-env 2020-04-25 21:36:17 +00:00
js
9da7e8bc30 mk/fetch/fetch.mk: Use -f with ofhttp
pkgsrc wants to be able to override files when the checksum didn't
match.
2020-04-25 11:36:20 +00:00
js
c982f1310b mk/fetch/fetch.mk: Add ofhttp as fetcher 2020-04-25 11:21:06 +00:00
rillig
ae56c6b318 mk/subst.mk: don't recommend {pre,do,post}-patch
These often lead to broken patches, unless the patches are generated very
cautiously. Because of this, pkglint already warns about this.
2020-04-23 19:32:53 +00:00