ghcWithHoogle: fix for ghcjs

`haskell.packages.ghcjs.ghcWithHoogle` failed because the following line:

  for docdir in ${ghc.doc}/${docLibGlob}/*; do

failed because `doc` is not an attribute of `ghc` when `ghc` is
substituted for ghcjs.
This commit is contained in:
Bas van Dijk 2017-02-14 22:50:29 +01:00
parent 544ac40ab3
commit 057fae5ea0

View File

@ -40,14 +40,14 @@ let
if !isGhcjs if !isGhcjs
then "ghc" then "ghc"
else "ghcjs"; else "ghcjs";
docLibGlob = ghcDocLibDir =
if !isGhcjs if !isGhcjs
then ''share/doc/ghc*/html/libraries'' then ghc.doc + ''/share/doc/ghc*/html/libraries''
else ''doc/lib''; else ghc + ''/doc/lib'';
# On GHCJS, use a stripped down version of GHC's prologue.txt # On GHCJS, use a stripped down version of GHC's prologue.txt
prologue = prologue =
if !isGhcjs if !isGhcjs
then "${ghc.doc}/${docLibGlob}/prologue.txt" then "${ghcDocLibDir}/prologue.txt"
else writeText "ghcjs-prologue.txt" '' else writeText "ghcjs-prologue.txt" ''
This index includes documentation for many Haskell modules. This index includes documentation for many Haskell modules.
''; '';
@ -67,7 +67,7 @@ stdenv.mkDerivation {
mkdir -p $out/share/doc/hoogle mkdir -p $out/share/doc/hoogle
echo importing builtin packages echo importing builtin packages
for docdir in ${ghc.doc}/${docLibGlob}/*; do for docdir in ${ghcDocLibDir}/*; do
name="$(basename $docdir)" name="$(basename $docdir)"
${opts isGhcjs ''docdir="$docdir/html"''} ${opts isGhcjs ''docdir="$docdir/html"''}
if [[ -d $docdir ]]; then if [[ -d $docdir ]]; then