about summary refs log tree commit diff
path: root/pkgs/stdenv
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2019-04-16 22:51:26 -0400
committerMatthew Bauer <mjbauer95@gmail.com>2019-04-16 22:51:26 -0400
commitc7ccb9f197789e424a70a878b9f967ddf38d39c6 (patch)
treedf47426342467c66305e375a68f0f5850869fef4 /pkgs/stdenv
parentef54604ce473400f866ec5d415271226706f113b (diff)
downloadnixlib-c7ccb9f197789e424a70a878b9f967ddf38d39c6.tar
nixlib-c7ccb9f197789e424a70a878b9f967ddf38d39c6.tar.gz
nixlib-c7ccb9f197789e424a70a878b9f967ddf38d39c6.tar.bz2
nixlib-c7ccb9f197789e424a70a878b9f967ddf38d39c6.tar.lz
nixlib-c7ccb9f197789e424a70a878b9f967ddf38d39c6.tar.xz
nixlib-c7ccb9f197789e424a70a878b9f967ddf38d39c6.tar.zst
nixlib-c7ccb9f197789e424a70a878b9f967ddf38d39c6.zip
make-derivation: put patches in all derivations
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.
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r--pkgs/stdenv/generic/make-derivation.nix4
1 files changed, 4 insertions, 0 deletions
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;