Installing packages (via cabal) from “local hackage”

馋奶兔 提交于 2019-12-10 14:04:44

问题


Is it possible to get cabal to

  • Download a particular package source, including all dependency packages sources.
  • At a later stage (when internet connectivity can no longer be relied upon) install these packages via cabal, from the locally downloaded files, automatically in the right order so that the desired package is build?

I know that you can use cabal unpack to view the source of a particular package, but I am not sure how to achieve above. Also note that in this post Can't get cabal update to work inside corporate network it was mentioned that this could be done, but the instructions were not specific enough for me.


回答1:


cabal help | grep fetch:

fetch        Downloads packages for later installation.

Example:

$ cabal fetch unbound
Resolving dependencies...
Downloading RepLib-0.5.3.1...
Downloading type-equality-0.1.1...
Downloading unbound-0.4.1.1...

Running cabal install unbound at a later stage won't require Internet access.



来源:https://stackoverflow.com/questions/14112681/installing-packages-via-cabal-from-local-hackage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!