How to build Qt 5.15.2 for Vortex Studio
Introduction
Vortex Studio uses Qt's technologies for creating its multiple user interfaces. Several Qt pages show how to build Qt 5.15 with third parties (https://doc.qt.io/qt-5/build-sources.html)
In Vortex Studio, Qt 5.15.2 source is specifically linked with additional versions of Perl and XCB libraries (for Linux build) and built into binary libraries with specific Qt's configurations. Changes were made to fix some small issues found in this version of the source code. The changes are listed in the section Patches for Qt 5.15.2 used in Vortex Studio.
The following sections detail steps by steps on how to build Qt 5.15.2.
System requirements
- VS2019 C++ compiler
- Python 2.7
Package downloads
- Qt 5.15.2 (qt-everywhere-src-5.15.2.zip)
- Perl 5.32.0.1 for windows (strawberry-perl-5.32.0.1-64bit.msi)
- Strawberry Perl 5.32.0.1 (2020-08-02): http://strawberryperl.com
Build Qt 5.15.2 for Windows
1) Run strawberry-perl-5.32.0.1-64bit.msi to install
2) Create a folder (e.g. c:\qt515_for_windows)
3) Unzip the content of Qt 5.15.2 package to a specified folder (e.g. c:\qt515_for_windows\qt5.15.2)
4) Apply patches listed in the section Patches for Qt 5.15.2 used in Vortex Studio.
5) Create a file named Makefile in the folder created in step #2 with this content
CURRENTDIR:=$(shell pwd) makeit: qt515 ; TOOLCHAIN:=x64_win32_vc14 export INCLUDE:=$(CURRENTDIR)\stage_qt5_$(TOOLCHAIN)\include;$(INCLUDE) export LIB:=$(CURRENTDIR)\stage_qt5_$(TOOLCHAIN)\lib;$(LIB) qt515: (mkdir build_qt5_$(TOOLCHAIN) & cd build_qt5_$(TOOLCHAIN) && \ $(CURRENTDIR)\qt5.15.2\configure -debug-and-release -force-debug-info -recheck -shared -opensource -confirm-license -no-system-proxies -openssl -opengl desktop -skip qtwebengine -nomake tests -nomake examples -prefix $(CURRENTDIR)\stage_qt5_$(TOOLCHAIN)) .PHONY: qt515
7) Open the tools command prompt for VS2015 x64 as administrator
8) Run
> make
Build Qt 5.15.1 for Linux
Linux still uses 5.15.1. Follow the download instruction but replace 5.15.2 for 5.15.1.
1) Make sure Perl is installed. Type the following to find out which version
> perl -v
2) Create a folder (e.g. c:\qt515_for_windows)
3) Start a Terminal
4) Unzip the content of Qt5.15.1 package to a specified folder (e.g. c:\qt515_for_windows\qt5.15.1)
5) Apply patches listed in the section Patches for Qt 5.15.1 used in Vortex Studio.
6) Execute the following commands:
> cd c:\qt515_for_windows\qt5.15.1
> find ./ -type f -exec dos2unix {} \;
> sudo su -
> yum install libxcb libxcb-devel xcb-util xcb-util-devel libxkbcommon-devel libxkbcommon-x11-devel xcb-util-keysyms-devel xcb-util-wm-devel xcb-util-image-devel xcb-util-renderutil-devel mesa-libGL-devel
7) Create a file named Makefile in the folder created in step #2 with this content
CURRENTDIR:=$(shell pwd) makeit: qt515 ; TOOLCHAIN:=x64_rhel7_gcc73 export INCLUDE:=$(CURRENTDIR)/stage_qt5_$(TOOLCHAIN)/include;$(INCLUDE) export LIB:=$(CURRENTDIR)/stage_qt5_$(TOOLCHAIN)/lib;$(LIB) qt515: (mkdir -p build_qt5_$(TOOLCHAIN) && cd build_qt5_$(TOOLCHAIN) && \ chmod +x $(CURRENTDIR)/qt5/configure && \ chmod +x $(CURRENTDIR)/qt5/qtbase/configure && \ $(CURRENTDIR)/qt5.15.1/configure -shared -opensource -confirm-license -xcb -xcb-xlib -bundled-xcb-xinput -no-system-proxies -openssl -opengl desktop -skip qtwebengine -nomake tests -nomake examples -prefix $(CURRENTDIR)/stage_qt5_$(TOOLCHAIN) && \ $(MAKE) && \ $(MAKE) install) .PHONY: qt515
7) Run
> make
Patches for Qt 5.15.2 used in Vortex Studio
The following changes were made in the original Qt 5.15.2 source to fix some small issues found in the source.
1) Patch #1:
\\qtbase\src\gui\kernel\qoffscreensurface.cpp:
line 201: Added a check for valid qGuiApp
if (qGuiApp && QThread::currentThread() != qGuiApp->thread())
2) Patch #2:
\\qtbase\src\corelib\kernel\qcoreapplication.cpp:
Line 1156: Use a copy of extraData→eventFilters
3) Patch #3:
\\qt5\qtbase\src\gui\painting\qpaintengineex.cpp
Line 55: Change made to QT_MAX_CACHED_GLYPH_SIZE
\\qt5\qtbase\src\widgets\accessible\simplewidgets.cpp
Line 221: in the function QAccessibleButton::role(), added a check for valid ab variable
Line 346: in the function QAccessibleToolButton::role(), added a check for valid ab variable
4) Patch #4:
\\qtbase\src\widgets\styles\qstylesheetstyle.cpp:
Line 5827 & 5828: Replace these 2 lines with the following: