@@ -20,8 +20,6 @@
2020, preHaddock ? component.preHaddock , postHaddock ? component.postHaddock
2121, shellHook ? ""
2222
23−, doCheck ? component.doCheck || haskellLib.isTest componentId
24−, doCrossCheck ? component.doCrossCheck || false
2523, dontPatchELF ? true
2624, dontStrip ? true
2725
@@ -128,13 +126,7 @@ let
128126
129127 exeExt = lib.optionalString stdenv.hostPlatform.isWindows ".exe";
130128 testExecutable = "dist/build/${componentId.cname}/${componentId.cname}${exeExt}";
131− # exe components are in /bin, but test and benchmarks are not. Perhaps to avoid
132− # them being from being added to the PATH when the all component added to an env.
133− # TODO revist this to find out why and document or maybe change this.
134− installedExeDir = if haskellLib.isTest componentId || haskellLib.isBenchmark componentId
135− then name
136− else "bin";
137− installedExe = "${installedExeDir}/${componentId.cname}${exeExt}";
129+ installedExe = "bin/${componentId.cname}${exeExt}";
138130
139131in stdenv.lib.fix (drv:
140132
@@ -143,20 +135,20 @@ stdenv.mkDerivation ({
143135
144136 src = cleanSrc;
145137
146− inherit doCheck doCrossCheck dontPatchELF dontStrip;
138+ doCheck = false;
139+ doCrossCheck = false;
140+
141+ inherit dontPatchELF dontStrip;
147142
148143 passthru = {
149144 inherit (package) identifier;
150145 config = component;
151− inherit configFiles executableToolDepends cleanSrc;
146+ inherit configFiles executableToolDepends cleanSrc installedExe;
152147 env = shellWrappers;
153148
154149 # The directory containing the haddock documentation.
155150 # `null' if no haddock documentation was built.
156151 haddockDir = if doHaddock' then "${docdir drv.doc}/html" else null;
157− run = runCommand (fullName + "-run") {} ''
158− ${toString component.testWrapper} ${drv}/${installedExe} | tee $out
159− '';
160152 };
161153
162154 meta = {
@@ -217,13 +209,7 @@ stdenv.mkDerivation ({
217209 runHook postBuild
218210 '';
219211
220− checkPhase = ''
221− runHook preCheck
222−
223− ${toString component.testWrapper} ${testExecutable} ${lib.concatStringsSep " " component.testFlags}
224−
225− runHook postCheck
226− '';
212+ checkPhase = "notice: Tests are only executed by building the .run sub-derivation of this component.";
227213
228214 haddockPhase = ''
229215 runHook preHaddock
@@ -281,25 +267,25 @@ stdenv.mkDerivation ({
281267 fi
282268 ''}
283269 ${(lib.optionalString (haskellLib.isTest componentId || haskellLib.isBenchmark componentId || haskellLib.isAll componentId) ''
284− mkdir -p $out/${name}
270+ mkdir -p $out/bin
285271 if [ -f ${testExecutable} ]; then
286− cp ${testExecutable} $out/${name}/
272+ cp ${testExecutable} $out/bin/
287273 fi
288274 '')
289275 # In case `setup copy` did not creat this
290276 + (lib.optionalString enableSeparateDataOutput "mkdir -p $data")
291277 + (lib.optionalString (stdenv.hostPlatform.isWindows && (haskellLib.mayHaveExecutable componentId)) ''
292− echo "Copying libffi and gmp .dlls ..."
278+ echo "Symlink libffi and gmp .dlls ..."
293279 for p in ${lib.concatStringsSep " " [ libffi gmp ]}; do
294− find "$p" -iname '*.dll' -exec cp {} $out/${installedExeDir} \;
280+ find "$p" -iname '*.dll' -exec ln -s {} $out/bin \;
295281 done
296− # copy all .dlls into the local directory.
282+ # symlink all .dlls into the local directory.
297283 # we ask ghc-pkg for *all* dynamic-library-dirs and then iterate over the unique set
298− # to copy over dlls as needed.
299− echo "Copying library dependencies..."
284+ # to symlink over dlls as needed.
285+ echo "Symlink library dependencies..."
300286 for libdir in $(x86_64-pc-mingw32-ghc-pkg --package-db=$packageConfDir field "*" dynamic-library-dirs --simple-output|xargs|sed 's/ /\n/g'|sort -u); do
301287 if [ -d "$libdir" ]; then
302− find "$libdir" -iname '*.dll' -exec cp {} $out/${installedExeDir} \;
288+ find "$libdir" -iname '*.dll' -exec ln -s {} $out/bin \;
303289 fi
304290 done
305291 '')
@@ -316,7 +302,7 @@ stdenv.mkDerivation ({
316302// lib.optionalAttrs (patches != []) { patches = map (p: if builtins.isFunction p then p { inherit (package.identifier) version; inherit revision; } else p) patches; }
317303// haskellLib.optionalHooks {
318304 inherit preUnpack postUnpack preConfigure postConfigure
319− preBuild postBuild preCheck postCheck
305+ preBuild postBuild
320306 preInstall postInstall preHaddock postHaddock;
321307}
322308// lib.optionalAttrs (stdenv.buildPlatform.libc == "glibc"){ LOCALE_ARCHIVE = "${buildPackages.glibcLocales}/lib/locale/locale-archive"; }