update for Qt6

remove jom
change to 64bit visual studio
use cmake/ninja
update examples
replace zip with xz
add option to archive pdbs
This commit is contained in:
Shawn Hoffman
2022-04-02 16:07:59 -07:00
parent 2f470a1495
commit b37aa70a28
11 changed files with 214 additions and 343 deletions

5
.gitignore vendored
View File

@@ -2,7 +2,10 @@
__pycache__
# Ignore directories created by the utility / build process
dist
jom
archives
qt-everywhere-*
*.build
CMakeFiles/
bin/
config.opt*
config.tests/

View File

@@ -1,125 +0,0 @@
release: 5.15.0
platform: win32-msvc
name: dolphin.amd64
compiler:
name: visual_studio
version: 2019
edition: Community
vcvarsall: amd64
configure:
nomake:
- examples
- tests
skip:
- qt3d
- qtactiveqt
- qtandroidextras
- qtcharts
- qtconnectivity
- qtdatavis3d
- qtdoc
- qtgamepad
- qtgraphicaleffects
- qtlocation
- qtlottie
- qtmacextras
- qtmultimedia
- qtnetworkauth
- qtpurchasing
- qtquick3d
- qtquickcontrols
- qtquicktimeline
- qtremoteobjects
- qtscript
- qtscxml
- qtsensors
- qtserialbus
- qtserialport
- qtspeech
- qtsvg
- qtwayland
- qtwebchannel
- qtwebengine
- qtwebsockets
- qtwebview
- qtx11extras
- qtxmlpatterns
feature:
bearermanagement: false
concurrent: false
dbus: false
imageformat_bmp: false
qml-devtools: false
qml-worker-script: false
quick-particles: false
quick-path: false
sql-odbc: false
sql-sqlite: false
tiff: false
vulkan: false
webp: false
postprocess:
delete:
- bin/assistant.exe
- bin/designer.exe
- bin/linguist.exe
- bin/Qt5PrintSupport.dll
- bin/Qt5PrintSupportd.dll
- bin/Qt5QmlModels.dll
- bin/Qt5QmlModelsd.dll
- bin/Qt5QuickTest.dll
- bin/Qt5QuickTestd.dll
- bin/Qt5Sql.dll
- bin/Qt5Sqld.dll
- bin/Qt5Test.dll
- bin/Qt5Testd.dll
- bin/Qt5Xml.dll
- bin/Qt5Xmld.dll
- doc
- include/QtDesigner
- include/QtDesignerComponents
- include/QtPrintSupport
- include/QtQmlDebug
- include/QtQmlModels
- include/QtQuickTest
- include/QtSql
- include/QtTest
- include/Qt5Xml
- lib/Qt5Designer.lib
- lib/Qt5Designerd.lib
- lib/Qt5DesignerComponents.lib
- lib/Qt5DesignerComponentsd.lib
- lib/Qt5PrintSupport.lib
- lib/Qt5PrintSupportd.lib
- lib/Qt5QmlDebug.lib
- lib/Qt5QmlDebugd.lib
- lib/Qt5QmlModels.lib
- lib/Qt5QmlModelsd.lib
- lib/Qt5QuickTest.lib
- lib/Qt5QuickTestd.lib
- lib/Qt5Sql.lib
- lib/Qt5Sqld.lib
- lib/Qt5Test.lib
- lib/Qt5Testd.lib
- lib/Qt5Xml.lib
- lib/Qt5Xmld.lib
- lib/cmake/Qt5Designer
- lib/cmake/Qt5DesignerComponents
- lib/cmake/Qt5PrintSupport
- lib/cmake/Qt5QmlDebug
- lib/cmake/Qt5QmlModels
- lib/cmake/Qt5QuickTest
- lib/cmake/Qt5Sql
- lib/cmake/Qt5Test
- lib/cmake/Qt5Xml
- phrasebooks
- plugins/printsupport
- plugins/qmltooling
- qml/QtTest
- translations
delete_regex:
- .*\.prl
- .*\.pdb

View File

