【发布时间】:2015-02-27 23:58:02
【问题描述】:
我正在尝试在 Haskell 开发环境中使用 hoogle 就像O'Charles' wiki描述的那样:
为了使用hoogleLocal,我已经像下面这样修改了shell.nix,但它似乎没有为我安装hoogle 二进制文件。
let
pkgs = import <nixpkgs> {};
# I'm attempting to use hoogle here, but it is not working.
haskellPackages =
let callPackage = pkgs.lib.callPackageWith haskellPackages;
in pkgs.recurseIntoAttrs (pkgs.haskellPackages.override {
extension = self: super: {
thiscurrentpackage = self.callPackage ./. {};
hoogleLocal = pkgs.haskellPackages.hoogleLocal.override {
packages = self.thiscurrentpackage;
};
};
});
in pkgs.myEnvFun {
name = haskellPackages.thiscurrentpackage.name;
buildInputs = [
(haskellPackages.ghcWithPackages (hs: ([
hs.cabalInstall
hs.ghcMod
hs.yesodBin
# This doesn't appear to install the hoogle binary?
hs.hoogleLocal
] ++ hs.thiscurrentpackage.propagatedNativeBuildInputs)))
];
}
在生成的 shell 中,hoogle 二进制文件不可用。
如果我在buildInputs 中包含hs.hoogle,则会安装hoogle 二进制文件,但它找不到数据库。以下是我尝试使用它时发生的情况。
$ nix-shell
......
$ hoogle Monad
Could not find some databases: default
Searching in:
.
/nix/store/91y9q2y5a2ws8xgcsx1gkhfagc0f2qz6-haskell-hoogle-ghc7.8.3-4.2.36-shared/share/x86_64-linux-ghc-7.8.3/hoogle-4.2.36/databases
There are no available databases, generate them with: hoogle data
$ hoogle data
hoogle: /nix/store/91y9q2y5a2ws8xgcsx1gkhfagc0f2qz6-haskell-hoogle-ghc7.8.3-4.2.36-shared/share/x86_64-linux-ghc-7.8.3/hoogle-4.2.36/databases:
changeWorkingDirectory: does not exist (No such file or directory)
$
对于 O'Charles 所描述的设置,我如何才能使其正常工作?
编辑:原来的shell.nix与this answer中的相同。
【问题讨论】: