How to Compile qBittorrent in MSYS2
This guide is to help developers setup development environment quickly.
Warning! the compilation will require ~10 GB of free space to compile & run qBittorrent (dynamically linked).
Refer to https://www.msys2.org/
Depending on your intention, download one PKGBUILD from the links below and put it into a clean folder.
-
Build development source
https://raw.githubusercontent.com/Chocobo1/qbittorent_msys2/master/PKGBUILD -
Build stable release
Download every file in this folder: https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-qbittorrent
To download each file, click the filename then on the right side clickRaw
button and Ctrl + s to save the file.
If you want to build a x64 application then open MSYS2 MinGW 64-bit
in Windows start menu.
Otherwise open MSYS2 MinGW 32-bit
.
First make sure msys2 is up-to-date by running the following command a few times, until it tells you all packages are latest:
pacman --sync --refresh --sysupgrade
Install development tools:
pacman --sync --noconfirm mingw-w64-x86_64-toolchain
# run the below command if you need to build 32-bit
pacman --sync --noconfirm mingw-w64-i686-toolchain
Start building qBittorrent:
cd <PKGBUILD_directory>
# build 64-bit qBittorrent
MINGW_ARCH=mingw64 makepkg-mingw --skippgpcheck --syncdeps --noconfirm
# build 32-bit qBittorrent
MINGW_ARCH=mingw32 makepkg-mingw --skippgpcheck --syncdeps --noconfirm
After the command complete, you should see it created package: mingw-w64-x86_64-qbittorrent-4.0.1-1-any.pkg.tar.xz
. The architecture & version number may be different.
Install:
pacman -U mingw-w64-x86_64-qbittorrent-4.0.1-1-any.pkg.tar.xz
Run (in the same console):
qbittorrent
You can find the downloaded qBittorrent source code in <PKGBUILD_directory>/src/qbittorrent
.