on iko/ghcjs-patch-master help sign in
Allow source spec to be a file (#904)
commit429702eabf881cfb723fa7ac25fcae7a0da3b873 authorMoritz Angermann <moritz.angermann@gmail.com> dateSat 31 Oct 2020, 15:04 (6 years ago) parentb40a90b
2 files changed+7−5
compiler/ghc/configured-src.nix+4−2 nix/sources.nix+3−3
compiler/ghc/configured-src.nix+4−2
@@ -19,7 +19,7 @@ stdenv.mkDerivation (rec {
1919 patches = ghc-patches;
2020 name = "${targetPrefix}ghc-${ghc-version}-configured-src";
2121
22− # Make sure we never relax`$PATH` and hooks support for compatibility.
22+ # Make sure we never relax`$PATH` and hooks support for compatability.
2323 strictDeps = true;
2424
2525 nativeBuildInputs = [
@@ -40,7 +40,9 @@ stdenv.mkDerivation (rec {
4040
4141 postPatch = "patchShebangs .";
4242
43− src = fetchurl { inherit (src-spec) url sha256; };
43+ src = if src-spec ? file
44+ then src-spec.file
45+ else fetchurl { inherit (src-spec) url sha256; };
4446
4547 # GHC is a bit confused on its cross terminology.
4648 preConfigure = ''
nix/sources.nix+3−3
@@ -18,8 +18,8 @@ let
1818 else
1919 pkgs.fetchzip { inherit (spec) url sha256; };
2020
21− fetch_git = spec:
22− builtins.fetchGit { url = spec.repo; inherit (spec) rev ref; };
21+ fetch_git = pkgs: spec:
22+ pkgs.fetchgit { url = spec.repo; inherit (spec) rev deepClone sha256; };
2323
2424 fetch_builtin-tarball = spec:
2525 builtins.trace
@@ -73,7 +73,7 @@ let
7373 abort "ERROR: niv spec ${name} does not have a 'type' attribute"
7474 else if spec.type == "file" then fetch_file pkgs spec
7575 else if spec.type == "tarball" then fetch_tarball pkgs spec
76− else if spec.type == "git" then fetch_git spec
76+ else if spec.type == "git" then fetch_git pkgs spec
7777 else if spec.type == "builtin-tarball" then fetch_builtin-tarball spec
7878 else if spec.type == "builtin-url" then fetch_builtin-url spec
7979 else