0
votes

I have a program that uses GHC-API to work with Haskell source files. The source files import modules from specific cabal-packages, which means that the cabal packages must be installed to the system where my program is ran.

What is the easiest way to distribute my program? I would not like to install ghc on each target system. Can I, for example, make some kind of portable a cabal sandbox that I could distribute with my program? How? Is there a better solution?

1

1 Answers

1
votes

If your program uses GHC-API you will need GHC anyway.You should provide your application as executable, something like that:

$ ghc -O2 --make -static -optc-static -optl-static A.hs -fvia-C -optl-pthread

or use new Cabal feature called "Relocatable packages" with key --enable-relocatable to provide all additional files, but it will be huge distribution, I think.