@@ -1,129 +1,82 @@
release: 5.15.0
cross: true
hostbindir: ..\dist\dolphin.amd64_5.15.0\bin
platform: win32-arm64-msvc2017
release: 6.2.4
host_path: ..\dist\dolphin.x64_6.2.4
platform: win32-arm64-msvc
name: dolphin.arm64
compiler:
name: visual_studio
version: 2019
version: 2022
edition: Community
cross: true
vcvarsall: x64_arm64
configure:
additional_parameters: -opengl es2 -angle
additional_parameters: -c++std c++20 -debug-and-release -force-debug-info -ltcg -no-opengl
nomake:
- examples
- tests
skip:
- qt3d
- qt5compat
- qtactiveqt
- qtandroidextras
- qtcharts
- qtcoap
- qtconnectivity
- qtdatavis3d
- qtdeclarative
- qtdoc
- qtgamepad
- qtgraphicaleffects
- qtlocation
- qtlottie
- qtmacextras
- qtmqtt
- qtmultimedia
- qtnetworkauth
- qtpurchasing
- qtopcua
- qtpositioning
- qtquick3d
- qtquickcontrols
- qtquicktimeline
- qtremoteobjects
- qtscript
- qtscxml
- qtsensors
- qtserialbus
- qtserialport
- qtspeech
- qtshadertools
- qtsvg
- qttools
- qttranslations
- qtvirtualkeyboard
- qtwayland
- qtwebchannel
- qtwebengine
- qtwebsockets
- qtwebview
- qtx11extras
- qtxmlpatterns
feature:
bearermanagement: false
concurrent: false
dbus: false
imageformat_bmp: false
qml-devtools: false
qml-worker-script: false
quick-particles: false
quick-path: false
sql-odbc: false
sql-sqlite: false
network: false
printsupport: false
qmake: false
sql: false
testlib: false
textmarkdownreader: false
textmarkdownwriter: false
textodfwriter: false
tiff: false
vulkan: false
webp: false
postprocess:
delete:
- bin/assistant.exe
- bin/designer.exe
- bin/linguist.exe
- bin/Qt5PrintSupport.dll
- bin/Qt5PrintSupportd.dll
- bin/Qt5QmlModels.dll
- bin/Qt5QmlModelsd.dll
- bin/Qt5QuickTest.dll
- bin/Qt5QuickTestd.dll
- bin/Qt5Sql.dll
- bin/Qt5Sqld.dll
- bin/Qt5Test.dll
- bin/Qt5Testd.dll
- bin/Qt5Xml.dll
- bin/Qt5Xmld.dll
- doc
- include/QtDesigner
- include/QtDesignerComponents
- include/QtPrintSupport
- include/QtQmlDebug
- include/QtQmlModels
- include/QtQuickTest
- include/QtSql
- include/QtTest
- include/Qt5Xml
- lib/Qt5Designer.lib
- lib/Qt5Designerd.lib
- lib/Qt5DesignerComponents.lib
- lib/Qt5DesignerComponentsd.lib
- lib/Qt5PrintSupport.lib
- lib/Qt5PrintSupportd.lib
- lib/Qt5QmlDebug.lib
- lib/Qt5QmlDebugd.lib
- lib/Qt5QmlModels.lib
- lib/Qt5QmlModelsd.lib
- lib/Qt5QuickTest.lib
- lib/Qt5QuickTestd.lib
- lib/Qt5Sql.lib
- lib/Qt5Sqld.lib
- lib/Qt5Test.lib
- lib/Qt5Testd.lib
- lib/Qt5Xml.lib
- lib/Qt5Xmld.lib
- lib/cmake/Qt5Designer
- lib/cmake/Qt5DesignerComponents
- lib/cmake/Qt5PrintSupport
- lib/cmake/Qt5QmlDebug
- lib/cmake/Qt5QmlModels
- lib/cmake/Qt5QuickTest
- lib/cmake/Qt5Sql
- lib/cmake/Qt5Test
- lib/cmake/Qt5Xml
- phrasebooks
- plugins/printsupport
- plugins/qmltooling
- qml/QtTest
- translations
- include/QtXml
- lib/cmake/Qt6Xml
- mkspecs
- modules/Xml.json
delete_regex:
- bin\\android.*
- bin\\Qt6Xml.*
- bin\\.*\.bat
- bin\\.*\.cmake
- bin\\.*\.conf
- bin\\.*\.pl
- lib\\metatypes\\qt6xml_.*\.json
- lib\\Qt6Xml.*
- .*\.prl
- .*\.pdb
archive_pdbs: true

81
examples/dolphin-x64.yml Normal file
View File

@@ -0,0 +1,81 @@
release: 6.2.4
platform: win32-msvc
name: dolphin.x64
compiler:
name: visual_studio
version: 2022
edition: Community
vcvarsall: x64
configure:
additional_parameters: -c++std c++20 -debug-and-release -force-debug-info -ltcg -no-opengl
nomake:
- examples
- tests
skip:
- qt3d
- qt5compat
- qtactiveqt
- qtcharts
- qtcoap
- qtconnectivity
- qtdatavis3d
- qtdeclarative
- qtdoc
- qtlottie
- qtmqtt
- qtmultimedia
- qtnetworkauth
- qtopcua
- qtpositioning
- qtquick3d
- qtquicktimeline
- qtremoteobjects
- qtscxml
- qtsensors
- qtserialbus
- qtserialport
- qtshadertools
- qtsvg
- qttools
- qttranslations
- qtvirtualkeyboard
- qtwayland
- qtwebchannel
- qtwebengine
- qtwebsockets
- qtwebview
feature:
concurrent: false
dbus: false
imageformat_bmp: false
network: false
printsupport: false
qmake: false
sql: false
testlib: false
textmarkdownreader: false
textmarkdownwriter: false
textodfwriter: false
tiff: false
webp: false
postprocess:
delete:
- doc
- include/QtXml
- lib/cmake/Qt6Xml
- mkspecs
- modules/Xml.json
delete_regex:
# needed if the outputs are to be used as cross compile host tools
#- bin\\android.*
- bin\\Qt6Xml.*
- bin\\.*\.bat
- bin\\.*\.cmake
- bin\\.*\.pl
- lib\\metatypes\\qt6xml_.*\.json
- lib\\Qt6Xml.*
- .*\.prl
archive_pdbs: true

