Add support for pathes
That is setting
```nix
{
packages.$pkg.patches = [ ... ];
}
```
to set patches on a package.
commit4437439f0ea0a06024e55fe839cbcf341b676136
authorMoritz Angermann <moritz.angermann@gmail.com>
dateMon 5 Nov 2018, 16:26 (8 years ago)
parentf2b80ee
builder/comp-builder.nix+3−2
@@ -8,6 +8,7 @@
88, src
99, flags
1010, cabalFile
11+, patches ? []
1112}:
1213
1314let
@@ -79,7 +80,7 @@ let
7980 ) ++ component.configureFlags
8081 );
8182
82−in stdenv.mkDerivation {
83+in stdenv.mkDerivation ({
8384 name = fullName;
8485
8586 inherit src;
@@ -142,4 +143,4 @@ in stdenv.mkDerivation {
142143 ${ghc.targetPrefix}ghc-pkg --package-db ${configFiles}/package.conf.d -f $out/package.conf.d register ${name}.conf
143144 ''}
144145 '';
145−}
146+} // lib.optionalAttrs (patches != []) { inherit patches; })
builder/default.nix+2−1
@@ -9,6 +9,7 @@
99, src
1010, revision
1111, revisionSha256
12+, patches
1213
1314, ...
1415}@config:
@@ -57,7 +58,7 @@ let
5758 comp-builder = haskellLib.weakCallPackage pkgs ./comp-builder.nix { inherit ghc haskellLib nonReinstallablePkgs; };
5859
5960 buildComp = componentId: component: comp-builder {
60− inherit componentId component package name src flags setup cabalFile;
61+ inherit componentId component package name src flags setup cabalFile patches;
6162 };
6263
6364in {
modules/package.nix+4
@@ -177,5 +177,9 @@ in {
177177 type = nullOr str;
178178 default = null;
179179 };
180+ patches = mkOption {
181+ type = listOf path;
182+ default = [];
183+ };
180184 };
181185}