gnumake: use sh instead of /bin/sh by default

+79 -26
+35
pkgs/development/tools/build-managers/gnumake/0001-No-impure-bin-sh.patch
···
··· 1 + From e00a5257a6ca5fedbf68b09eee7df3502971a057 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:11:40 +0200 4 + Subject: [PATCH 1/2] No impure bin sh 5 + 6 + default_shell is used to populuate default shell used to execute jobs. 7 + Unless SHELL is set to a different value this would be /bin/sh. 8 + Our stdenv provides sh in form of bash anyway. Having this value not 9 + hard-coded has some advantages: 10 + 11 + - It would ensure that on all systems it uses sh from its PATH rather 12 + than /bin/sh, which helps as different systems might have different 13 + shells there (bash vs. dash) 14 + - In the past I had issues with LD_PRELOAD with BEAR, where /bin/sh 15 + used a different glibc than BEAR which came from my development shell. 16 + --- 17 + src/job.c | 2 +- 18 + 1 file changed, 1 insertion(+), 1 deletion(-) 19 + 20 + diff --git a/src/job.c b/src/job.c 21 + index ae1f18b..6b4ddb3 100644 22 + --- a/src/job.c 23 + +++ b/src/job.c 24 + @@ -77,7 +77,7 @@ char * vms_strsignal (int status); 25 + 26 + #else 27 + 28 + -const char *default_shell = "/bin/sh"; 29 + +const char *default_shell = "sh"; 30 + int batch_mode_shell = 0; 31 + 32 + #endif 33 + -- 34 + 2.31.1 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 +
+4 -1
pkgs/development/tools/build-managers/gnumake/default.nix
··· 14 sha256 = "06cfqzpqsvdnsxbysl5p2fgdgxgl9y4p7scpnrfa8z2zgkjdspz0"; 15 }; 16 17 patches = [ 18 # Purity: don't look for library dependencies (of the form `-lfoo') in /lib 19 # and /usr/lib. It's a stupid feature anyway. Likewise, when searching for 20 # included Makefiles, don't look in /usr/include and friends. 21 - ./impure-dirs.patch 22 ]; 23 24 nativeBuildInputs = lib.optionals guileSupport [ pkg-config ];
··· 14 sha256 = "06cfqzpqsvdnsxbysl5p2fgdgxgl9y4p7scpnrfa8z2zgkjdspz0"; 15 }; 16 17 + # to update apply these patches with `git am *.patch` to https://git.savannah.gnu.org/git/make.git 18 patches = [ 19 + # Replaces /bin/sh with sh, see patch file for reasoning 20 + ./0001-No-impure-bin-sh.patch 21 # Purity: don't look for library dependencies (of the form `-lfoo') in /lib 22 # and /usr/lib. It's a stupid feature anyway. Likewise, when searching for 23 # included Makefiles, don't look in /usr/include and friends. 24 + ./0002-remove-impure-dirs.patch 25 ]; 26 27 nativeBuildInputs = lib.optionals guileSupport [ pkg-config ];
-25
pkgs/development/tools/build-managers/gnumake/impure-dirs.patch
··· 1 - diff -Naur a/src/read.c b/src/read.c 2 - --- a/src/read.c 3 - +++ b/src/read.c 4 - @@ -109,9 +109,6 @@ 5 - #endif 6 - INCLUDEDIR, 7 - #ifndef _AMIGA 8 - - "/usr/gnu/include", 9 - - "/usr/local/include", 10 - - "/usr/include", 11 - #endif 12 - 0 13 - }; 14 - diff -Naur a/src/remake.c b/src/remake.c 15 - --- a/src/remake.c 16 - +++ b/src/remake.c 17 - @@ -1601,8 +1601,6 @@ 18 - static const char *dirs[] = 19 - { 20 - #ifndef _AMIGA 21 - - "/lib", 22 - - "/usr/lib", 23 - #endif 24 - #if defined(WINDOWS32) && !defined(LIBDIR) 25 - /*
···