gnumake: recreate patch set and move to patches directory

+88 -64
+5 -5
pkgs/development/tools/build-managers/gnumake/0001-No-impure-bin-sh.patch pkgs/development/tools/build-managers/gnumake/patches/0001-No-impure-bin-sh.patch
··· 1 - From e00a5257a6ca5fedbf68b09eee7df3502971a057 Mon Sep 17 00:00:00 2001 1 + From b69e3740e68afaec97b9957d40b9c135db87eaab Mon Sep 17 00:00:00 2001 2 2 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io> 3 3 Date: Sat, 24 Apr 2021 10:11:40 +0200 4 - Subject: [PATCH 1/2] No impure bin sh 4 + Subject: [PATCH 1/3] No impure bin sh 5 5 6 6 default_shell is used to populuate default shell used to execute jobs. 7 7 Unless SHELL is set to a different value this would be /bin/sh. ··· 18 18 1 file changed, 1 insertion(+), 1 deletion(-) 19 19 20 20 diff --git a/src/job.c b/src/job.c 21 - index ae1f18b..6b4ddb3 100644 21 + index ea885614..8a9bd8e0 100644 22 22 --- a/src/job.c 23 23 +++ b/src/job.c 24 - @@ -77,7 +77,7 @@ char * vms_strsignal (int status); 24 + @@ -76,7 +76,7 @@ char * vms_strsignal (int status); 25 25 26 26 #else 27 27 ··· 31 31 32 32 #endif 33 33 -- 34 - 2.31.1 34 + 2.44.1 35 35
-40
pkgs/development/tools/build-managers/gnumake/0002-remove-impure-dirs.patch
··· 1 - From 795d63d3c8b5c0dbb7e544954f75507b371b7228 Mon Sep 17 00:00:00 2001 2 - From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io> 3 - Date: Sat, 24 Apr 2021 10:20:16 +0200 4 - Subject: [PATCH 2/2] remove impure dirs 5 - 6 - --- 7 - src/read.c | 3 --- 8 - src/remake.c | 2 -- 9 - 2 files changed, 5 deletions(-) 10 - 11 - diff --git a/src/read.c b/src/read.c 12 - index fa197fb..defacfb 100644 13 - --- a/src/read.c 14 - +++ b/src/read.c 15 - @@ -109,9 +109,6 @@ static const char *default_include_directories[] = 16 - #endif 17 - INCLUDEDIR, 18 - #ifndef _AMIGA 19 - - "/usr/gnu/include", 20 - - "/usr/local/include", 21 - - "/usr/include", 22 - #endif 23 - 0 24 - }; 25 - diff --git a/src/remake.c b/src/remake.c 26 - index fb237c5..94bff7d 100644 27 - --- a/src/remake.c 28 - +++ b/src/remake.c 29 - @@ -1601,8 +1601,6 @@ library_search (const char *lib, FILE_TIMESTAMP *mtime_ptr) 30 - static const char *dirs[] = 31 - { 32 - #ifndef _AMIGA 33 - - "/lib", 34 - - "/usr/lib", 35 - #endif 36 - #if defined(WINDOWS32) && !defined(LIBDIR) 37 - /* 38 - -- 39 - 2.31.1 40 -
+12 -11
pkgs/development/tools/build-managers/gnumake/default.nix
··· 22 22 sha256 = "sha256-3Rb7HWe/q3mnL16DkHNcSePo5wtJRaFasfgd23hlj7M="; 23 23 }; 24 24 25 - # to update apply these patches with `git am *.patch` to https://git.savannah.gnu.org/git/make.git 26 - patches = [ 27 - # See patch message. 28 - ./make-cxx.patch 29 - # Replaces /bin/sh with sh, see patch file for reasoning 30 - ./0001-No-impure-bin-sh.patch 31 - # Purity: don't look for library dependencies (of the form `-lfoo') in /lib 32 - # and /usr/lib. It's a stupid feature anyway. Likewise, when searching for 33 - # included Makefiles, don't look in /usr/include and friends. 34 - ./0002-remove-impure-dirs.patch 35 - ]; 25 + # To update patches: 26 + # $ version=4.4.1 27 + # $ git clone https://git.savannah.gnu.org/git/make.git 28 + # $ cd make && git checkout -b nixpkgs $version 29 + # $ git am --directory=../patches 30 + # $ # make changes, resolve conflicts, etc. 31 + # $ git format-patch --output-directory ../patches --diff-algorithm=histogram $version 32 + # 33 + # TODO: stdenv’s setup.sh should be aware of patch directories. It’s very 34 + # convenient to keep them in a separate directory but we can defer listing the 35 + # directory until derivation realization to avoid unnecessary Nix evaluations. 36 + patches = lib.filesystem.listFilesRecursive ./patches; 36 37 37 38 nativeBuildInputs = [ autoreconfHook pkg-config ]; 38 39 buildInputs = lib.optionals guileEnabled [ guile ];
+27 -8
pkgs/development/tools/build-managers/gnumake/make-cxx.patch pkgs/development/tools/build-managers/gnumake/patches/0003-Do-not-search-for-a-C-compiler-and-set-MAKE_CXX.patch
··· 1 - Do not search for a C++ compiler and set MAKE_CXX. 1 + From 3317b3a78666e6073c63f62a322176e3dc680461 Mon Sep 17 00:00:00 2001 2 + From: Ivan Trubach <mr.trubach@icloud.com> 3 + Date: Sat, 17 Aug 2024 22:35:03 +0300 4 + Subject: [PATCH 3/3] Do not search for a C++ compiler and set MAKE_CXX 5 + MIME-Version: 1.0 6 + Content-Type: text/plain; charset=UTF-8 7 + Content-Transfer-Encoding: 8bit 2 8 3 9 Removes unnecessary reference to C++ compiler if CXX is set to an 4 10 absolute path. If CXX is not an absolute path, we avoid defaulting CXX ··· 19 25 default value. 20 26 21 27 References: 22 - • https://savannah.gnu.org/bugs/?63668 23 - • https://git.savannah.gnu.org/cgit/make.git/commit/?id=ffa28f3914ff402b3915f75e4fed86ac6fb1449d 28 + • https://savannah.gnu.org/bugs/?63668 29 + • https://git.savannah.gnu.org/cgit/make.git/commit/?id=ffa28f3914ff402b3915f75e4fed86ac6fb1449d 30 + --- 31 + configure.ac | 2 -- 32 + src/default.c | 19 ++++++------------- 33 + 2 files changed, 6 insertions(+), 15 deletions(-) 24 34 35 + diff --git a/configure.ac b/configure.ac 36 + index cd785754..41a65307 100644 25 37 --- a/configure.ac 26 38 +++ b/configure.ac 27 - @@ -37,6 +37,4 @@ AM_INIT_AUTOMAKE([1.16.1 foreign -Werror -Wall]) 39 + @@ -37,8 +37,6 @@ AM_INIT_AUTOMAKE([1.16.1 foreign -Werror -Wall]) 28 40 # Checks for programs. 29 41 AC_USE_SYSTEM_EXTENSIONS 30 42 AC_PROG_CC 31 43 -AC_PROG_CXX 32 44 -AC_DEFINE_UNQUOTED(MAKE_CXX, ["$CXX"], [Default C++ compiler.]) 33 - 45 + 46 + # Configure gnulib 47 + gl_EARLY 48 + diff --git a/src/default.c b/src/default.c 49 + index e396269b..78ba402f 100644 34 50 --- a/src/default.c 35 51 +++ b/src/default.c 36 52 @@ -528,22 +528,15 @@ static const char *default_variables[] = ··· 45 61 #else 46 62 "CC", "cc", 47 63 "OBJC", "cc", 48 - + "CXX", "c++", 49 - #endif 64 + -#endif 50 65 -#ifdef MAKE_CXX 51 66 - "CXX", MAKE_CXX, 52 67 -#else ··· 59 74 -# else 60 75 - "CXX", "g++", 61 76 -# endif 62 - -#endif 77 + + "CXX", "c++", 78 + #endif 63 79 /* This expands to $(CO) $(COFLAGS) $< $@ if $@ does not exist, 64 80 and to the empty string if $@ does exist. */ 81 + -- 82 + 2.44.1 83 +
+44
pkgs/development/tools/build-managers/gnumake/patches/0002-Remove-impure-dirs.patch
··· 1 + From 2db52008be2e2d504889f4f19318c2ba5a2a4797 Mon Sep 17 00:00:00 2001 2 + From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io> 3 + Date: Sat, 24 Apr 2021 10:20:16 +0200 4 + Subject: [PATCH 2/3] Remove impure dirs 5 + 6 + Purity: don't look for library dependencies (of the form `-lfoo') in 7 + /lib and /usr/lib. It's a stupid feature anyway. Likewise, when 8 + searching for included Makefiles, don't look in /usr/include and 9 + friends. 10 + --- 11 + src/read.c | 3 --- 12 + src/remake.c | 2 -- 13 + 2 files changed, 5 deletions(-) 14 + 15 + diff --git a/src/read.c b/src/read.c 16 + index b0fc1e1f..d6b41c17 100644 17 + --- a/src/read.c 18 + +++ b/src/read.c 19 + @@ -111,9 +111,6 @@ static const char *default_include_directories[] = 20 + INCLUDEDIR, 21 + #endif 22 + #ifndef _AMIGA 23 + - "/usr/gnu/include", 24 + - "/usr/local/include", 25 + - "/usr/include", 26 + #endif 27 + 0 28 + }; 29 + diff --git a/src/remake.c b/src/remake.c 30 + index fe67ab28..1b76560c 100644 31 + --- a/src/remake.c 32 + +++ b/src/remake.c 33 + @@ -1690,8 +1690,6 @@ library_search (const char *lib, FILE_TIMESTAMP *mtime_ptr) 34 + static const char *dirs[] = 35 + { 36 + #ifndef _AMIGA 37 + - "/lib", 38 + - "/usr/lib", 39 + #endif 40 + #if defined(WINDOWS32) && !defined(LIBDIR) 41 + /* 42 + -- 43 + 2.44.1 44 +