Cabal: only work with checked in libraries in project directory
According to the cabal docs, you can set active-repositories: none
in your cabal.project
or cabal file to put cabal-install in offline mode.
Then, you could create a cabal project and try to make all the dependencies that don't come bundled with GHC itself local packages. Clone them in your project folder and add them to the packages:
section of cabal.project
.
The problem with the above is that running cabal clean
would require re-compiling all packages afterwards.
As an alternative, create a local no-index package repository in your offline machine, make it the only available package repository using active-repositories:
, and put the sdist tarballs of all your dependencies there.
That way the dependencies will only be compiled once.