From 7eaf05af307861a348bdada0645c425fac595d15 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Wed, 3 Nov 2021 08:17:39 +0000 Subject: [PATCH] most: enable parallel building --- pkgs/tools/misc/most/default.nix | 7 +++++++ pkgs/tools/misc/most/parallel-make.patch | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 pkgs/tools/misc/most/parallel-make.patch diff --git a/pkgs/tools/misc/most/default.nix b/pkgs/tools/misc/most/default.nix index de2118083d98..2073e066ae73 100644 --- a/pkgs/tools/misc/most/default.nix +++ b/pkgs/tools/misc/most/default.nix @@ -9,6 +9,11 @@ stdenv.mkDerivation rec { sha256 = "008537ns659pw2aag15imwjrxj73j26aqq90h285is6kz8gmv06v"; }; + patches = [ + # Upstream patch to fix parallel build failure + ./parallel-make.patch + ]; + outputs = [ "out" "doc" ]; makeFlags = [ @@ -26,6 +31,8 @@ stdenv.mkDerivation rec { buildInputs = [ slang ncurses ]; + enableParallelBuilding = true; + meta = with lib; { description = "A terminal pager similar to 'more' and 'less'"; longDescription = '' diff --git a/pkgs/tools/misc/most/parallel-make.patch b/pkgs/tools/misc/most/parallel-make.patch new file mode 100644 index 000000000000..07c2e47c673e --- /dev/null +++ b/pkgs/tools/misc/most/parallel-make.patch @@ -0,0 +1,18 @@ +Upstream commit c9cfad50a ("src/Makefile.in: Avoid a race condition +when performing a parallel build") + +--- a/src/Makefile.in ++++ b/src/Makefile.in +@@ -54,6 +54,12 @@ COMPILE_CMD = $(CC) -c $(ALL_CFLAGS) -DMOST_SYSTEM_INITFILE='"$(SYS_INITFILE)"' + all: $(EXEC) + $(EXEC): $(OBJDIR) $(CONFIG_H) slangversion $(OBJDIR)/$(EXEC) + @echo $(EXEC) created in $(OBJDIR) ++ ++# C source files include autogenrated "config.h". Make sure ++# it's available before the compilation. Pessimistically assume ++# any source file can depend on "config.h". ++$(OBJS) $(OBJDIR)/chkslang.o: $(CONFIG_H) ++ + $(OBJDIR)/$(EXEC): $(OBJS) + cd $(OBJDIR); $(CC) $(OFILES) -o $(EXEC) $(LDFLAGS) $(EXECLIBS) + #