cabal在mac中全局安装软件包在哪里?

时间:2018-06-11 16:12:51

标签: haskell cabal cabal-install

在MacOS中,如果我执行

cabal install foo --global

cabal在哪里安装foo包?

1 个答案:

答案 0 :(得分:2)

没有一个地方GHC存储全球数据 - 它取决于配置,这将取决于你从哪里获得GHC(nixpkgs,brew,ports,raw from GHCHQ等)。对于您的特定情况,您可以获得@DanielWagner所描述的信息:

$ ghc-pkg describe unix --global

一些简单的shell脚本可以提取您想要的特定信息:

ghc-pkg describe unix --global | egrep '^pkgroot' | cut -d' ' -f2
"/usr/local/Cellar/ghc/8.4.1/lib/ghc-8.4.1"

或者:

% nix-shell -p ghc
$ ghc-pkg describe unix --global | egrep '^pkgroot' | cut -d' ' -f2
"/nix/store/z0ypzmbhn6m0l2adzm8szcd72z7kwy04-ghc-8.0.2/lib/ghc-8.0.2"
相关问题