haskell: add quickjump option to the haskell mkDerivation

When visiting local documentation via hoogle, currently for most packages the
quickjump index is missing so you only get a sad error when pressing "s" to
search in the current documentation.

The quickjump option is only supported by the haddock utility that's shipped
with ghc 8.6.x or later.

Closes https://github.com/NixOS/nixpkgs/pull/75942.
This commit is contained in:
Merlin Göttlinger 2019-12-19 14:41:11 +01:00 committed by Peter Simons
parent d8cf98b9c8
commit 900a378245

View file

@ -24,6 +24,7 @@ in
, doCheck ? !isCross && stdenv.lib.versionOlder "7.4" ghc.version
, doBenchmark ? false
, doHoogle ? true
, doHaddockQuickjump ? doHoogle && stdenv.lib.versionAtLeast ghc.version "8.6"
, editedCabalFile ? null
, enableLibraryProfiling ? !(ghc.isGhcjs or false)
, enableExecutableProfiling ? false
@ -402,6 +403,7 @@ stdenv.mkDerivation ({
${optionalString (doHaddock && isLibrary) ''
${setupCommand} haddock --html \
${optionalString doHoogle "--hoogle"} \
${optionalString doHaddockQuickjump "--quickjump"} \
${optionalString (isLibrary && hyperlinkSource) "--hyperlink-source"} \
${stdenv.lib.concatStringsSep " " haddockFlags}
''}