Here's the Msys2 PKGBUILD for Qt6 Base, statically-linked version. Initially this is for compiling Rui Nuno Capela's Vee One Suite on my computer.
As newer versions of Vee One Suite (since a880014f
) depend on Qt6 SVG, a static version should be useful too.
Components will be installed in a dedicated path /opt/qt6-static/
, so that it won't interfere with Msys2's own Qt6 packages.
**NOTICE: **
**This version should be used with my static Qt6 base package. ** It's NOT the static version of Msys2's
mingw-w64-x86_64-qt6-svg
package!
You need to build and install my static Qt6 base package first. It's required for building any Qt6 components statically.
-
Run Msys2 MinGW64 shell.
DO NOT USE MSYS SHELL! It uses Msys's POSIX-compatible compilers, which are incompatible with native Win32 environment.
-
Clone this repo. Make sure that you won't put other files in
PKGBUILD
's directory.
git clone https://github.com/AnClark/msys2-qt6svg-static ~/msys2-qt6svg-static
- Build package.
cd ~/msys2-qt6svg-static/
makepkg -f
When done, you'll get a package file: mingw-w64-x86_64-qtsvg6-static-6.x.x-x86_64.pkg.tar.zst
. 6.x.x
should be the actual Qt version.
- Install package.
pacman -U mingw-w64-x86_64-qtsvg6-static-6.x.x-x86_64.pkg.tar.zst
Finally, Qt6 base static library will be installed into /opt/qt6-static
.
To build your program with static Qt6 libraries, if your project uses CMake, you can invoke it before configuring with CMake:
source /opt/qt6-static/bin/qt6-static-env.sh
Including this script will configure some necessary environment variables to let CMake choose static version of Qt6 library.
- Original author: Rui Nuno Capela (rncbc)
- Maintainer: AnClark
rncbc's official repos for Qt6 static build: