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 4141 # component builder and for nix-shells.
4242 ghcForComponent = import ./ghc-for-component-wrapper.nix {
4343 inherit lib ghc haskellLib ;
44- inherit ( buildPackages ) stdenv ;
44+ inherit ( pkgs ) stdenv ;
4545 inherit ( buildPackages . buildPackages ) runCommand makeWrapper ;
4646 inherit ( buildPackages . buildPackages . xorg ) lndir ;
4747 } ;
Original file line number Diff line number Diff line change 1414, postInstall ? ""
1515, enableDWARF
1616, plugins
17+ , ghcOptions ? [ ]
1718} :
1819
1920let
107108 --set "NIX_${ ghcCommandCaps } PKG" "$wrappedGhc/bin/${ ghcCommand } -pkg" \
108109 --set "NIX_${ ghcCommandCaps } _DOCDIR" "${ docDir } " \
109110 --set "GHC_PLUGINS" "$GHC_PLUGINS" \
110- --set "NIX_${ ghcCommandCaps } _LIBDIR" "${ libDir } "
111+ --set "NIX_${ ghcCommandCaps } _LIBDIR" "${ libDir } "${ lib . concatMapStrings ( o : " --add-flags ${ o } " ) ghcOptions }
111112 fi
112113 done
113114
159160 inherit script targetPrefix ;
160161 inherit ( ghc ) version meta ;
161162 } ;
162- propagatedBuildInputs = configFiles . libDeps ;
163- nativeBuildInputs = [ ghc ] ;
163+ propagatedBuildInputs = configFiles . libDeps ++ [ stdenv . cc ghc ] ;
164164} ( ''
165165 mkdir -p $out/configFiles
166166 configFiles=$out/configFiles
Original file line number Diff line number Diff line change 143143 '' ;
144144 inherit enableDWARF ;
145145 plugins = [ ] ;
146+ ghcOptions = haskell-nix . templateHaskell . ${ compiler . nix-name } . ghcOptions or [ ] ;
146147 } ;
147148
148149 hoogleIndex = let
192193 '' } $(builtin type -P "${ ghcEnv . targetPrefix } pkg-config" &> /dev/null && echo "--with-pkg-config=${ ghcEnv . targetPrefix } pkg-config") \
193194 "$@"
194195 '' ) ;
196+ propagatedBuildInputs = mkDrvArgs . propagateBuildInputs or [ ] ++ ghcEnv . drv . propagatedBuildInputs ;
195197 phases = [ "installPhase" ] ;
196198 installPhase = ''
197199 echo "${ "Shell for " + toString ( builtins . map ( p : p . identifier . name ) selectedPackages ) } "
198200 echo $nativeBuildInputs $buildInputs > $out
199201 '' ;
202+ shellHook = mkDrvArgs . shellHook or "" + lib . optionalString stdenv . hostPlatform . isWindows ''
203+
204+ export pkgsHostTargetAsString="'' ${pkgsHostTarget[@]}"
205+ '' ;
200206
201207 # This helps tools like `ghcide` (that use the ghc api) to find
202208 # the correct global package DB.
Original file line number Diff line number Diff line change 77 project = externalInterpreter : project' {
88 inherit compiler-nix-name evalPackages ;
99 src = testSrc "th-dlls" ;
10- cabalProjectLocal = builtins . readFile ../cabal.project.local ;
1110 modules = import ../modules.nix ++ [ ( { pkgs , ...} : lib . optionalAttrs externalInterpreter {
1211 packages . th-dlls . components . library . ghcOptions = [ "-fexternal-interpreter" ] ;
1312 # Static openssl seems to fail to load in iserv for musl
1413 packages . HsOpenSSL . components . library . libs = lib . optional pkgs . stdenv . hostPlatform . isMusl ( pkgs . openssl . override { static = false ; } ) ;
1514 } ) ] ;
15+ shell . nativeBuildInputs = [ buildPackages . haskell-nix . nix-tools-unchecked . exes . cabal ] ;
1616 } ;
1717
1818 packages = ( project false ) . hsPkgs ;
You can’t perform that action at this time.
0 commit comments