Is there any simple way to install haskell / cabal / stack in an existing msys2 installation? I can't find one.
Note: Apparently it is possible to install both at the same time using MinGHC, see here.
Is there any simple way to install haskell / cabal / stack in an existing msys2 installation? I can't find one.
Note: Apparently it is possible to install both at the same time using MinGHC, see here.
Here's the strategy I used.
Note
Using the Haskell Platform to install Haskell is no longer recommended. Visit Haskell's homepage to see the recommended way to install Haskell, now.
Copy the bin, lib, man, mingw and msys folders from the temp folder to my current msys2 install. The bin, lib, and man folders contain Haskell platform and compiler toolchain; the mingw folder contains the gcc compiler toolchain.
$ cp -av /c/tmp/Haskell\ Platform/8.4.3/{bin,lib,man,mingw,msys} /usr/local/
As per Unix convention, /usr/local
is designated for installs which are managed by the local administrator (i.e. you), and not by the system (i.e. the package manager, pacman
in this case). If Haskell becomes available via pacman
at some point, my install will not conflict with the new one, except on the PATH.
/usr/local/lib/extralibs/bin
to the PATH, using my .bashrc
. This is the location of cabal
and a few other common 3rd-party tools.$ cabal update
succeeded. However, this is my first time back to Haskell in a long while, and my first time using the new local builds feature of cabal, so I'll expect to have a lot of trial and error before I am sure that the MSYS setup is working.
(I can't guarantee this will work)
(I can actually guarantee this won't work)
Download a .zip file containing stack for Windows. See the manual download section of this documentation page.
To use it with msys2, copy it to /usr/bin
.
To use it with mingw, copy stack.exe to /mingw64/bin
(or to /mingw32/bin
if using a 32-bit system)
$ stack
should now be available. It allows you to use haskell.
You may want to run stack install cabal-install
. This installation didn't work for me and I had to hand-copy cabal.exe using the file explorer.
I found $ stack install Stack
and $ stack install Cabal
to do nothing.