I'm writing a program in Haskell on my Mac (command line executable, not an app). I'm using GitHub to host the git repository and homepage. I made the <project>.cabal
and Setup.hs
files since Cabal makes it easy to build, test and generate documentation. I might also upload to Hackage, I don't know.
When I tag version 1.0, I want to make a Homebrew formula to download the tarball from GitHub and build it. I want the only dependency to be GHC.
I will use runhaskell Setup
configure
/build
/install
(with the prefix as /usr/local/Cellar/…) rather than the cabal
command to avoid depending on cabal-install.
This is all fine until I start using packages from Hackage, e.g. blaze-builder and aeson. How should I manage this?
I don't want to force non-Haskellers to have to download the whole Haskell platform. Ideally, people should be able to just let Homebrew install GHC before it builds my program, and then if they so choose, remove GHC after. If I make the Haskell platform a dependency and first install my Haskell dependencies through cabal-install or similar,
- The
~/.cabal/
folder with the packages will be left behind, even if afterwards theybrew uninstall haskell-platform
- I might as well only be going through Hackage and making people
cabal install
it, i.e. limit the scope for the most part to Haskellers.
I see Cabal(-install) + Hackage as a useful tool for development and for Haskellers but not appropriate for this.
Should I just download the source of the packages I'm using and include it in my source tree, adding it to the build command as well? Or should I be using the --package-db
option (found here)? Or could my formula download the tarball for the package on the fly and build it too?
I looked at cabal2arch a bit (Arch wiki, GitHub repo) but I'm not sure how it handles dependencies, or if it's just doing what I don't want to do.