Setup MSYS2 env - bryanch/random GitHub Wiki

Reference (note I tweak a little bit to fit my case)

MSYS2

  1. Download from http://msys2.github.io
  2. Install into $DEV/msys64
  3. Run $DEV/msys2_shell.cmd
  4. Run pacman -Syuu
  5. Close the shell; reopen it, and run pacman -Syuu again, just in case :p

Pacman

pacman is the package manager bundled with msys. Use it to install useful things like gcc, flex, bison, git. The commands are pretty cryptic, so use the Pacman/Rosetta.

Set up $PATH

  • Open "Environment Variables > System Variables > Path"
  • At the end, add $DEV/msys64/usr/bin

Adding a HOME in user's env variables will set the home directory in MSYS shell

Git

  1. Open an msys shell
  2. Run pacman -S git
  3. If you want to use git gui/gitk,
    1. Run pacman -S mingw-w64-x86_64-tk to install the binaries
    2. In system variables, add $DEV/msys64/mingw64/bin to $PATH
    3. Set MSYS2_PATH_TYPE to inherit