Merge pull request #70192 from obsidiansystems/call-hackage-cross

haskell: Speed up cross callHackage by using native source
This commit is contained in:
Peter Simons 2019-10-02 22:15:48 +02:00 committed by GitHub
commit 31714a442d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -122,9 +122,9 @@ let
haskellSrc2nix = { name, src, sha256 ? null, extraCabal2nixOptions ? "" }:
let
sha256Arg = if sha256 == null then "--sha256=" else ''--sha256="${sha256}"'';
in pkgs.buildPackages.stdenv.mkDerivation {
in buildPackages.stdenv.mkDerivation {
name = "cabal2nix-${name}";
nativeBuildInputs = [ pkgs.buildPackages.cabal2nix ];
nativeBuildInputs = [ buildPackages.cabal2nix ];
preferLocalBuild = true;
allowSubstitutes = false;
phases = ["installPhase"];
@ -137,7 +137,7 @@ let
'';
};
all-cabal-hashes-component = name: version: pkgs.runCommand "all-cabal-hashes-component-${name}-${version}" {} ''
all-cabal-hashes-component = name: version: buildPackages.runCommand "all-cabal-hashes-component-${name}-${version}" {} ''
tar --wildcards -xzvf ${all-cabal-hashes} \*/${name}/${version}/${name}.{json,cabal}
mkdir -p $out
mv */${name}/${version}/${name}.{json,cabal} $out