Merge branch 'callCabal2nix-retain-ifd'
This commit is contained in:
commit
3509c4b7bb
1 changed files with 14 additions and 10 deletions
|
@ -145,17 +145,21 @@ in package-set { inherit pkgs stdenv callPackage; } self // {
|
|||
callHackage = name: version: self.callPackage (self.hackage2nix name version);
|
||||
|
||||
# Creates a Haskell package from a source package by calling cabal2nix on the source.
|
||||
callCabal2nix = name: src: args:
|
||||
overrideCabal (self.callPackage (haskellSrc2nix {
|
||||
inherit name;
|
||||
src =
|
||||
let filter = path: type:
|
||||
callCabal2nix = name: src: args: let
|
||||
filter = path: type:
|
||||
pkgs.lib.hasSuffix "${name}.cabal" path ||
|
||||
baseNameOf path == "package.yaml";
|
||||
in if pkgs.lib.canCleanSource src
|
||||
expr = haskellSrc2nix {
|
||||
inherit name;
|
||||
src = if pkgs.lib.canCleanSource src
|
||||
then pkgs.lib.cleanSourceWith { inherit src filter; }
|
||||
else src;
|
||||
}) args) (_: { inherit src; });
|
||||
};
|
||||
in overrideCabal (self.callPackage expr args) (orig: {
|
||||
inherit src;
|
||||
preConfigure =
|
||||
"# Generated from ${expr}\n${orig.preConfigure or ""}";
|
||||
});
|
||||
|
||||
# : { root : Path
|
||||
# , source-overrides : Defaulted (Either Path VersionNumber)
|
||||
|
|
Loading…
Reference in a new issue