File tree Expand file tree Collapse file tree 4 files changed +11
-5
lines changed Expand file tree Collapse file tree 4 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 41
41
# component builder and for nix-shells.
42
42
ghcForComponent = import ./ghc-for-component-wrapper.nix {
43
43
inherit lib ghc haskellLib ;
44
- inherit ( buildPackages ) stdenv ;
44
+ inherit ( pkgs ) stdenv ;
45
45
inherit ( buildPackages . buildPackages ) runCommand makeWrapper ;
46
46
inherit ( buildPackages . buildPackages . xorg ) lndir ;
47
47
} ;
Original file line number Diff line number Diff line change 14
14
, postInstall ? ""
15
15
, enableDWARF
16
16
, plugins
17
+ , ghcOptions ? [ ]
17
18
} :
18
19
19
20
let
107
108
--set "NIX_${ ghcCommandCaps } PKG" "$wrappedGhc/bin/${ ghcCommand } -pkg" \
108
109
--set "NIX_${ ghcCommandCaps } _DOCDIR" "${ docDir } " \
109
110
--set "GHC_PLUGINS" "$GHC_PLUGINS" \
110
- --set "NIX_${ ghcCommandCaps } _LIBDIR" "${ libDir } "
111
+ --set "NIX_${ ghcCommandCaps } _LIBDIR" "${ libDir } "${ lib . concatMapStrings ( o : " --add-flags ${ o } " ) ghcOptions }
111
112
fi
112
113
done
113
114
159
160
inherit script targetPrefix ;
160
161
inherit ( ghc ) version meta ;
161
162
} ;
162
- propagatedBuildInputs = configFiles . libDeps ;
163
- nativeBuildInputs = [ ghc ] ;
163
+ propagatedBuildInputs = configFiles . libDeps ++ [ stdenv . cc ghc ] ;
164
164
} ( ''
165
165
mkdir -p $out/configFiles
166
166
configFiles=$out/configFiles
Original file line number Diff line number Diff line change 143
143
'' ;
144
144
inherit enableDWARF ;
145
145
plugins = [ ] ;
146
+ ghcOptions = haskell-nix . templateHaskell . ${ compiler . nix-name } . ghcOptions or [ ] ;
146
147
} ;
147
148
148
149
hoogleIndex = let
192
193
'' } $(builtin type -P "${ ghcEnv . targetPrefix } pkg-config" &> /dev/null && echo "--with-pkg-config=${ ghcEnv . targetPrefix } pkg-config") \
193
194
"$@"
194
195
'' ) ;
196
+ propagatedBuildInputs = mkDrvArgs . propagateBuildInputs or [ ] ++ ghcEnv . drv . propagatedBuildInputs ;
195
197
phases = [ "installPhase" ] ;
196
198
installPhase = ''
197
199
echo "${ "Shell for " + toString ( builtins . map ( p : p . identifier . name ) selectedPackages ) } "
198
200
echo $nativeBuildInputs $buildInputs > $out
199
201
'' ;
202
+ shellHook = mkDrvArgs . shellHook or "" + lib . optionalString stdenv . hostPlatform . isWindows ''
203
+
204
+ export pkgsHostTargetAsString="'' ${pkgsHostTarget[@]}"
205
+ '' ;
200
206
201
207
# This helps tools like `ghcide` (that use the ghc api) to find
202
208
# the correct global package DB.
Original file line number Diff line number Diff line change 7
7
project = externalInterpreter : project' {
8
8
inherit compiler-nix-name evalPackages ;
9
9
src = testSrc "th-dlls" ;
10
- cabalProjectLocal = builtins . readFile ../cabal.project.local ;
11
10
modules = import ../modules.nix ++ [ ( { pkgs , ...} : lib . optionalAttrs externalInterpreter {
12
11
packages . th-dlls . components . library . ghcOptions = [ "-fexternal-interpreter" ] ;
13
12
# Static openssl seems to fail to load in iserv for musl
14
13
packages . HsOpenSSL . components . library . libs = lib . optional pkgs . stdenv . hostPlatform . isMusl ( pkgs . openssl . override { static = false ; } ) ;
15
14
} ) ] ;
15
+ shell . nativeBuildInputs = [ buildPackages . haskell-nix . nix-tools-unchecked . exes . cabal ] ;
16
16
} ;
17
17
18
18
packages = ( project false ) . hsPkgs ;
You can’t perform that action at this time.
0 commit comments