Skip to content

Commit 2b29320

Browse files
committed
fixup! Build without GHC environment files, instead using wrappers
1 parent f2b98a0 commit 2b29320

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

builder/with-package-wrapper.nix

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ in runCommand "${ghc.name}-with-${package.identifier.name}" {
6666
fi
6767
done
6868
69+
# Wrap haddock, if the base GHC provides it.
70+
if [[ -x "${ghc}/bin/haddock" ]]; then
71+
rm -f $out/bin/haddock
72+
makeWrapper ${ghc}/bin/haddock $out/bin/haddock \
73+
--add-flags '"-B$NIX_${ghcCommandCaps}_LIBDIR"' \
74+
--set "NIX_${ghcCommandCaps}_LIBDIR" "${libDir}"
75+
fi
76+
6977
# Point ghc-pkg to the package database of the component using the
7078
# --global-package-db flag.
7179
@@ -75,13 +83,5 @@ in runCommand "${ghc.name}-with-${package.identifier.name}" {
7583
makeWrapper ${ghc}/bin/$prg $out/bin/$prg --add-flags "--global-package-db=${packageCfgDir}"
7684
fi
7785
done
78-
79-
# fixme: check if this is needed
80-
# haddock was referring to the base ghc, https://github.com/NixOS/nixpkgs/issues/36976
81-
if [[ -x "${ghc}/bin/haddock" ]]; then
82-
rm -f $out/bin/haddock
83-
makeWrapper ${ghc}/bin/haddock $out/bin/haddock \
84-
--set "NIX_${ghcCommandCaps}_LIBDIR" "${libDir}"
85-
fi
8686
''
8787
)

0 commit comments

Comments
 (0)