From c7ccb9f197789e424a70a878b9f967ddf38d39c6 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 16 Apr 2019 22:51:26 -0400 Subject: make-derivation: put patches in all derivations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This puts patches in all derivations even if it unspecified by the derivation. By default it will be an empty list. This simplifies overrides, as we can now assume that patches is a valid name so that this works: self: super: { mypkg = super.pkg.overrideAttrs (o: { patches = o.patches ++ [ ./my-very-own.patch ]; }); } That is, you don’t need to provide a default "or []", make-derivation provides one for you. Unfortunately, this is a mass rebuild. --- pkgs/stdenv/generic/make-derivation.nix | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pkgs/stdenv/generic') diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index 417c10363b52..ad52503548af 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -86,6 +86,8 @@ in rec { , hardeningEnable ? [] , hardeningDisable ? [] + , patches ? [] + , ... } @ attrs: let @@ -235,6 +237,8 @@ in rec { ++ optional (elem "host" configurePlatforms) "--host=${stdenv.hostPlatform.config}" ++ optional (elem "target" configurePlatforms) "--target=${stdenv.targetPlatform.config}"; + inherit patches; + inherit doCheck doInstallCheck; inherit outputs; -- cgit 1.4.1