Skip to content

Commit

Permalink
libraries/webkit2gtk: Fix -j0 build fails on single-core systems.
Browse files Browse the repository at this point in the history
Signed-off-by: B. Watson <urchlay@slackware.uk>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
  • Loading branch information
B. Watson authored and willysr committed Oct 19, 2024
1 parent 13d109f commit 23a96bb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion libraries/webkit2gtk/webkit2gtk.SlackBuild
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,14 @@ cd build

# The build might crash on high specs machines because ninja eat all
# of the resources, so let's try to limit it to half the available ones
"${NINJA:=ninja}" -j$(expr $(nproc) / 2)
# 20241016 bkw: without the + 1 here, machines with only one core were
# getting -j0 (aka *infinite* jobs), leading to build failures. Issue
# was reported on IRC by TommyC.
# Since (almost?) all CPUs with multiple cores have an even number of
# them, adding 1 to nproc doesn't change the result (still 2 out of 4,
# or 4 out of 8, etc). If you do have an odd number, the new code
# rounds up instead of down (uses e.g. 3 out of 5, instead of 2).
"${NINJA:=ninja}" -j$(expr '(' $(nproc) + 1 ')' / 2)
DESTDIR=$PKG $NINJA -j1 install

mkdir -p $PKG/usr/share/gtk-doc/html/webkit{2,dom}gtk-4.0
Expand Down

0 comments on commit 23a96bb

Please sign in to comment.