Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing packages (via cabal) from "local hackage"

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.

like image 504
artella Avatar asked Oct 21 '22 20:10

artella


1 Answers

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.

like image 79
Mikhail Glushenkov Avatar answered Oct 27 '22 15:10

Mikhail Glushenkov