summaryrefslogtreecommitdiffstats
path: root/misc
diff options
context:
space:
mode:
author Andrew Clemons2023-07-29 13:40:13 +0200
committer Willy Sudiarto Raharjo2023-08-05 05:08:44 +0200
commita9bbeacc23e2df53d4d03fd784b2941d0130d444 (patch)
tree5b7ad569e3fd239521d7a031d76201eb5ff59756 /misc
parent00eb4e70a04f5d87ccdb05f912c023ba3975df4c (diff)
downloadslackbuilds-a9bbeacc23e2df53d4d03fd784b2941d0130d444.tar.gz
misc/rmlint: Fix multiple jobs configuration.
scons takes a jobs argument (either --jobs=N or -jN) but will fail if MAKEFLAGS has other values in it. This change mirrors how it is done in pybik.SlackBuild. Signed-off-by: Andrew Clemons <andrew.clemons@gmail.com> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'misc')
-rw-r--r--misc/rmlint/rmlint.SlackBuild10
1 files changed, 9 insertions, 1 deletions
diff --git a/misc/rmlint/rmlint.SlackBuild b/misc/rmlint/rmlint.SlackBuild
index 57a36d9b91..86ff585487 100644
--- a/misc/rmlint/rmlint.SlackBuild
+++ b/misc/rmlint/rmlint.SlackBuild
@@ -81,7 +81,15 @@ find -L . \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
scons config CXXFLAGS="$SLKCFLAGS"
-scons "$MAKEFLAGS" CXXFLAGS="$SLKCFLAGS"
+
+# scons can use multiple jobs. For convenience, read MAKEFLAGS from the environment, if set
+JOBS="$( echo $MAKEFLAGS | sed 's,.*-j *\([0-9][0-9]*\)*.*,\1,' )"
+# or if no MAKEFLAGS, use the number of cores minus 1
+JOBS="${JOBS:-$(( $( nproc ) - 1 ))}"
+# or 1, if we really have one core
+[ "$JOBS" = "0" ] && JOBS=1
+
+scons --jobs="$JOBS" CXXFLAGS="$SLKCFLAGS"
scons --prefix=${PKG}/usr install
rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la