Loading pkgs/development/haskell-modules/hoogle-local-wrapper.sh +1 −1 Original line number Diff line number Diff line Loading @@ -2,4 +2,4 @@ COMMAND=$1 shift exec @hoogle@/bin/hoogle "$COMMAND" --database @out@/share/doc/hoogle/default.hoo "$@" exec @hoogle@/bin/hoogle "$COMMAND" --database @database@ "$@" pkgs/development/haskell-modules/hoogle.nix +20 −4 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ buildPackages, haskellPackages, writeText, runCommand, }: # This argument is a function which selects a list of Haskell packages from any Loading Loading @@ -40,8 +41,11 @@ let # we grab the doc outputs (map (lib.getOutput "doc") packages); # Hoogle database path, relative to `$out`. databasePath = "share/doc/hoogle/default.hoo"; in buildPackages.stdenv.mkDerivation { buildPackages.stdenv.mkDerivation (finalAttrs: { name = "hoogle-with-packages"; buildInputs = [ ghc Loading Loading @@ -101,8 +105,10 @@ buildPackages.stdenv.mkDerivation { ) } databasePath="$out/"${lib.escapeShellArg databasePath} echo building hoogle database hoogle generate --database $out/share/doc/hoogle/default.hoo --local=$out/share/doc/hoogle hoogle generate --database "$databasePath" --local=$out/share/doc/hoogle echo building haddock index # adapted from GHC's gen_contents_index Loading @@ -122,13 +128,23 @@ buildPackages.stdenv.mkDerivation { echo finishing up mkdir -p $out/bin substitute ${wrapper} $out/bin/hoogle \ --subst-var out --subst-var-by shell ${stdenv.shell} \ --subst-var-by shell ${stdenv.shell} \ --subst-var-by database "$databasePath" \ --subst-var-by hoogle ${hoogle} chmod +x $out/bin/hoogle ''; passthru = { isHaskellLibrary = false; # for the filter in ./with-packages-wrapper.nix # The path to the Hoogle database. database = "${finalAttrs.finalPackage}/${databasePath}"; tests.can-search-database = runCommand "can-search-database" { } '' # This succeeds even if no results are found, but `Prelude.map` should # always be available. ${finalAttrs.finalPackage}/bin/hoogle search Prelude.map > $out ''; }; meta = { Loading @@ -137,4 +153,4 @@ buildPackages.stdenv.mkDerivation { hydraPlatforms = with lib.platforms; none; maintainers = with lib.maintainers; [ ttuegel ]; }; } }) pkgs/development/haskell-modules/with-packages-wrapper.nix +5 −3 Original line number Diff line number Diff line Loading @@ -47,9 +47,9 @@ selectPackages: let inherit (haskellPackages) llvmPackages ghc; packages = selectPackages haskellPackages ++ lib.optional withHoogle (hoogleWithPackages selectPackages); hoogleWithPackages' = if withHoogle then hoogleWithPackages selectPackages else null; packages = selectPackages haskellPackages ++ [ hoogleWithPackages' ]; isGhcjs = ghc.isGhcjs or false; isHaLVM = ghc.isHaLVM or false; Loading Loading @@ -202,6 +202,8 @@ else passthru = { inherit (ghc) version meta; hoogle = hoogleWithPackages'; # Inform users about backwards incompatibilities with <= 21.05 override = _: Loading Loading
pkgs/development/haskell-modules/hoogle-local-wrapper.sh +1 −1 Original line number Diff line number Diff line Loading @@ -2,4 +2,4 @@ COMMAND=$1 shift exec @hoogle@/bin/hoogle "$COMMAND" --database @out@/share/doc/hoogle/default.hoo "$@" exec @hoogle@/bin/hoogle "$COMMAND" --database @database@ "$@"
pkgs/development/haskell-modules/hoogle.nix +20 −4 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ buildPackages, haskellPackages, writeText, runCommand, }: # This argument is a function which selects a list of Haskell packages from any Loading Loading @@ -40,8 +41,11 @@ let # we grab the doc outputs (map (lib.getOutput "doc") packages); # Hoogle database path, relative to `$out`. databasePath = "share/doc/hoogle/default.hoo"; in buildPackages.stdenv.mkDerivation { buildPackages.stdenv.mkDerivation (finalAttrs: { name = "hoogle-with-packages"; buildInputs = [ ghc Loading Loading @@ -101,8 +105,10 @@ buildPackages.stdenv.mkDerivation { ) } databasePath="$out/"${lib.escapeShellArg databasePath} echo building hoogle database hoogle generate --database $out/share/doc/hoogle/default.hoo --local=$out/share/doc/hoogle hoogle generate --database "$databasePath" --local=$out/share/doc/hoogle echo building haddock index # adapted from GHC's gen_contents_index Loading @@ -122,13 +128,23 @@ buildPackages.stdenv.mkDerivation { echo finishing up mkdir -p $out/bin substitute ${wrapper} $out/bin/hoogle \ --subst-var out --subst-var-by shell ${stdenv.shell} \ --subst-var-by shell ${stdenv.shell} \ --subst-var-by database "$databasePath" \ --subst-var-by hoogle ${hoogle} chmod +x $out/bin/hoogle ''; passthru = { isHaskellLibrary = false; # for the filter in ./with-packages-wrapper.nix # The path to the Hoogle database. database = "${finalAttrs.finalPackage}/${databasePath}"; tests.can-search-database = runCommand "can-search-database" { } '' # This succeeds even if no results are found, but `Prelude.map` should # always be available. ${finalAttrs.finalPackage}/bin/hoogle search Prelude.map > $out ''; }; meta = { Loading @@ -137,4 +153,4 @@ buildPackages.stdenv.mkDerivation { hydraPlatforms = with lib.platforms; none; maintainers = with lib.maintainers; [ ttuegel ]; }; } })
pkgs/development/haskell-modules/with-packages-wrapper.nix +5 −3 Original line number Diff line number Diff line Loading @@ -47,9 +47,9 @@ selectPackages: let inherit (haskellPackages) llvmPackages ghc; packages = selectPackages haskellPackages ++ lib.optional withHoogle (hoogleWithPackages selectPackages); hoogleWithPackages' = if withHoogle then hoogleWithPackages selectPackages else null; packages = selectPackages haskellPackages ++ [ hoogleWithPackages' ]; isGhcjs = ghc.isGhcjs or false; isHaLVM = ghc.isHaLVM or false; Loading Loading @@ -202,6 +202,8 @@ else passthru = { inherit (ghc) version meta; hoogle = hoogleWithPackages'; # Inform users about backwards incompatibilities with <= 21.05 override = _: Loading