From 8bad6906036d4f29d32f844a6914a3c7c97777fe Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sun, 24 Jan 2021 23:21:34 +0000 Subject: [PATCH] autoreconfHook: make overridable Some packages have specific autotools requirements that don't apply to any other packages. We want to be able to use autoreconfHook for these packages with the required autotools versions, but we don't want to have to makeSetupHook for each one, or have a top-level attribute for every combination. So, use callPackage around the makeSetupHook call so that the autotools used by autoreconfHook can be overridden. This way, a custom autoreconfHook can be passed to a package like this: autoreconfHook = with buildPackages; autoreconfHook.override { automake = automake115x; }; And we can simplify the definitions of our existing autoreconfHook264 and autoreconfHook269 attributes. --- pkgs/top-level/all-packages.nix | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 5a1fedf9f538..28417ff643af 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -112,17 +112,21 @@ in { name = "auto-blas-hook"; deps = [ blas lapack ]; } ../build-support/setup-hooks/audit-blas.sh; - autoreconfHook = makeSetupHook - { deps = [ autoconf automake gettext libtool ]; } - ../build-support/setup-hooks/autoreconf.sh; + autoreconfHook = callPackage ( + { makeSetupHook, autoconf, automake, gettext, libtool }: + makeSetupHook + { deps = [ autoconf automake gettext libtool ]; } + ../build-support/setup-hooks/autoreconf.sh + ) { }; - autoreconfHook264 = makeSetupHook - { deps = [ autoconf264 automake111x gettext libtool ]; } - ../build-support/setup-hooks/autoreconf.sh; + autoreconfHook264 = autoreconfHook.override { + autoconf = autoconf264; + automake = automake111x; + }; - autoreconfHook269 = makeSetupHook - { deps = [ autoconf269 automake gettext libtool ]; } - ../build-support/setup-hooks/autoreconf.sh; + autoreconfHook269 = autoreconfHook.override { + autoconf = autoconf269; + }; autoPatchelfHook = makeSetupHook { name = "auto-patchelf-hook"; } ../build-support/setup-hooks/auto-patchelf.sh;