on iko/ghcjs-patch-master help sign in
shellFor: provide CABAL_CONFIG in shell
49eb327Rodney Lorrimar
builder/default.nix+1
@@ -30,5 +30,6 @@ in {
30 # Same as haskellPackages.shellFor in nixpkgs.
30 # Same as haskellPackages.shellFor in nixpkgs.
31 shellFor = haskellLib.weakCallPackage pkgs ./shell-for.nix {
31 shellFor = haskellLib.weakCallPackage pkgs ./shell-for.nix {
32 inherit hsPkgs ghcForComponent makeConfigFiles;
32 inherit hsPkgs ghcForComponent makeConfigFiles;
33+ inherit (buildPackages) glibcLocales;
33 };
34 };
34}
35}
builder/shell-for.nix+14−12
@@ -1,4 +1,4 @@
1−{ buildPackages, lib, stdenv, ghcForComponent, makeConfigFiles, hsPkgs }:
1+{ lib, stdenv, glibcLocales, ghcForComponent, makeConfigFiles, hsPkgs }:
2
2
3{ packages, withHoogle ? true, ... } @ args:
3{ packages, withHoogle ? true, ... } @ args:
4
4
@@ -7,18 +7,19 @@ let
7 name = if lib.length selected == 1
7 name = if lib.length selected == 1
8 then "ghc-shell-for-${(lib.head selected).name}"
8 then "ghc-shell-for-${(lib.head selected).name}"
9 else "ghc-shell-for-packages";
9 else "ghc-shell-for-packages";
10+ configFiles = makeConfigFiles {
11+ fullName = args.name or name;
12+ identifier.name = name;
13+ component = {
14+ depends = selected;
15+ libs = [];
16+ frameworks = [];
17+ doExactConfig = false;
18+ };
19+ };
10 ghcEnv = ghcForComponent {
20 ghcEnv = ghcForComponent {
11 componentName = name;
21 componentName = name;
12− configFiles = makeConfigFiles {
22+ inherit configFiles;
13− fullName = args.name or name;
14− identifier.name = name;
15− component = {
16− depends = selected;
17− libs = [];
18− frameworks = [];
19− doExactConfig = false;
20− };
21− };
22 };
23 };
23 mkDrvArgs = builtins.removeAttrs args ["packages" "withHoogle"];
24 mkDrvArgs = builtins.removeAttrs args ["packages" "withHoogle"];
24
25
@@ -34,7 +35,8 @@ in
34 phases = ["installPhase"];
35 phases = ["installPhase"];
35 installPhase = "echo $nativeBuildInputs $buildInputs > $out";
36 installPhase = "echo $nativeBuildInputs $buildInputs > $out";
36 LANG = "en_US.UTF-8";
37 LANG = "en_US.UTF-8";
37− LOCALE_ARCHIVE = lib.optionalString (stdenv.hostPlatform.libc == "glibc") "${buildPackages.glibcLocales}/lib/locale/locale-archive";
38+ LOCALE_ARCHIVE = lib.optionalString (stdenv.hostPlatform.libc == "glibc") "${glibcLocales}/lib/locale/locale-archive";
39+ CABAL_CONFIG = "${configFiles}/cabal.config";
38
40
39 passthru.ghc = ghcEnv;
41 passthru.ghc = ghcEnv;
40 })
42 })