-
Install MSYS2
-
Install required packages:
$ pacman -S rsync patch diffutils curl make unzip git m4 perl tar mingw-w64-cross-gcc mingw-w64-x86_64-pkg-config
- Add
/opt/bin
to $PATH:
$ echo 'export PATH=$PATH:/opt/bin' >> ~/.bashrc
-
Restart the terminal or do
source ~/.bashrc
-
Download and extract the opam64 archive
$ curl -LO https://github.com/fdopen/opam-repository-mingw/releases/download/0.0.0.2/opam64.tar.xz
$ tar xf opam64.tar.xz
- Run the opam install script. Ignore the messages about missing programs. MSYS2 installs packages differently from Cygwin.
$ bash opam64/install.sh
- Initialize the opam repository and set a default switch.
$ opam init default "https://github.com/fdopen/opam-repository-mingw.git#opam2" -c "ocaml-variants.4.10.0+mingw64c" --disable-sandboxing
- Allow opam to edit
.bash_profile
. (Press y)
Do you want opam to modify C:/dev/msys2/home/Max/.bash_profile? [N/y/f]
(default is 'no', use 'f' to choose a different file) y
- Allow opam to add the hook. (Press y)
A hook can be added to opam's init scripts to ensure that the shell remains in sync with the opam environment when they are loaded. Set that up? [y/N]
- Restart the terminal and you are ready to use OCaml in MSYS2.
Hello,
I could follow the instructions above up to point 6.
If I run the command $ bash opam64/install.sh
I get the error message
$ bash opam64/install.sh
warning: git not installed. opam will not work without it!
warning: unzip not installed. opam will not work without it!
warning: rsync not installed. opam will not work without it!
warning: patch not installed. opam will not work without it!
warning: diffutils not installed. opam will not work without it!
warning: make not installed. opam will not work without it!
warning: m4 not installed. opam will not work without it!
warning: neither curl nor wget are installed!
pleas install at least on of them
please install either mingw64-i686-gcc-core (32-bit) or mingw64-x86_64-gcc-core (64-bit)
you need a working C compiler to compile native ocaml programs
the following programs are not installed properly:
tar / xz
I can't proceed :(
I tried to make the "git is not installed message disappear" by running "pacman -S git" first, which worked fine. But the error message doesn't disappear. I run all this from the MSYS2 MinGW x64 console.