View File

@@ -29,8 +29,6 @@ WINBUILD_PATH = os.path.join(DATA_PATH, "winbuild.bat")
# Settings
REPO_BASE_URL = "https://download.qt.io/"
REPO_SRC_PATH = "{0}/official_releases/qt/{1}/{2}/single/qt-everywhere-src-{2}.zip"
REPO_JOM_PATH = "{0}/official_releases/jom/jom.zip"
REPO_SRC_PATH = "{0}/official_releases/qt/{1}/{2}/single/qt-everywhere-src-{2}.tar.xz"
USE_CACHE = True
USE_JOM = True

View File

@@ -19,7 +19,7 @@
import argparse
import os
import zipfile
from pathlib import Path
import yaml
@@ -27,49 +27,25 @@ import qsc
from qsc.download import download_release, download_file
from qsc.extract import extract_release
from qsc.postprocess import postprocess_dir
from qsc.requirements import check_requirements, is_jom_present
from qsc.requirements import check_requirements
def parse_args():
parser = argparse.ArgumentParser(description="QSC builds your own custom Qt")
parser.add_argument("--cache", dest="use_cache", action="store_true")
parser.add_argument("--no-cache", dest="use_cache", action="store_false")
parser.add_argument("--jom", dest="use_jom", action="store_true")
parser.add_argument("--no-jom", dest="use_jom", action="store_false")
parser.add_argument("--continue", dest="do_continue", action="store_true")
parser.add_argument("--mirror", dest="mirror", default="https://download.qt.io/")
parser.add_argument("manifest")
parser.set_defaults(use_cache=True, use_jom=True, do_continue=False)
parser.set_defaults(use_cache=True, do_continue=False)
args = parser.parse_args()
qsc.USE_CACHE = args.use_cache
qsc.USE_JOM = args.use_jom
qsc.REPO_BASE_URL = args.mirror
return args
def install_jom():
if os.path.isfile(os.path.join("jom", "jom.exe")):
return
if not os.path.isdir("jom"):
os.mkdir("jom")
os.chdir("jom")
url = qsc.REPO_JOM_PATH.format(qsc.REPO_BASE_URL)
download_path = "jom.zip"
download_file(url, download_path)
with zipfile.ZipFile(download_path, "r") as f:
f.extract("jom.exe")
os.remove("jom.zip")
os.chdir("..")
if __name__ == "__main__":
args = parse_args()
@@ -90,12 +66,6 @@ if __name__ == "__main__":
download_release(release)
extract_release(release)
if qsc.USE_JOM and qsc.is_windows():
if not is_jom_present():
print("Jom not present, using own...")
install_jom()
os.putenv("PATH", os.environ["PATH"]+";"+os.path.join(os.getcwd(), "jom"))
if os.path.isdir(build_dir):
if not args.do_continue:
print("Build directory already exists - aborting (specify --continue to ignore)")
@@ -124,18 +94,15 @@ if __name__ == "__main__":
os.putenv("RELEASE", release)
os.putenv("OUTNAME", output_path)
platform = ""
# Platform
if config.get("cross", False) == "true":
hostbindir = os.path.abspath(config["hostbindir"])
platform = "-xplatform "+config["platform"]+ " -external-hostbindir "+hostbindir
elif config.get("platform", False):
platform = "-platform "+config["platform"]
platform = config.get("platform")
if platform is not None:
os.putenv("QT_PLATFORM", "-platform "+platform)
os.putenv("QT_PLATFORM", platform)
os.putenv("USE_JOM", str(int(qsc.USE_JOM and compiler["name"] == "visual_studio")))
host_path = config.get("host_path")
if host_path is not None:
host_path = "-qt-host-path " + str(Path(host_path).resolve())
os.putenv("QT_HOST_PATH", host_path)
# Config options
@@ -143,10 +110,6 @@ if __name__ == "__main__":
configure_options = ""
# Use mp if we're not using jom
if not args.use_jom and compiler["name"] == "visual_studio":
configure_options += " -mp"
if configure:
# -nomake
for entry in configure.get("nomake", []):

