Commit graph

9800 commits

Author SHA1 Message Date
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
rillig
5a278be828 mk/subst.mk: warn about all noop patterns before erroring out 2020-04-23 19:30:29 +00:00
rillig
aef7a2d723 mk/subst.mk: omit ./ for sanely named files, quote filename patterns 2020-04-23 19:16:49 +00:00
rillig
a7fc59f213 mk/subst.mk: refactor main code
The indentation of the inner loop has been fixed.

The chmod is only run if the file has actually changed. In the other
case, the file would have been removed right after the chmod, which made
the chmod unnecessary.

For compatibility with ancient operating systems whose /bin/sh still does
not understand negated conditions (SunOS), these conditions have been
avoided and were written using && and || instead.

The inner loop has been flattened a bit, to compensate for the
indentation of the outer loop.
2020-04-23 19:06:09 +00:00
rillig
48d391c218 mk/subst.mk: prevent filename expansion using "set -f"
This avoids creating a temporary directory.

The "set -f" option is not used anywhere else in pkgsrc, even though it
has been available since 1985 in the 8th Edition of Research Unix. Even
AIX and IRIX have that option, so it seems a safe bet.
2020-04-23 18:06:13 +00:00
mef
c4fe655544 (mk/fetch/site.mk) ftp.cse.buffalo.edu has not been responded for a week 2020-04-21 23:00:14 +00:00
jaapb
680ebe308b Use MAKE_ENV when calling dune in ocaml.mk 2020-04-21 11:23:29 +00:00
rillig
73681614b9 mk/license.mk: adjust location of the ninka package 2020-04-19 12:53:21 +00:00
rillig
058d3e5132 mk/subst.mk: document that SUBST_VARS does not support dollar 2020-04-18 15:04:34 +00:00
rillig
2bacc5cd9b mk/subst.mk: make error message for filename pattern easier readable 2020-04-18 12:59:42 +00:00
rillig
2a5426f9ce mk/subst.mk: avoid undefined behavior in regular expressions
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html
says in section 9.3.2 BRE Ordinary Characters that only very few
characters may be preceded with a backslash.

As a side effect, this change allows parentheses in the variable names
listed in SUBST_VARS (even if that will never happen in practice).

The reason that the regression test had not replaced VAR.[] before was
simply that this variable had not been listed in SUBST_VARS.
2020-04-18 12:21:10 +00:00
rillig
068572da5d mk/subst.mk: fix pkglint warnings and notes 2020-04-18 11:42:34 +00:00
rillig
dc1bafda16 mk/subst.mk: rename local variable _class_ to class
This makes the code a bit more readable.
2020-04-18 11:32:01 +00:00
rillig
8cfd3cfc77 mk/plist/print-plist.mk: add show-all-print-PLIST target
This makes it easier to see what happens during print-PLIST.
2020-04-18 10:54:21 +00:00
joerg
7134516a02 Adjust last to really prepend in the case of cwrappers. 2020-04-17 13:36:26 +00:00
joerg
76dab5b3cc clang 10 defaults to -fno-common with significant fallout in pkgsrc.
Override that by prepending -fcommon.
2020-04-17 13:35:36 +00:00
sborrill
d14997ed69 Work around a potential shell bug where "${FOO=${BAR%/*}}" does not work
if quoted. Seen on NetBSD 7.

#!/bin/sh
in="/path/to/dir with space/file"

: "${file=${in##*/}}"
: "${dir=${in%/*}}"
echo "dir:$dir"
echo "file:$file"
[ "$dir" = "$file" ] && echo "dir and file are same"

Leads to errors when adding packages such as:
./+FILES: cannot create /var/db/pkg.refcount/files/etc/rc.d/xenguest//var/db/pkg/xe-guest-utilities-7.0.0: directory nonexistent
2020-04-15 13:33:32 +00:00
nia
acc40588e7 mk/oss.buildlink3.mk: Simplify per-OS DEV* conditionals. Add MIDI. 2020-04-11 10:31:14 +00:00
rillig
7c41eda88e mk/subst.mk: add user-settable SUBST_NOOP_OK
This variable allows to make SUBST stricter than before. This will break
several packages that have redundant filename patterns. Most of these are
typos or outdated and should be updated or removed.
2020-04-01 15:10:09 +00:00
rillig
cb79642b88 mk/configure/replace-localedir.mk: allow SUBST to be a no-op
Since the SUBST_FILES of this class are generated by running find(1) in
WRKSRC, there may be files that are unaffected by the substitution.
2020-03-30 22:57:18 +00:00
rillig
b9804ebb15 mk/plist/plist.mk: use less verbose code for picking up PLIST files
While here, add more verbose documentation on PLIST_SUBST since the way
from the package's PLIST file to the +PLIST file can easily be confused
with the other way round, which is handled by print-PLIST.
2020-03-30 22:54:24 +00:00
rillig
d0c3b5301f mk/misc/show.mk: prevent unnecessary .for loop expansion
The .for loops are expanded by bmake as soon as they are parsed. Since
there are many variable groups, and since each of these groups has
several variables, this takes quite a bit of time.

