Hi all,
I have a specific goal and I'm hoping you can help me figure out the best way to accomplish it using stack (or perhaps even using other tools if they make more sense). I am working on a LaTeX document which contains embedded Haskell code for generating diagrams (
https://github.com/byorgey/series-formelles). When the LaTeX file is compiled, a certain executable (diagrams-builder-pgf) needs to be present, which in turn uses the GHC API to compile and run the code embedded in the LaTeX document. In order for this to work, various libraries (diagrams-lib, diagrams-pgf, palette, etc...) need to be present in the GHC package database; I also need a specific version of GHC. Getting this environment set up properly, with compatible versions of everything, can be a pain; I would like to create a script that others can run in order to reproducibly get a proper environment set up to be able to build the LaTeX document.
Stack seems like the obvious choice but I have run into a few difficulties trying to get it set up: first of all, as you can tell from my description above, I do not actually have a Haskell package. There is no Haskell library or executable I am trying to build. But as far as I can tell, a stack project is supposed to contain one or more Haskell packages. I could try to make a "fake" Haskell package whose dependencies describe the things I want to end up being present in the package DB but I am not sure of the best way to do this, and it seems rather kludgy. Really what I want is just a sandbox, but I can't really use a cabal sandbox because as far as I know that will just use whatever GHC version someone has installed, and I need a particular GHC version. Secondly, in order to install the diagrams-builder-pgf executable, I need to pass a certain flag to the diagrams-builder package when it is built, but I'm not clear on exactly how to do this using stack.
So, what do you think? Is there a good way to do this with stack? Or should I look at some other way to get this set up? Thanks in advance for any ideas or advice. I'm happy to answer questions or provide further information.
-Brent