haskellPackages.callCabal2nix: Depend on the expression.
This ensures that as long as the package derivation is alive, its nix expressions do not need to be regenerated. Fixes #36190.
This commit is contained in:
parent
336eb53f72
commit
62a1abe204
|
@ -145,17 +145,21 @@ in package-set { inherit pkgs stdenv callPackage; } self // {
|
||||||
callHackage = name: version: self.callPackage (self.hackage2nix name version);
|
callHackage = name: version: self.callPackage (self.hackage2nix name version);
|
||||||
|
|
||||||
# Creates a Haskell package from a source package by calling cabal2nix on the source.
|
# Creates a Haskell package from a source package by calling cabal2nix on the source.
|
||||||
callCabal2nix = name: src: args:
|
callCabal2nix = name: src: args: let
|
||||||
overrideCabal (self.callPackage (haskellSrc2nix {
|
filter = path: type:
|
||||||
inherit name;
|
|
||||||
src =
|
|
||||||
let filter = path: type:
|
|
||||||
pkgs.lib.hasSuffix "${name}.cabal" path ||
|
pkgs.lib.hasSuffix "${name}.cabal" path ||
|
||||||
baseNameOf path == "package.yaml";
|
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; }
|
then pkgs.lib.cleanSourceWith { inherit src filter; }
|
||||||
else src;
|
else src;
|
||||||
}) args) (_: { inherit src; });
|
};
|
||||||
|
in overrideCabal (self.callPackage expr args) (orig: {
|
||||||
|
inherit src;
|
||||||
|
preConfigure =
|
||||||
|
"# Generated from ${expr}\n${orig.preConfigure or ""}";
|
||||||
|
});
|
||||||
|
|
||||||
# : { root : Path
|
# : { root : Path
|
||||||
# , source-overrides : Defaulted (Either Path VersionNumber)
|
# , source-overrides : Defaulted (Either Path VersionNumber)
|
||||||
|
|
Loading…
Reference in New Issue