View File

@@ -18,9 +18,9 @@ REM along with this program. If not, see <http://www.gnu.org/licenses/>.
IF "%USE_VS%"=="1" (
if "%VCVARSALL%"=="" (
call "%PROGRAMFILES(x86)%\Microsoft Visual Studio\%VS_VERSION%\%VS_EDITION%\Common7\Tools\VsDevCmd.bat"
call "%PROGRAMFILES%\Microsoft Visual Studio\%VS_VERSION%\%VS_EDITION%\Common7\Tools\VsDevCmd.bat"
) else (
call "%PROGRAMFILES(x86)%\Microsoft Visual Studio\%VS_VERSION%\%VS_EDITION%\VC\Auxiliary\Build\vcvarsall.bat" %VCVARSALL%
call "%PROGRAMFILES%\Microsoft Visual Studio\%VS_VERSION%\%VS_EDITION%\VC\Auxiliary\Build\vcvarsall.bat" %VCVARSALL%
)
)
@@ -31,7 +31,8 @@ call ..\qt-everywhere-src-%RELEASE%\configure.bat ^
-nomake examples -nomake tests ^
%QT_CONFIGURE_OPTIONS% ^
-prefix %OUTNAME% ^
%QT_PLATFORM%
%QT_PLATFORM% ^
%QT_HOST_PATH%
IF NOT "%ERRORLEVEL%"=="0" (
echo An error occured while configuring! Exit code is %ERRORLEVEL%
@@ -41,11 +42,7 @@ IF NOT "%ERRORLEVEL%"=="0" (
:compile
title Compiling...
echo Compiling...
IF "%USE_JOM%"=="1" (
jom
) ELSE (
nmake
)
cmake --build . --parallel
IF NOT "%ERRORLEVEL%"=="0" (
echo An error occured while compiling! Exit code is %ERRORLEVEL%
@@ -55,11 +52,7 @@ IF NOT "%ERRORLEVEL%"=="0" (
:install
title Installing...
echo Installing...
if "%USE_JOM%"=="1" (
jom install
) ELSE (
nmake install
)
ninja install
IF NOT "%ERRORLEVEL%"=="0" (
echo An error occured while installing! Exit code is %ERRORLEVEL%

View File

@@ -17,7 +17,7 @@
"""All the download related stuff goes here"""
import os
from pathlib import Path
import qsc
import requests
import shutil
@@ -33,18 +33,17 @@ def download_file(url, path):
def download_release(release):
url = source_url(release)
download_path = os.path.join("archives", "qt-everywhere-src-{}.zip".format(release))
archive_dir = Path("archives")
download_path = archive_dir / f"qt-everywhere-src-{release}.tar.xz"
print("Downloading Qt {}...".format(release), end="", flush=True)
print(f"Downloading Qt {release}...", end="", flush=True)
if not os.path.isdir("archives"):
os.mkdir("archives")
archive_dir.mkdir(exist_ok=True)
if qsc.USE_CACHE and os.path.isfile(download_path):
if qsc.USE_CACHE and download_path.is_file():
print("Cached")
return
download_file(url, download_path)
print("Done")

View File

@@ -17,23 +17,23 @@
"""Extracting archives and stuff"""
import os
import zipfile
from pathlib import Path
import tarfile
import qsc
def extract_release(release):
name = "qt-everywhere-src-{}".format(release)
name = f"qt-everywhere-src-{release}"
zip_path = os.path.join("archives", name+".zip")
archive_path = Path("archives") / (name + ".tar.xz")
print("Extracting...", end="", flush=True)
if qsc.USE_CACHE and os.path.isdir(name):
if qsc.USE_CACHE and Path(name).is_dir():
print("Cached")
return
with zipfile.ZipFile(zip_path, "r") as zip:
zip.extractall(".")
with tarfile.open(archive_path) as f:
f.extractall(".")
print("Done")

View File

@@ -20,6 +20,7 @@ import os
from pathlib import Path
import shutil
import re
import tarfile
def postprocess_dir(basedir, config):
@@ -54,3 +55,11 @@ def postprocess_dir(basedir, config):
shutil.rmtree(e)
elif os.path.isfile(e):
os.remove(e)
if config.get('archive_pdbs', False):
with tarfile.open('pdbs.tar.xz', 'w:xz') as archive:
print('archiving pdbs...')
for path in Path(".").rglob("*.pdb"):
print(path)
archive.add(path)
path.unlink()

View File

@@ -33,9 +33,6 @@ def is_in_path(program):
return False
def is_jom_present():
return is_in_path("jom")
def check_requirements():
print("Requirements:\n")