Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autoreconfHook: make overridable #110728

Merged
merged 1 commit into from Feb 2, 2021
Merged

autoreconfHook: make overridable #110728

merged 1 commit into from Feb 2, 2021

Conversation

alyssais
Copy link
Member

Motivation for this change

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.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

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.
@alyssais alyssais requested a review from vcunat January 24, 2021 23:47
@alyssais alyssais merged commit 8bad690 into NixOS:master Feb 2, 2021
@alyssais alyssais deleted the autoreconf branch February 2, 2021 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant