haskell-cmake-improvements: adjust readme to the new dependency management for haskell
@@ -29,7 +29,7 @@ inside ghci.
## Dependencies
-- GHC (Glasgow Haskell Compiler) > 8.0.0
+- GHC (Glasgow Haskell Compiler) > 8.0.1 && < 8.4
- cabal > 1.24.0.2 (older versions may work but untested, 2.0.0.0 works as well)
GHC and cabal can be either obtained using a package manager or downloaded directly
@@ -37,12 +37,48 @@ from [the Haskell homepage](https://www.haskell.org/platform/).
Before installing the remaining dependencies, make sure to update your cabal database
which contains the current list of haskell packages by invoking `cabal update`, this
-is not done automatically.
+is not done automatically. Then first ensure the following programs are available on
+the PATH:
-- c2hs > 0.28.2 (older versions may work but are untested)
- c2hs is available in some package managers and should be installed from there in that case.
- If c2hs is not available in the package manager (e.g. homebrew on macOS does not include it),
- it can be installed via cabal by invoking `cabal update && cabal install c2hs`.
+- c2hs (tested with 0.28.2)
+- alex (tested with 3.2.4)
+- happy (tested with 1.19.9)
+
+All three depedendencies are available in some package managers and should be installed from
+there in that case. If one or all of them are not available in the package manager
+(e.g. homebrew on macOS does not include it), they can be installed via cabal by invoking
+`cabal update && cabal install c2hs && cabal install alex && cabal install happy`.
+
+Next a cabal sandbox containing all the haskell dependencies has to be created. By
+default, it is assumed to be the folder `.cabal-sandbox` in the build directory.
+In case you want to install them to a separate location this is supported as well,
+the build system will consider the environment variable `HASKELL_SHARED_SANDBOX`.
+
+First create the folder where you want the sandbox to be located. Then switch into that
+folder and execute `cabal sandbox init`. This will create a new sandbox where the
+dependencies will get installed into. Please note that the following commands have to
+be execute inside the directory containing the sandbox, otherwise cabal would install
+the dependencies globally instead. This is generally not wanted to avoid conflicts
+and issues due to existing incompatible dependencies. Before configuring the project
+via cmake, make sure you have set the environment variable to the sandbox' location
+unless you are using the standard folder as described above.
+
+In case you simply want to install the bindings, but no other haskell based plugins,
+install the following dependencies into the sandbox:
+
+```
+cabal install 'containers >=0.4 && <0.6' 'base >=4.7 && <5' 'directory >=1.1 && <1.4' \
+'process >=1.2 && <1.7' 'filepath >=1.3 && <1.5' 'base -any' 'hspec -any' 'QuickCheck -any'
+```
+
+In case you want to install every haskell based plugin, use this command instead:
+
+```
+cabal install 'containers >=0.4 && <0.6' 'base >=4.7 && <5' 'directory >=1.1 && <1.4' \
+'process >=1.2 && <1.7' 'filepath >=1.3 && <1.5' 'base -any' 'hspec -any' 'QuickCheck -any'
+```
+
+Now everything should be ready and awaits compilation.
## Limitations
