mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-29 02:13:23 +00:00
Fix null deps in ghcWithHoogle
This commit is contained in:
parent
cd550dcb66
commit
dc7a91392e
@ -52,10 +52,13 @@ let
|
||||
This index includes documentation for many Haskell modules.
|
||||
'';
|
||||
|
||||
# Packages like base and bytestring are null. These must be removed
|
||||
# to prevent eval errors.
|
||||
nonNullPackages = builtins.filter (p: p != null) packages;
|
||||
# TODO: closePropagation is deprecated; replace
|
||||
docPackages = lib.closePropagation
|
||||
# we grab the doc outputs
|
||||
(map (lib.getOutput "doc") packages);
|
||||
(map (lib.getOutput "doc") nonNullPackages);
|
||||
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
@ -67,10 +70,10 @@ stdenv.mkDerivation {
|
||||
inherit docPackages;
|
||||
|
||||
buildPhase = ''
|
||||
${lib.optionalString (packages != [] -> docPackages == [])
|
||||
${lib.optionalString (nonNullPackages != [] -> docPackages == [])
|
||||
("echo WARNING: localHoogle package list empty, even though"
|
||||
+ " the following were specified: "
|
||||
+ lib.concatMapStringsSep ", " (p: p.name) packages)}
|
||||
+ lib.concatMapStringsSep ", " (p: p.name) nonNullPackages)}
|
||||
mkdir -p $out/share/doc/hoogle
|
||||
|
||||
echo importing builtin packages
|
||||
@ -86,10 +89,9 @@ stdenv.mkDerivation {
|
||||
${lib.concatMapStringsSep "\n" (el: ''
|
||||
ln -sfn ${el.haddockDir} "$out/share/doc/hoogle/${el.name}"
|
||||
'')
|
||||
(lib.filter (el: el.haddockDir != null)
|
||||
(builtins.map (p: { haddockDir = if p ? haddockDir then p.haddockDir p else null;
|
||||
name = p.pname; })
|
||||
docPackages))}
|
||||
(builtins.map (p: { haddockDir = if p ? haddockDir then p.haddockDir p else null;
|
||||
name = p.pname; })
|
||||
docPackages)}
|
||||
|
||||
echo building hoogle database
|
||||
hoogle generate --database $out/share/doc/hoogle/default.hoo --local=$out/share/doc/hoogle
|
||||
|
Loading…
Reference in New Issue
Block a user