The time for running "bmake clean" in pkgtools/pkglint went down from 1.0
second to 0.7 seconds. This may not seem much, but when multiplied with
23088 times 9, this little change may speed up a full bulk build by 62000
seconds, which is about 18 hours.

The side-effect is that the show-all-* targets can only be run from the
command line, not as a dependency of other targets. This restriction will
probably go unnoticed.
2020-03-30 22:49:30 +00:00
rillig
55e7cdf4de mk/fetch/fetch.mk: don't print double-slash in pathname 2020-03-30 22:44:26 +00:00
riastradh
ea504032f9 Missed a spot -- set MAKE_ENV during haddock build too. 2020-03-30 18:23:48 +00:00
riastradh
270c7f3e7b In Haskell packages, set MAKE_ENV while running ./Setup build. 2020-03-30 17:51:07 +00:00
riastradh
4c01312406 New package variable HASKELL_PKG_NAME.
Used to form _HASKELL_PKG_DESCR_DIR.  Defaults to DISTNAME, but for
some packages (hledger, incoming), the same DISTNAME is shared by
multiple packages.  So let the package define it explicitly if need
be.
2020-03-30 16:51:53 +00:00
wiz
d0ebe3c3a1 subversion-base: add option for plaintext password storage, default off.
Requested by Thomas Orgis.
2020-03-30 11:44:10 +00:00
nia
73411e4b5f mk/compiler: Make gfortran the default fortran compiler.
Discussed on tech-pkg@ before freeze.
2020-03-30 09:39:24 +00:00
rillig
b140f1fa76 mk/help/help.awk: find library functions in undefined-references.help
Before, searching for topic=socket did not find the documentation.

The detection of useful help topics is still not perfect since it now
finds sections that consist of a single word, such as the word
"undo-replace" in mk/install/replace.mk, but that will be fixed later,
after adding a few unit tests.
2020-03-30 06:21:52 +00:00
taca
4979d54327 mk/defaults/options.description: add esi
Add description for esi, ESI (Edge Side Includes).
2020-03-29 05:23:54 +00:00
rillig
97aab57291 mk/subst.mk: fix typo in documentation 2020-03-28 20:39:50 +00:00
joerg
4347ed3fcc Allow mk.conf to actually overwrite USE_PKG_ADMIN_DIGEST. 2020-03-27 20:57:34 +00:00
gdt
555a3776ae mk/compiler/gfortran.mk: Add comment about gcc 4.8 handling
The code maps gcc-4.8.x to "4", and then won't find gcc4.  This is a
bug, but it may be that it's just as well to never match 4.X of any
kind, and use 7 anyway.   Explain this issue with a \todo to fix the
bug or document the consequences as intended.

(This is a comment-only change.)
2020-03-26 12:44:46 +00:00
gdt
19ce42d824 mk/compiler/gfortran.mk: Fix bugs in version selection
Adjust regexp that removes .Y.Z from gcc-X.Y.Z.

Test for gcc being contained in PKGSRC_COMPILER, vs ==, so that a
value of "ccache gcc" is handled properly.

(ok for mk during freeze jperkin@)
2020-03-26 12:42:02 +00:00
jperkin
071d314936 mk: Support undefined UNLIMIT_RESOURCES.
Currently virtualsize is only defined for NetBSD, breaking builds that use it
on any other platform.  Adding defaults for all other platforms should be done
at some point, this at least unbreaks package builds for now and provides a
safer default for any future additions.
2020-03-26 12:23:54 +00:00
joerg
a1e7953bb0 Don't use normal memory size limits with GHC for module builds. 2020-03-24 20:43:17 +00:00
joerg
d2c378ee5e datasize limits for VMs should also be matched by VM limits. 2020-03-24 20:41:58 +00:00
rillig
62a0adf4a6 replace-interpreter: make documentation more precise
There are several places in pkgsrc where the files to be patched are
listed individually instead of just saying util/*/*.sh. This is
unnecessarily detailed. Encourage package authors to use filename
patterns more often.

An example is REPLACE_PYTHON in lang/clang, which currently fails because
some of the listed files don't exist anymore.
2020-03-24 04:40:34 +00:00
jperkin
b1d6962311 mk/subst.mk: Unbreak builds with no substitutions.
At least some implementations of rmdir(1) do not allow you to remove the
current working directory.  Fixes bootstrap on SunOS.
2020-03-23 11:27:29 +00:00
jperkin
f4e4c8e04e mk: Explain what SSP is, requested by rillig@. 2020-03-23 09:25:58 +00:00
jperkin
b44d00ddbd mk: Remove warning messages for unsupported check targets.
These appear to have been cargo culted around for a while, don't even have
anything to do with DESTDIR mode, and are completely useless.  Simplify the
logic a little while here.  Noticed by rillig@.
2020-03-23 09:24:35 +00:00