This is a simple tool for using
cabal new-build
in Haskell projects that have originally been designed
for use with stack.
The tool does two things:
-
cabal new-build(at the moment) handles only dependencies that are either local or on Hackage. Instack, on the other hand, it is possible to use dependencies from GitHub by specifying repository-URL and commit in thestack.yamlfile. Thestack2cabaltool scans thestack.yamlfile for such dependencies, clones the repositories into subfolder./stack2cabal/and checks out the correct commit. -
Using the packages listed in
stack.yamland the cloned git repositories,stack path --compiler-exeto determine the correct GHC version andstack list-dependenciesto get the correct version of each dependency, thestack2cabaltool creates thecabal.projectfile needed forcabal new-build, thus making sure thatcabal new-buildwill build the same packages asstack, will use the same GHC version asstackand will use the same dependency versions asstack.