Install binary packages in a temporary Cabal sandbox
A common task to use Cabal for is to install binary packages. In order not to pollute the global package space, this is often done in a sandbox. This small script automates this process for packages that support it.
More accurately, the script does the following:
- Create a temporary directory
- Initialize a Cabal sandbox
- Build the desired binaries. Link statically, build with minimal profiling overhead (no profiling, no shared libs, no Haddock).
- Install the binaries to
- Delete temporary directory
Programs tested with
This process does obviously only work for relocatable binaries. The most common non-relocatable types of binaries are dynamically linked ones and those that need external data files. That said, many binaries I've installed for myself over the years were relocatable. Check whether the process worked after building!
These programs were unsuccessfully built in the past, but due to multiple patches in the meantime they might work as intended now. I'll gladly take user reports on success or failure.
|Alex||alex-3.1.4||(may work, needs testing)|
|Happy||happy-1.19.5||(Reported to work on OSX with GHC 7.8.3)|