haskell-ng: expose Hackage's revision number in hackage-packages.nix and use it to generate stable download URLs for edited Cabal files
Fixes https://github.com/NixOS/nixpkgs/issues/6914.
This commit is contained in:
parent
e77ad8855a
commit
013b12a54c
@ -3,7 +3,7 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
{ pname
|
{ pname
|
||||||
, version
|
, version, revision ? null
|
||||||
, sha256 ? null
|
, sha256 ? null
|
||||||
, src ? fetchurl { url = "mirror://hackage/${pname}-${version}.tar.gz"; inherit sha256; }
|
, src ? fetchurl { url = "mirror://hackage/${pname}-${version}.tar.gz"; inherit sha256; }
|
||||||
, buildDepends ? []
|
, buildDepends ? []
|
||||||
@ -46,6 +46,7 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
assert pkgconfigDepends != [] -> pkgconfig != null;
|
assert pkgconfigDepends != [] -> pkgconfig != null;
|
||||||
|
assert editedCabalFile != null -> revision != null;
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
@ -53,8 +54,9 @@ let
|
|||||||
concatStringsSep enableFeature optionalAttrs;
|
concatStringsSep enableFeature optionalAttrs;
|
||||||
|
|
||||||
newCabalFile = fetchurl {
|
newCabalFile = fetchurl {
|
||||||
url = "http://hackage.haskell.org/package/${pname}-${version}/${pname}.cabal";
|
url = "http://hackage.haskell.org/package/${pname}-${version}/revision/${revision}.cabal";
|
||||||
sha256 = editedCabalFile;
|
sha256 = editedCabalFile;
|
||||||
|
name = "${pname}-${version}-r${revision}.cabal";
|
||||||
};
|
};
|
||||||
|
|
||||||
defaultSetupHs = builtins.toFile "Setup.hs" ''
|
defaultSetupHs = builtins.toFile "Setup.hs" ''
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user