mingw-64 - Install package

Viewed 22494

I am using mingw_64 and CLion in Windows 10 to try to use a library (https://github.com/libtrading/libtrading) in a simple project, but the library requires some packages to be installed prior the use of the library. The thing is that the installing instructions are for Linux environment as follows:

# Debian
$ apt-get install pkg-config libxml2-dev libglib2.0-dev libncurses5-dev \
    python-yaml libevent-dev

# Fedora
$ yum install zlib-devel libxml2-devel glib2-devel vim-common ncurses-devel \
    python-yaml libevent-devel

# OSX
$ brew install libevent glib pkgconfig
$ pip install pyyaml

So, how do I install these pre-requisites in my mingw_64 and CLion in Windows 10 environment?

3 Answers

If you installed MinGW through MSYS2, you can use the MSYS2 pacman package manager to install additional packages:

The MSYS2 software distribution uses a port of pacman from Arch Linux to manage (install, remove and update) binary packages and also to build those packages in the first place.

Finding package

pacman -Ss <name or part of the name of the package>

Installing a package

pacman -S <name of the package>

Example:

$ pacman -Ss libxml2
mingw64/mingw-w64-x86_64-libxml2 2.9.8-1
    XML parsing library, version 2 (mingw-w64)
. . .
$ pacman -S mingw64/mingw-w64-x86_64-libxml2
resolving dependencies...
looking for conflicting packages...

Total Download Size:    1.37 MiB
Total Installed Size:  11.06 MiB

:: Proceed with installation? [Y/n]
:: Retrieving packages...
:: Processing package changes...
(1/1) installing mingw-w64-x86_64-libxml2           [##################################] 100%

A shorter version of pacman is pacboy. For example, you can specify the :x suffix to install a mingw64 package:

$ pacboy -S libxml2:x

Here is the way I used

$ cat /usr/bin/install
# How to use
# install rsync

cd /

echo $1
# echo $2

URL=http://repo.msys2.org/msys/x86_64
FILE=`wget -O - -o /dev/null $URL | sed -n 's/.*href="\([^"]*\).*/\1/p' | grep -E ^$1 | egrep -v '.sig$' | sort | tail -1f`

echo $FILE

# wget -qO- $URL/$FILE | tar -I zstd -xvf - -C /
# wget -qO- $URL/$FILE | tar xJvf - -C /

if [[ $FILE == *.zst ]] # * is used for pattern matching
then
  wget -qO- $URL/$FILE | tar -I zstd -xvf - -C /
elif [[ $FILE == *.xz ]]
then
  wget -qO- $URL/$FILE | tar xJvf - -C /
else
  echo "$FILE is not extracted"
fi


$ install whois
whois

whois-5.5.9-1-x86_64.pkg.tar.zst
.BUILDINFO
.MTREE
.PKGINFO
etc/
etc/whois.conf
usr/
usr/bin/
usr/bin/whois.exe
usr/share/
usr/share/man/
usr/share/man/man1/
usr/share/man/man1/whois.1.gz
usr/share/man/man5/
usr/share/man/man5/whois.conf.5.gz
Related