on iko/ghcjs-patch-master help sign in
Allow source spec to be a file (#904)
429702eMoritz Angermann
compiler/ghc/configured-src.nix+4−2
@@ -19,7 +19,7 @@ stdenv.mkDerivation (rec {
19 patches = ghc-patches;
19 patches = ghc-patches;
20 name = "${targetPrefix}ghc-${ghc-version}-configured-src";
20 name = "${targetPrefix}ghc-${ghc-version}-configured-src";
21
21
22− # Make sure we never relax`$PATH` and hooks support for compatibility.
22+ # Make sure we never relax`$PATH` and hooks support for compatability.
23 strictDeps = true;
23 strictDeps = true;
24
24
25 nativeBuildInputs = [
25 nativeBuildInputs = [
@@ -40,7 +40,9 @@ stdenv.mkDerivation (rec {
40
40
41 postPatch = "patchShebangs .";
41 postPatch = "patchShebangs .";
42
42
43+ src = if src-spec ? file
44+ then src-spec.file
43− src = fetchurl { inherit (src-spec) url sha256; };
45+ else fetchurl { inherit (src-spec) url sha256; };
44
46
45 # GHC is a bit confused on its cross terminology.
47 # GHC is a bit confused on its cross terminology.
46 preConfigure = ''
48 preConfigure = ''
nix/sources.nix+3−3
@@ -18,8 +18,8 @@ let
18 else
18 else
19 pkgs.fetchzip { inherit (spec) url sha256; };
19 pkgs.fetchzip { inherit (spec) url sha256; };
20
20
21− fetch_git = spec:
21+ fetch_git = pkgs: spec:
22− builtins.fetchGit { url = spec.repo; inherit (spec) rev ref; };
22+ pkgs.fetchgit { url = spec.repo; inherit (spec) rev deepClone sha256; };
23
23
24 fetch_builtin-tarball = spec:
24 fetch_builtin-tarball = spec:
25 builtins.trace
25 builtins.trace
@@ -73,7 +73,7 @@ let
73 abort "ERROR: niv spec ${name} does not have a 'type' attribute"
73 abort "ERROR: niv spec ${name} does not have a 'type' attribute"
74 else if spec.type == "file" then fetch_file pkgs spec
74 else if spec.type == "file" then fetch_file pkgs spec
75 else if spec.type == "tarball" then fetch_tarball pkgs spec
75 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
77 else if spec.type == "builtin-tarball" then fetch_builtin-tarball spec
77 else if spec.type == "builtin-tarball" then fetch_builtin-tarball spec
78 else if spec.type == "builtin-url" then fetch_builtin-url spec
78 else if spec.type == "builtin-url" then fetch_builtin-url spec
79 else
79 else