@@ -239,6 +239,7 @@ let
240 mkdir -p $out/ghc
240 mkdir -p $out/ghc
241 mkdir -p $out/ghc-pkg
241 mkdir -p $out/ghc-pkg
242+ ${ghc.targetPrefix}ghc --version > $out/ghc/version
242 ${ghc.targetPrefix}ghc --numeric-version > $out/ghc/numeric-version
243 ${ghc.targetPrefix}ghc --numeric-version > $out/ghc/numeric-version
243 ${ghc.targetPrefix}ghc --info | grep -v /nix/store > $out/ghc/info
244 ${ghc.targetPrefix}ghc --info | grep -v /nix/store > $out/ghc/info
244 ${ghc.targetPrefix}ghc --supported-languages > $out/ghc/supported-languages
245 ${ghc.targetPrefix}ghc --supported-languages > $out/ghc/supported-languages
@@ -269,14 +270,32 @@ let
269 executable = true;
270 executable = true;
270 destination = "/bin/${ghc.targetPrefix}ghc";
271 destination = "/bin/${ghc.targetPrefix}ghc";
271 text = ''
272 text = ''
273+ #!${pkgs.evalPackages.runtimeShell}
276+ cat ${dummy-ghc-data}/ghc/version
272− if [ "'$*'" == "'--numeric-version'" ]; then cat ${dummy-ghc-data}/ghc/numeric-version;
279+ cat ${dummy-ghc-data}/ghc/numeric-version
281+ --supported-languages)
273− elif [ "'$*'" == "'--supported-languages'" ]; then cat ${dummy-ghc-data}/ghc/supported-languages;
282+ cat ${dummy-ghc-data}/ghc/supported-languages
274− elif [ "'$*'" == "'--print-global-package-db'" ]; then echo $out/dumby-db;
284+ --print-global-package-db)
285+ echo "$out/dumby-db"
275− elif [ "'$*'" == "'--info'" ]; then cat ${dummy-ghc-data}/ghc/info;
288+ cat ${dummy-ghc-data}/ghc/info
276− elif [ "'$*'" == "'--print-libdir'" ]; then echo ${dummy-ghc-data}/ghc/libdir;
291+ echo ${dummy-ghc-data}/ghc/libdir
279− fi
294+ echo "Unknown argment '$*'" >&2
@@ -286,11 +305,20 @@ let
286 executable = true;
305 executable = true;
287 destination = "/bin/${ghc.targetPrefix}ghc-pkg";
306 destination = "/bin/${ghc.targetPrefix}ghc-pkg";
288 text = ''
307 text = ''
308+ #!${pkgs.evalPackages.runtimeShell}
289− if [ "'$*'" == "'--version'" ]; then cat ${dummy-ghc-data}/ghc-pkg/version;
311+ cat ${dummy-ghc-data}/ghc-pkg/version
313+ 'dump --global -v0')
290− elif [ "'$*'" == "'dump --global -v0'" ]; then cat ${dummy-ghc-data}/ghc-pkg/dump-global;
314+ cat ${dummy-ghc-data}/ghc-pkg/dump-global
293− fi
317+ echo "Unknown argment '$*'" >&2