summary refs log tree commit diff
path: root/pkgs/development/tools
diff options
context:
space:
mode:
authorJörg Thalheim <Mic92@users.noreply.github.com>2021-06-28 07:19:00 +0100
committerGitHub <noreply@github.com>2021-06-28 07:19:00 +0100
commit41902c2f7db9da1f5f0a324f6fa981bf94e38e5c (patch)
tree93de4b1f3204c6ac9eb37ff404163d4e36ca9829 /pkgs/development/tools
parent5bd99fbbd9830496860207c3d6d82eeec816b0c3 (diff)
parented3727682766a6c745718addda5a9d351daabea3 (diff)
downloadnixpkgs-41902c2f7db9da1f5f0a324f6fa981bf94e38e5c.tar
nixpkgs-41902c2f7db9da1f5f0a324f6fa981bf94e38e5c.tar.gz
nixpkgs-41902c2f7db9da1f5f0a324f6fa981bf94e38e5c.tar.bz2
nixpkgs-41902c2f7db9da1f5f0a324f6fa981bf94e38e5c.tar.lz
nixpkgs-41902c2f7db9da1f5f0a324f6fa981bf94e38e5c.tar.xz
nixpkgs-41902c2f7db9da1f5f0a324f6fa981bf94e38e5c.tar.zst
nixpkgs-41902c2f7db9da1f5f0a324f6fa981bf94e38e5c.zip
Merge pull request #120501 from Mic92/gnumake
gnumake: use sh instead of /bin/sh by default
Diffstat (limited to 'pkgs/development/tools')
-rw-r--r--pkgs/development/tools/build-managers/gnumake/0001-No-impure-bin-sh.patch35
-rw-r--r--pkgs/development/tools/build-managers/gnumake/0002-remove-impure-dirs.patch40
-rw-r--r--pkgs/development/tools/build-managers/gnumake/default.nix5
-rw-r--r--pkgs/development/tools/build-managers/gnumake/impure-dirs.patch25
4 files changed, 79 insertions, 26 deletions
diff --git a/pkgs/development/tools/build-managers/gnumake/0001-No-impure-bin-sh.patch b/pkgs/development/tools/build-managers/gnumake/0001-No-impure-bin-sh.patch
new file mode 100644
index 00000000000..58ee2d6fe09
--- /dev/null
+++ b/pkgs/development/tools/build-managers/gnumake/0001-No-impure-bin-sh.patch
@@ -0,0 +1,35 @@
+From e00a5257a6ca5fedbf68b09eee7df3502971a057 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
+Date: Sat, 24 Apr 2021 10:11:40 +0200
+Subject: [PATCH 1/2] No impure bin sh
+
+default_shell is used to populuate default shell used to execute jobs.
+Unless SHELL is set to a different value this would be /bin/sh.
+Our stdenv provides sh in form of bash anyway. Having this value not
+hard-coded has some advantages:
+
+- It would ensure that on all systems it uses sh from its PATH rather
+  than /bin/sh, which helps as different systems might have different
+  shells there (bash vs. dash)
+- In the past I had issues with LD_PRELOAD with BEAR, where /bin/sh
+  used a different glibc than BEAR which came from my development shell.
+---
+ src/job.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/job.c b/src/job.c
+index ae1f18b..6b4ddb3 100644
+--- a/src/job.c
++++ b/src/job.c
+@@ -77,7 +77,7 @@ char * vms_strsignal (int status);
+ 
+ #else
+ 
+-const char *default_shell = "/bin/sh";
++const char *default_shell = "sh";
+ int batch_mode_shell = 0;
+ 
+ #endif
+-- 
+2.31.1
+
diff --git a/pkgs/development/tools/build-managers/gnumake/0002-remove-impure-dirs.patch b/pkgs/development/tools/build-managers/gnumake/0002-remove-impure-dirs.patch
new file mode 100644
index 00000000000..e62aee7d999
--- /dev/null
+++ b/pkgs/development/tools/build-managers/gnumake/0002-remove-impure-dirs.patch
@@ -0,0 +1,40 @@
+From 795d63d3c8b5c0dbb7e544954f75507b371b7228 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
+Date: Sat, 24 Apr 2021 10:20:16 +0200
+Subject: [PATCH 2/2] remove impure dirs
+
+---
+ src/read.c   | 3 ---
+ src/remake.c | 2 --
+ 2 files changed, 5 deletions(-)
+
+diff --git a/src/read.c b/src/read.c
+index fa197fb..defacfb 100644
+--- a/src/read.c
++++ b/src/read.c
+@@ -109,9 +109,6 @@ static const char *default_include_directories[] =
+ #endif
+     INCLUDEDIR,
+ #ifndef _AMIGA
+-    "/usr/gnu/include",
+-    "/usr/local/include",
+-    "/usr/include",
+ #endif
+     0
+   };
+diff --git a/src/remake.c b/src/remake.c
+index fb237c5..94bff7d 100644
+--- a/src/remake.c
++++ b/src/remake.c
+@@ -1601,8 +1601,6 @@ library_search (const char *lib, FILE_TIMESTAMP *mtime_ptr)
+   static const char *dirs[] =
+     {
+ #ifndef _AMIGA
+-      "/lib",
+-      "/usr/lib",
+ #endif
+ #if defined(WINDOWS32) && !defined(LIBDIR)
+ /*
+-- 
+2.31.1
+
diff --git a/pkgs/development/tools/build-managers/gnumake/default.nix b/pkgs/development/tools/build-managers/gnumake/default.nix
index fb9dab54049..0d2806026b8 100644
--- a/pkgs/development/tools/build-managers/gnumake/default.nix
+++ b/pkgs/development/tools/build-managers/gnumake/default.nix
@@ -14,11 +14,14 @@ stdenv.mkDerivation {
     sha256 = "06cfqzpqsvdnsxbysl5p2fgdgxgl9y4p7scpnrfa8z2zgkjdspz0";
   };
 
+  # to update apply these patches with `git am *.patch` to https://git.savannah.gnu.org/git/make.git
   patches = [
+    # Replaces /bin/sh with sh, see patch file for reasoning
+    ./0001-No-impure-bin-sh.patch
     # Purity: don't look for library dependencies (of the form `-lfoo') in /lib
     # and /usr/lib. It's a stupid feature anyway. Likewise, when searching for
     # included Makefiles, don't look in /usr/include and friends.
-    ./impure-dirs.patch
+    ./0002-remove-impure-dirs.patch
   ];
 
   nativeBuildInputs = lib.optionals guileSupport [ pkg-config ];
diff --git a/pkgs/development/tools/build-managers/gnumake/impure-dirs.patch b/pkgs/development/tools/build-managers/gnumake/impure-dirs.patch
deleted file mode 100644
index 6c7d9d2463c..00000000000
--- a/pkgs/development/tools/build-managers/gnumake/impure-dirs.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-diff -Naur a/src/read.c b/src/read.c
---- a/src/read.c
-+++ b/src/read.c
-@@ -109,9 +109,6 @@
- #endif
-     INCLUDEDIR,
- #ifndef _AMIGA
--    "/usr/gnu/include",
--    "/usr/local/include",
--    "/usr/include",
- #endif
-     0
-   };
-diff -Naur a/src/remake.c b/src/remake.c
---- a/src/remake.c
-+++ b/src/remake.c
-@@ -1601,8 +1601,6 @@
-   static const char *dirs[] =
-     {
- #ifndef _AMIGA
--      "/lib",
--      "/usr/lib",
- #endif
- #if defined(WINDOWS32) && !defined(LIBDIR)
- /*