From b19b2c6844c2c97a0958d11f67685f36e99eb40f Mon Sep 17 00:00:00 2001 From: Yiyu Zhou Date: Wed, 25 Mar 2026 12:17:45 -0700 Subject: [PATCH 1/4] gnumake: cleanup --- .../tools/build-managers/gnumake/default.nix | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/pkgs/development/tools/build-managers/gnumake/default.nix b/pkgs/development/tools/build-managers/gnumake/default.nix index c6840241c609..65d53dd648d9 100644 --- a/pkgs/development/tools/build-managers/gnumake/default.nix +++ b/pkgs/development/tools/build-managers/gnumake/default.nix @@ -4,19 +4,19 @@ fetchurl, autoreconfHook, gettext, - guileSupport ? false, + gnumake, guile, - texinfo, + guileSupport ? false, # avoid guile depend on bootstrap to prevent dependency cycles inBootstrap ? false, pkg-config, - gnumake, + texinfo, + versionCheckHook, }: let guileEnabled = guileSupport && !inBootstrap; in - stdenv.mkDerivation (finalAttrs: { pname = "gnumake"; version = "4.4.1"; @@ -69,12 +69,16 @@ stdenv.mkDerivation (finalAttrs: { ''; postInstall = lib.optionalString (!inBootstrap) '' - mkdir -p $doc/share/doc/$pname-$version - cp ./make.html $doc/share/doc/$pname-$version/index.html + install -Dm644 make.html \ + --target-directory="$doc"/share/doc/"$pname"-"$version" ''; separateDebugInfo = true; + doCheck = true; + doInstallCheck = true; + nativeInstallCheckInputs = [ versionCheckHook ]; + passthru.tests = { # make sure that the override doesn't break bootstrapping gnumakeWithGuile = gnumake.override { guileSupport = true; }; @@ -84,18 +88,19 @@ stdenv.mkDerivation (finalAttrs: { description = "Tool to control the generation of non-source files from sources"; longDescription = '' Make is a tool which controls the generation of executables and - other non-source files of a program from the program's source files. + other non-source files of a program from the program's source + files. Make gets its knowledge of how to build your program from a file - called the makefile, which lists each of the non-source files and - how to compute it from other files. When you write a program, you - should write a makefile for it, so that it is possible to use Make - to build and install the program. + called the makefile, which lists each of the non-source files + and how to compute it from other files. When you write a + program, you should write a makefile for it, so that it is + possible to use Make to build and install the program. ''; homepage = "https://www.gnu.org/software/make/"; license = lib.licenses.gpl3Plus; - maintainers = [ lib.maintainers.mdaniels5757 ]; mainProgram = "make"; + maintainers = with lib.maintainers; [ mdaniels5757 ]; platforms = lib.platforms.all; }; }) From a0312a1b4cdaf5eac0f5c82ff0b9a0ce1a43d8e5 Mon Sep 17 00:00:00 2001 From: Yiyu Zhou Date: Wed, 25 Mar 2026 12:22:42 -0700 Subject: [PATCH 2/4] gnumake: migrate to by-name --- .../gnumake/default.nix => by-name/gn/gnumake/package.nix} | 0 .../gn}/gnumake/patches/0001-No-impure-bin-sh.patch | 0 .../gn}/gnumake/patches/0002-Remove-impure-dirs.patch | 0 .../0003-Do-not-search-for-a-C-compiler-and-set-MAKE_CXX.patch | 0 .../gnumake/patches/0004-Fix-signatures-for-getenv-getopt.patch | 0 .../gnumake/patches/0005-Fix-signatures-for-getenv-getopt.patch | 0 pkgs/top-level/all-packages.nix | 2 -- 7 files changed, 2 deletions(-) rename pkgs/{development/tools/build-managers/gnumake/default.nix => by-name/gn/gnumake/package.nix} (100%) rename pkgs/{development/tools/build-managers => by-name/gn}/gnumake/patches/0001-No-impure-bin-sh.patch (100%) rename pkgs/{development/tools/build-managers => by-name/gn}/gnumake/patches/0002-Remove-impure-dirs.patch (100%) rename pkgs/{development/tools/build-managers => by-name/gn}/gnumake/patches/0003-Do-not-search-for-a-C-compiler-and-set-MAKE_CXX.patch (100%) rename pkgs/{development/tools/build-managers => by-name/gn}/gnumake/patches/0004-Fix-signatures-for-getenv-getopt.patch (100%) rename pkgs/{development/tools/build-managers => by-name/gn}/gnumake/patches/0005-Fix-signatures-for-getenv-getopt.patch (100%) diff --git a/pkgs/development/tools/build-managers/gnumake/default.nix b/pkgs/by-name/gn/gnumake/package.nix similarity index 100% rename from pkgs/development/tools/build-managers/gnumake/default.nix rename to pkgs/by-name/gn/gnumake/package.nix diff --git a/pkgs/development/tools/build-managers/gnumake/patches/0001-No-impure-bin-sh.patch b/pkgs/by-name/gn/gnumake/patches/0001-No-impure-bin-sh.patch similarity index 100% rename from pkgs/development/tools/build-managers/gnumake/patches/0001-No-impure-bin-sh.patch rename to pkgs/by-name/gn/gnumake/patches/0001-No-impure-bin-sh.patch diff --git a/pkgs/development/tools/build-managers/gnumake/patches/0002-Remove-impure-dirs.patch b/pkgs/by-name/gn/gnumake/patches/0002-Remove-impure-dirs.patch similarity index 100% rename from pkgs/development/tools/build-managers/gnumake/patches/0002-Remove-impure-dirs.patch rename to pkgs/by-name/gn/gnumake/patches/0002-Remove-impure-dirs.patch diff --git a/pkgs/development/tools/build-managers/gnumake/patches/0003-Do-not-search-for-a-C-compiler-and-set-MAKE_CXX.patch b/pkgs/by-name/gn/gnumake/patches/0003-Do-not-search-for-a-C-compiler-and-set-MAKE_CXX.patch similarity index 100% rename from pkgs/development/tools/build-managers/gnumake/patches/0003-Do-not-search-for-a-C-compiler-and-set-MAKE_CXX.patch rename to pkgs/by-name/gn/gnumake/patches/0003-Do-not-search-for-a-C-compiler-and-set-MAKE_CXX.patch diff --git a/pkgs/development/tools/build-managers/gnumake/patches/0004-Fix-signatures-for-getenv-getopt.patch b/pkgs/by-name/gn/gnumake/patches/0004-Fix-signatures-for-getenv-getopt.patch similarity index 100% rename from pkgs/development/tools/build-managers/gnumake/patches/0004-Fix-signatures-for-getenv-getopt.patch rename to pkgs/by-name/gn/gnumake/patches/0004-Fix-signatures-for-getenv-getopt.patch diff --git a/pkgs/development/tools/build-managers/gnumake/patches/0005-Fix-signatures-for-getenv-getopt.patch b/pkgs/by-name/gn/gnumake/patches/0005-Fix-signatures-for-getenv-getopt.patch similarity index 100% rename from pkgs/development/tools/build-managers/gnumake/patches/0005-Fix-signatures-for-getenv-getopt.patch rename to pkgs/by-name/gn/gnumake/patches/0005-Fix-signatures-for-getenv-getopt.patch diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 585a7e4cf9a8..5827ceee04ae 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5756,8 +5756,6 @@ with pkgs; m4 = gnum4; - gnumake = callPackage ../development/tools/build-managers/gnumake { }; - gradle-packages = callPackage ../development/tools/build-managers/gradle { }; gradle_7-unwrapped = gradle-packages.gradle_7; From 2ff762ccf7b402df0d01d9e616ac006c9f1388ca Mon Sep 17 00:00:00 2001 From: Yiyu Zhou Date: Wed, 25 Mar 2026 21:51:07 -0700 Subject: [PATCH 3/4] gnumake: enable strictDeps --- pkgs/by-name/gn/gnumake/package.nix | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/gn/gnumake/package.nix b/pkgs/by-name/gn/gnumake/package.nix index 65d53dd648d9..79716bd7e852 100644 --- a/pkgs/by-name/gn/gnumake/package.nix +++ b/pkgs/by-name/gn/gnumake/package.nix @@ -39,18 +39,16 @@ stdenv.mkDerivation (finalAttrs: { # directory until derivation realization to avoid unnecessary Nix evaluations. patches = lib.filesystem.listFilesRecursive ./patches; + strictDeps = true; + nativeBuildInputs = [ autoreconfHook pkg-config ] - ++ lib.optionals (!inBootstrap) [ texinfo ]; + ++ lib.optionals (!inBootstrap) [ texinfo ] + ++ lib.optional stdenv.isCygwin gettext; - buildInputs = - lib.optionals guileEnabled [ guile ] - # gettext gets pulled in via autoreconfHook because strictDeps is not set, - # and is linked against. Without this, it doesn't end up in HOST_PATH. - # TODO: enable strictDeps, and either make this dependency explicit, or remove it - ++ lib.optional stdenv.isCygwin gettext; + buildInputs = lib.optionals guileEnabled [ guile ]; configureFlags = lib.optional guileEnabled "--with-guile" From ccbc105ed011a7f0fbca4586982900e9d3938bc8 Mon Sep 17 00:00:00 2001 From: Yiyu Zhou Date: Sat, 11 Apr 2026 16:01:19 -0700 Subject: [PATCH 4/4] gnumake: fix nixpkgs-vet --- pkgs/stdenv/linux/default.nix | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index e2c2131eb762..d8c9470e5dfa 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -648,10 +648,6 @@ in inherit (prevStage) expand-response-params; }; - # To allow users' overrides inhibit dependencies too heavy for - # bootstrap, like guile: https://github.com/NixOS/nixpkgs/issues/181188 - gnumake = super.gnumake.override { inBootstrap = true; }; - gcc = lib.makeOverridable (import ../../build-support/cc-wrapper) { nativeTools = false; nativeLibc = false; @@ -869,8 +865,6 @@ in libunistring ; }; - - gnumake = super.gnumake.override { inBootstrap = false; }; } // lib.optionalAttrs (super.stdenv.targetPlatform == localSystem) { # Need to get rid of these when cross-compiling.