@@ -236,18 +236,20 @@ stdenv.mkDerivation ({
236 "--html" \
236 "--html" \
237 ${lib.optionalString doHoogle "--hoogle"} \
237 ${lib.optionalString doHoogle "--hoogle"} \
238 ${lib.optionalString hyperlinkSource "--hyperlink-source"} \
238 ${lib.optionalString hyperlinkSource "--hyperlink-source"} \
239− ${lib.concatStringsSep " " (component.setupHaddockFlags ++ setupGhcOptions)} \
239+ ${lib.concatStringsSep " " (component.setupHaddockFlags ++ setupGhcOptions)}
241 html="dist/doc/html/${componentId.cname}"
241 html="dist/doc/html/${componentId.cname}"
243+ if [ -d "$html" ]; then
243− # Ensure that libraries are not pulled into the docs closure.
244+ # Ensure that libraries are not pulled into the docs closure.
244− # As an example, the prettified source code of a
245+ # As an example, the prettified source code of a
245− # Paths_package module will contain store paths of the library package.
246+ # Paths_package module will contain store paths of the library package.
246− for x in "$html/src/"*.html; do
247+ for x in "$html/src/"*.html; do
247− remove-references-to -t $out $x
248+ remove-references-to -t $out $x
250− cp -R "$html" "$docdir"/html
251+ cp -R "$html" "$docdir"/html
252 runHook postHaddock
254 runHook postHaddock