@@ -169,18 +169,22 @@ let
169169 optionals doCheck testPkgconfigDepends ++ optionals doBenchmark benchmarkPkgconfigDepends;
170170
171171 nativeBuildInputs = [ ghc nativeGhc removeReferencesTo ] ++ optional (allPkgconfigDepends != []) pkgconfig ++
172+ setupHaskellDepends ++
172173 buildTools ++ libraryToolDepends ++ executableToolDepends;
173174 propagatedBuildInputs = buildDepends ++ libraryHaskellDepends ++ executableHaskellDepends;
174− otherBuildInputs = setupHaskellDepends ++ extraLibraries ++ librarySystemDepends ++ executableSystemDepends ++
175+ otherBuildInputs = extraLibraries ++ librarySystemDepends ++ executableSystemDepends ++
175176 allPkgconfigDepends ++
176177 optionals doCheck (testDepends ++ testHaskellDepends ++ testSystemDepends ++ testToolDepends) ++
177178 optionals doBenchmark (benchmarkDepends ++ benchmarkHaskellDepends ++ benchmarkSystemDepends ++ benchmarkToolDepends);
179+
178180 allBuildInputs = propagatedBuildInputs ++ otherBuildInputs;
179181
180182 haskellBuildInputs = stdenv.lib.filter isHaskellPkg allBuildInputs;
181183 systemBuildInputs = stdenv.lib.filter isSystemPkg allBuildInputs;
182184
183− ghcEnv = ghc.withPackages (p: haskellBuildInputs);
185+ # When not cross compiling, also include Setup.hs dependencies.
186+ ghcEnv = ghc.withPackages (p:
187+ haskellBuildInputs ++ stdenv.lib.optional (!isCross) setupHaskellDepends);
184188
185189 setupCommand = "./Setup";
186190