-
Notifications
You must be signed in to change notification settings - Fork 51
How to Build yourself from source
All Platforms: Use QtCreator (Qt5 version) and open minutor.pro
For automatic definition file updates to be working with HTTPS URLs, it is necessary to download OpenSSL 1.0.2 sources and build Qt with support for OpenSSL. As prerequisites you have to install these tools (and add them to PATH):
# we place all files near Qt sources
cd C:\Qt
# clone the desired OpenSSL branch
# (everything from 1.0.0 upwards is claimed to be compatible with Qt, but 1.1.1 is not working currently)
git clone -b OpenSSL_1_0_2-stable --single-branch https://github.com/openssl/openssl.git OpenSSL_1_0_2
# use a Visual Studio 64bit development console for these commands
cd C:\Qt\OpenSSL_1_0_2
perl Configure VC-WIN64A
.\ms\do_win64a.bat
# build libraries
nmake -f .\ms\nt.mak
# build DLLs
nmake -f .\ms\ntdll.mak
This will create two .DLLs in folder out32dll: libeay32.dll and ssleay32.dll (named with 32 even for 64bit libraries). Copy these files into the same folder than Minutor.exe (e.g. the Debug or Release folder).
# we place all files near Qt sources
cd C:\Qt
# clone the desired OpenSSL branch (everything from 1.0.0 upwards is claimed to be compatible with Qt)
git clone -b OpenSSL_1_1_1-stable --single-branch https://github.com/openssl/openssl.git OpenSSL_1_1_1
# use a Visual Studio 64bit development console for these commands
mkdir OpenSSL_1_1_1-build
cd C:\Qt\OpenSSL_1_1_1-build
# configure Visual Studio Compiler (ignore nmake.exe missing warning)
perl C:\Qt\OpenSSL_1_1_1\Configure VC-WIN64A
# build libraries & DLLs
nmake build_libs
This will create two .DLLs in folder OpenSSL_1_1_1-build
: libcrypto-1_1-x64.dll and libssl-1_1-x64.dll
Copy these files into the same folder than Minutor.exe (e.g. the Debug or Release folder).
Download the Qt 5.x sourcecode.
Unzip it wherever you wish, it's a large file and contains a lot of nested subdirectories, so you'll probably want to put it in C:\Qt\ or something similar since you could end up running into Windows' path-length limitations otherwise.
Now edit qtbase\mkspecs\common\msvc-desktop.conf
Find the CONFIG line and remove embed_manifest_dll
and embed_manifest_exe
from that line.
Next find QMAKE_CFLAGS_*
and change -MD
to -MT
and -MDd
to -MTd
.
Open your developer command prompt (64-bit):
# create intermediate build and final deploy directories
mkdir C:\Qt\qt-5.9.7_msvc2015_x64_static
mkdir C:\Qt\qt-5.9.7_msvc2015_x64_build
cd C:\Qt\qt-5.9.7_msvc2015_x64_build
C:\Qt\qt-everywhere-opensource-src-5.9.7\configure.bat
-prefix C:\Qt\qt-5.9.7_msvc2015_x64_static
-debug-and-release -static
-opensource -confirm-license
-platform win32-msvc
-nomake tests -nomake examples -no-angle
-opengl desktop
-openssl -I C:\Qt\OpenSSL_1_0_2\inc32
nmake
nmake install
If nmake complains about python or perl, install ActivePerl and ActivePython and try again. This compile will take a long time.
This should make a static Qt5 with both debug and release libraries. Now in QtCreator, go to Tools ? Options... and select Qt Versions from Build & Run. Add a new Qt Version and locate the qmake.exe
that is inside
qtbase\bin of the Qt5 you just compiled. There will be a warning flag because we didn't compile qmlscene or qmlviewer or any helpers. You can ignore that warning.
Then switch over to Kits and make a new kit that uses the Qt version you just created. Again, there will be a warning flag for the same reasons as before, ignore it.
Now compile Minutor using the static Kit. You should end up with a statically linked minutor.exe which doesn't require any Qt DLLs to run. Place OpenSSL DLLs libeay32.dll and ssleay32.dll (yes 32, even for 64bit) in the same folder as minutor.exe.
Use qmake to generate a makefile then run make. Or use QtCreator.
If you want to make a .deb package,
$ debuild
To make a package for another distribution:
$ pbuilder-dist bionic create # called only once to generate environment
$ debuild -S -us -uc
$ cd ..
$ pbuilder-dist bionic build *.dsc
Make a static compile of Qt 5.12:
$ git clone https://github.com/qt/qt5.git
$ cd qt5
$ perl init-repository --module-subset=default,-qtwebkit,-qtwebkit-examples,-qtwebengine
(wait forever)
$ ./configure -prefix $PWD/qtbase -opensource -confirm-license -nomake tests -nomake examples -securetransport -hostprefix $PWD/qtbase -release -static
$ ln -s qtbase/include .
$ make
(wait forever)
Then compile Minutor:
$ cd minutor
$ ~/qt5/qtbase/bin/qmake
$ make
You'll end up with a minutor.app in the current directory.