From 057fae5ea0e6efa7356f444b505294267e6427d5 Mon Sep 17 00:00:00 2001 From: Bas van Dijk Date: Tue, 14 Feb 2017 22:50:29 +0100 Subject: [PATCH] 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. --- pkgs/development/haskell-modules/hoogle.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/development/haskell-modules/hoogle.nix b/pkgs/development/haskell-modules/hoogle.nix index a0b90962829..b6063f6ef97 100644 --- a/pkgs/development/haskell-modules/hoogle.nix +++ b/pkgs/development/haskell-modules/hoogle.nix @@ -40,14 +40,14 @@ let if !isGhcjs then "ghc" else "ghcjs"; - docLibGlob = + ghcDocLibDir = if !isGhcjs - then ''share/doc/ghc*/html/libraries'' - else ''doc/lib''; + then ghc.doc + ''/share/doc/ghc*/html/libraries'' + else ghc + ''/doc/lib''; # On GHCJS, use a stripped down version of GHC's prologue.txt prologue = if !isGhcjs - then "${ghc.doc}/${docLibGlob}/prologue.txt" + then "${ghcDocLibDir}/prologue.txt" else writeText "ghcjs-prologue.txt" '' This index includes documentation for many Haskell modules. ''; @@ -67,7 +67,7 @@ stdenv.mkDerivation { mkdir -p $out/share/doc/hoogle echo importing builtin packages - for docdir in ${ghc.doc}/${docLibGlob}/*; do + for docdir in ${ghcDocLibDir}/*; do name="$(basename $docdir)" ${opts isGhcjs ''docdir="$docdir/html"''} if [[ -d $docdir ]]; then