|
| 1 | +# 1. Start Visual Studio x64 Native Tools command line. |
| 2 | +# 2. Run powershell.exe from Native Tools cmd. |
| 3 | +# 3. cd to path of qt5-minimalistic-builds repo. |
| 4 | + |
| 5 | +$version_base = "6.0" |
| 6 | +$version = "6.0.0-rc2" |
| 7 | + |
| 8 | +$qt_sources_url = "https://download.qt.io/development_releases/qt/" + $version_base + "/" + $version + "/single/qt-everywhere-src-" + $version + ".zip" |
| 9 | +$qt_archive_file = $pwd.Path + "\qt-" + $version + ".zip" |
| 10 | +$qt_src_base_folder = $pwd.Path + "\qt-everywhere-src-" + $version |
| 11 | + |
| 12 | +$tools_folder = $pwd.Path + "\tools\" |
| 13 | +$type = "dynamic" |
| 14 | +$prefix_base_folder = "qt-" + $version + "-" + $type + "-msvc2019-x86_64" |
| 15 | +$prefix_folder = $pwd.Path + "\" + $prefix_base_folder |
| 16 | +$build_folder = $pwd.Path + "\bld" |
| 17 | + |
| 18 | +# OpenSSL |
| 19 | +# 1.1.1d |
| 20 | +# Install steps: |
| 21 | +# 1. Download, unpack openssl to folder "C:\openssl111d". |
| 22 | +# 2. Install system-wide perl, nasm. |
| 23 | +# 3. Run MVSC command prompt and navigate to openssl folder. |
| 24 | +# 4. Run "perl Configure VC-WIN64A --prefix=c:\openssl111 --openssldir=C:\openssl111" and then run "nmake" and "make install". |
| 25 | +$openssl_base_folder = "c:\Programy\OpenSSL\bin" |
| 26 | +$openssl_include_folder = $openssl_base_folder + "\include" |
| 27 | +$openssl_libs_folder = $openssl_base_folder + "\lib" |
| 28 | +$openssl_bin_folder = $openssl_base_folder + "\bin" |
| 29 | + |
| 30 | +# MySQL |
| 31 | +$mysql_include_folder = "c:\Programy\MariaDB\include" |
| 32 | +$mysql_lib_folder = "c:\Programy\MariaDB\lib" |
| 33 | + |
| 34 | +#$env:PATH = "$openssl_include_folder;$openssl_libs_folder;$openssl_bin_folder;$mysql_include_folder;$mysql_lib_folder" + $env:PATH |
| 35 | + |
| 36 | +# Download Qt sources, unpack. |
| 37 | +$AllProtocols = [System.Net.SecurityProtocolType]'Ssl3,Tls,Tls11,Tls12' |
| 38 | +[System.Net.ServicePointManager]::SecurityProtocol = $AllProtocols |
| 39 | + |
| 40 | +Invoke-WebRequest -Uri $qt_sources_url -OutFile $qt_archive_file |
| 41 | +& "$tools_folder\7za.exe" x $qt_archive_file |
| 42 | + |
| 43 | +# Configure. |
| 44 | +mkdir $build_folder |
| 45 | +cd $build_folder |
| 46 | + |
| 47 | +$env:OPENSSL_LIBS = "-lUser32 -lAdvapi32 -lGdi32 -llibcrypto -llibssl" |
| 48 | +$env:MYSQL_LIBS = "-llibmariadb" |
| 49 | + |
| 50 | +& "$qt_src_base_folder\configure.bat" -cmake -debug-and-release -opensource -confirm-license -opengl desktop -no-dbus -no-icu -no-fontconfig -nomake examples -nomake tests -skip qt3d -skip qtactiveqt -skip qtcanvas3d -skip qtconnectivity -skip qtdatavis3d -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtlocation -skip qtnetworkauth -skip qtpurchasing -skip qtquickcontrols -skip qtquickcontrols2 -skip qtremoteobjects -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qtvirtualkeyboard -skip qtwebview -skip qtscript -mp -optimize-size -shared -prefix $prefix_folder -openssl-linked -DOPENSSL_ROOT_DIR="$openssl_base_folder" |
| 51 | + |
| 52 | +# -openssl-linked -I $openssl_include_folder -L $openssl_libs_folder OPENSSL_LIBS="-lUser32 -lAdvapi32 -lGdi32 -llibcrypto -llibssl" -I $mysql_include_folder -L $mysql_lib_folder MYSQL_LIBS="-llibmariadb" |
| 53 | + |
| 54 | +# Compile. |
| 55 | +#& "$tools_folder\jom.exe" |
| 56 | +cmake --build . |
| 57 | +cmake --install . --config Release |
| 58 | +cmake --install . --config Debug |
| 59 | + |
| 60 | +# Copy OpenSSL, MySQL. |
| 61 | +cp "$openssl_bin_folder\*.dll" "$prefix_folder\bin\" |
| 62 | +cp "$openssl_bin_folder\*.exe" "$prefix_folder\bin\" |
| 63 | +cp "$openssl_bin_folder\*.pdb" "$prefix_folder\bin\" |
| 64 | +cp "$openssl_libs_folder\*" "$prefix_folder\lib\" -Recurse |
| 65 | +cp "$openssl_include_folder\openssl" "$prefix_folder\include\" -Recurse |
| 66 | + |
| 67 | +cp "$mysql_lib_folder\libmaria*" "$prefix_folder\bin\" |
| 68 | +cp "$mysql_lib_folder\libmaria*" "$prefix_folder\lib\" |
| 69 | + |
| 70 | +# Fixup OpenSSL DLL paths and MySQL paths. |
| 71 | +#$openssl_libs_folder_esc = $openssl_libs_folder -replace '\\','\\' |
| 72 | +#$mysql_lib_folder_esc = $mysql_lib_folder -replace '\\','\\' |
| 73 | + |
| 74 | +#gci -r -include "*.prl" $prefix_folder | foreach-object { $a = $_.fullname; (get-content $a).Replace($openssl_libs_folder_esc, '$$$$[QT_INSTALL_LIBS]\\') | set-content $a } |
| 75 | + |
| 76 | +#gci -r -include "*.prl" $prefix_folder | foreach-object { $a = $_.fullname; (get-content $a).Replace($mysql_lib_folder_esc, '$$$$[QT_INSTALL_LIBS]\\') | set-content $a } |
| 77 | + |
| 78 | +# Create final archive. |
| 79 | +& "$tools_folder\7za.exe" a -t7z "${prefix_base_folder}.7z" "$prefix_folder" -mmt -mx9 |
0 commit comments