summary refs log tree commit diff
path: root/pkgs/development/tools/build-managers/gnumake/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/tools/build-managers/gnumake/default.nix')
-rw-r--r--pkgs/development/tools/build-managers/gnumake/default.nix26
1 files changed, 12 insertions, 14 deletions
diff --git a/pkgs/development/tools/build-managers/gnumake/default.nix b/pkgs/development/tools/build-managers/gnumake/default.nix
index f01f38ecd23..3b9f0add879 100644
--- a/pkgs/development/tools/build-managers/gnumake/default.nix
+++ b/pkgs/development/tools/build-managers/gnumake/default.nix
@@ -1,30 +1,28 @@
-{ stdenv, fetchurl, guileSupport ? false, pkgconfig ? null , guile ? null }:
+{ lib, stdenv, fetchurl, guileSupport ? false, pkg-config, guile }:
 
-assert guileSupport -> ( pkgconfig != null && guile != null );
-
-let
-  version = "4.3";
-in
-stdenv.mkDerivation {
+stdenv.mkDerivation rec {
   pname = "gnumake";
-  inherit version;
+  version = "4.3";
 
   src = fetchurl {
     url = "mirror://gnu/make/make-${version}.tar.gz";
     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 = stdenv.lib.optionals guileSupport [ pkgconfig ];
-  buildInputs = stdenv.lib.optionals guileSupport [ guile ];
+  nativeBuildInputs = lib.optionals guileSupport [ pkg-config ];
+  buildInputs = lib.optionals guileSupport [ guile ];
 
-  configureFlags = stdenv.lib.optional guileSupport "--with-guile"
+  configureFlags = lib.optional guileSupport "--with-guile"
 
     # Make uses this test to decide whether it should keep track of
     # subseconds. Apple made this possible with APFS and macOS 10.13.
@@ -33,11 +31,11 @@ stdenv.mkDerivation {
     # a second. So, tell Make to ignore nanoseconds in mtime here by
     # overriding the autoconf test for the struct.
     # See https://github.com/NixOS/nixpkgs/issues/51221 for discussion.
-    ++ stdenv.lib.optional stdenv.isDarwin "ac_cv_struct_st_mtim_nsec=no";
+    ++ lib.optional stdenv.isDarwin "ac_cv_struct_st_mtim_nsec=no";
 
   outputs = [ "out" "man" "info" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.gnu.org/software/make/";
     description = "A tool to control the generation of non-source files from sources";
     license = licenses.gpl3Plus;