Merge pull request #44424 from dhess/callCaball2nixWithOption
haskell-modules: add callCabal2nixWithOptions.
This commit is contained in:
commit
d05a8bb410
@ -177,19 +177,22 @@ in package-set { inherit pkgs stdenv callPackage; } self // {
|
||||
callHackage = name: version: callPackageKeepDeriver (self.hackage2nix name version);
|
||||
|
||||
# Creates a Haskell package from a source package by calling cabal2nix on the source.
|
||||
callCabal2nix = name: src: args: let
|
||||
filter = path: type:
|
||||
pkgs.lib.hasSuffix "${name}.cabal" path ||
|
||||
baseNameOf path == "package.yaml";
|
||||
expr = self.haskellSrc2nix {
|
||||
inherit name;
|
||||
src = if pkgs.lib.canCleanSource src
|
||||
then pkgs.lib.cleanSourceWith { inherit src filter; }
|
||||
else src;
|
||||
};
|
||||
in overrideCabal (callPackageKeepDeriver expr args) (orig: {
|
||||
inherit src;
|
||||
});
|
||||
callCabal2nixWithOptions = name: src: extraCabal2nixOptions: args:
|
||||
let
|
||||
filter = path: type:
|
||||
pkgs.lib.hasSuffix "${name}.cabal" path ||
|
||||
baseNameOf path == "package.yaml";
|
||||
expr = self.haskellSrc2nix {
|
||||
inherit name extraCabal2nixOptions;
|
||||
src = if pkgs.lib.canCleanSource src
|
||||
then pkgs.lib.cleanSourceWith { inherit src filter; }
|
||||
else src;
|
||||
};
|
||||
in overrideCabal (callPackageKeepDeriver expr args) (orig: {
|
||||
inherit src;
|
||||
});
|
||||
|
||||
callCabal2nix = name: src: args: self.callCabal2nixWithOptions name src "" args;
|
||||
|
||||
# : { root : Path
|
||||
# , source-overrides : Defaulted (Either Path VersionNumber)
|
||||
|
Loading…
Reference in New Issue
Block a user