MSYS2

From David's Wiki
Revision as of 13:54, 14 July 2021 by David (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
\( \newcommand{\P}[]{\unicode{xB6}} \newcommand{\AA}[]{\unicode{x212B}} \newcommand{\empty}[]{\emptyset} \newcommand{\O}[]{\emptyset} \newcommand{\Alpha}[]{Α} \newcommand{\Beta}[]{Β} \newcommand{\Epsilon}[]{Ε} \newcommand{\Iota}[]{Ι} \newcommand{\Kappa}[]{Κ} \newcommand{\Rho}[]{Ρ} \newcommand{\Tau}[]{Τ} \newcommand{\Zeta}[]{Ζ} \newcommand{\Mu}[]{\unicode{x039C}} \newcommand{\Chi}[]{Χ} \newcommand{\Eta}[]{\unicode{x0397}} \newcommand{\Nu}[]{\unicode{x039D}} \newcommand{\Omicron}[]{\unicode{x039F}} \DeclareMathOperator{\sgn}{sgn} \def\oiint{\mathop{\vcenter{\mathchoice{\huge\unicode{x222F}\,}{\unicode{x222F}}{\unicode{x222F}}{\unicode{x222F}}}\,}\nolimits} \def\oiiint{\mathop{\vcenter{\mathchoice{\huge\unicode{x2230}\,}{\unicode{x2230}}{\unicode{x2230}}{\unicode{x2230}}}\,}\nolimits} \)

Msys2 is a collection of linux utilities which have been compiled for Windows.
It is a fork of Cygwin.

Getting Started

  • Install Msys2 from https://www.msys2.org/
    • Note: You can also install with choco install msys2 but you will need to set start menu shortcuts yourself
  • Install common developer tools
    • pacman -S --needed base-devel git
    • pacman -S --needed mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake

Package Management

Reference

# Install a package
pacman -S <package>

# Uninstall a package
pacman -R <package>

Changing Home Dir

Set the following:

  • db_home in /etc/nsswitch.conf
    db_home: /c/Users/david
  • HOME environment variable to %USERPROFILE%

Running Windows Programs

  • Go to /c/msys64/msys2_shell.cmd
  • Uncomment set MSYS2_PATH_TYPE=inherit