1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-22 02:32:29 +01:00

Update to Qt 6.5.2 and bump to 5.15.1

Default to ffmpeg on windows
This commit is contained in:
Elias Steurer 2023-07-24 16:22:09 +02:00
parent daaeeff824
commit 9f4692b808
6 changed files with 65 additions and 54 deletions

3
.vscode/launch.json vendored
View File

@ -1,4 +1,3 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
@ -18,7 +17,7 @@
"environment": [
{
"name": "Path",
"value": "${env:Path};${workspaceFolder}\\..\\aqt\\6.5.1\\msvc2019_64\\bin\\;${workspaceFolder}\\..\\aqt\\6.5.1\\msvc2019_64\\modules\\;${workspaceFolder}\\..\\aqt\\6.5.1\\msvc2019_64\\qml\\;${workspaceFolder}\\..\\vcpkg\\installed\\x64-windows\\debug\\bin;"
"value": "${env:Path};${workspaceFolder}\\..\\aqt\\6.5.2\\msvc2019_64\\bin\\;${workspaceFolder}\\..\\aqt\\6.5.2\\msvc2019_64\\modules\\;${workspaceFolder}\\..\\aqt\\6.5.2\\msvc2019_64\\qml\\;${workspaceFolder}\\..\\vcpkg\\installed\\x64-windows\\debug\\bin;"
}
],
"visualizerFile": "${workspaceFolder}/.vscode/qt.natvis.xml"

View File

@ -17,9 +17,9 @@
"lhs": "${hostSystemName}",
"rhs": "Windows"
},
"environment" : {
"environment": {
"qt_path": "${sourceDir}/../aqt",
"qt_version": "6.5.1"
"qt_version": "6.5.2"
},
"toolset": {
"value": "host=x64",
@ -38,36 +38,36 @@
}
},
{
"name": "windows-debug-qt-6.5.1",
"name": "windows-debug-qt-6.5.2",
"inherits": "default-windows",
"displayName": "MSVC SP Qt 6.5.1 Debug",
"binaryDir": "${sourceDir}/../build_ScreenPlay_Qt_6.5.1_MSVC_Debug",
"displayName": "MSVC SP Qt 6.5.2 Debug",
"binaryDir": "${sourceDir}/../build_ScreenPlay_Qt_6.5.2_MSVC_Debug",
"environment": {
"qt_version": "6.5.1"
"qt_version": "6.5.2"
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "windows-relwithdebinfo-qt-6.5.1",
"name": "windows-relwithdebinfo-qt-6.5.2",
"inherits": "default-windows",
"displayName": "MSVC SP Qt 6.5.1 RelWithDebInfo",
"binaryDir": "${sourceDir}/../build_ScreenPlay_Qt_6.5.1_MSVC_RelWithDebInfo",
"displayName": "MSVC SP Qt 6.5.2 RelWithDebInfo",
"binaryDir": "${sourceDir}/../build_ScreenPlay_Qt_6.5.2_MSVC_RelWithDebInfo",
"environment": {
"qt_version": "6.5.1"
"qt_version": "6.5.2"
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}
},
{
"name": "windows-release-qt-6.5.1",
"name": "windows-release-qt-6.5.2",
"inherits": "default-windows",
"displayName": "MSVC SP Qt 6.5.1 Release",
"binaryDir": "${sourceDir}/../build_ScreenPlay_Qt_6.5.1_MSVC_Release",
"displayName": "MSVC SP Qt 6.5.2 Release",
"binaryDir": "${sourceDir}/../build_ScreenPlay_Qt_6.5.2_MSVC_Release",
"environment": {
"qt_version": "6.5.1"
"qt_version": "6.5.2"
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
@ -78,13 +78,13 @@
"displayName": "ScreenPlay 64bit Debug Linux",
"description": "Linux only!",
"generator": "Ninja",
"binaryDir": "${sourceDir}/../build_ScreenPlay_Qt_6.5.1_GCC_Debug",
"binaryDir": "${sourceDir}/../build_ScreenPlay_Qt_6.5.2_GCC_Debug",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Linux"
},
"environment" : {
"environment": {
"qt_path": "${sourceDir}/../aqt"
},
"architecture": {
@ -95,7 +95,7 @@
"CMAKE_CXX_COMPILER": "g++",
"CMAKE_C_COMPILER": "gcc",
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_PREFIX_PATH": "$env{qt_path}/6.5.1/gcc_64",
"CMAKE_PREFIX_PATH": "$env{qt_path}/6.5.2/gcc_64",
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/../vcpkg/scripts/buildsystems/vcpkg.cmake",
"VCPKG_TARGET_TRIPLET": "x64-linux"
}
@ -103,8 +103,8 @@
{
"name": "linux-relwithdebinfo",
"displayName": "ScreenPlay 64bit RelWithDebInfo Linux",
"inherits":"linux-debug",
"binaryDir": "${sourceDir}/../build_ScreenPlay_Qt_6.5.1_GCC_RelWithDebInfo",
"inherits": "linux-debug",
"binaryDir": "${sourceDir}/../build_ScreenPlay_Qt_6.5.2_GCC_RelWithDebInfo",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}
@ -114,22 +114,22 @@
"displayName": "ScreenPlay 64bit Debug osx",
"description": "Osx only!",
"generator": "Ninja",
"binaryDir": "${sourceDir}/../build_ScreenPlay_Qt_6.5.1_Clang_Debug",
"binaryDir": "${sourceDir}/../build_ScreenPlay_Qt_6.5.2_Clang_Debug",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Darwin"
},
"environment" : {
"environment": {
"qt_path": "${sourceDir}/../aqt"
},
"cacheVariables": {
"VCPKG_OSX_ARCHITECTURES":"arm64;x86_64",
"VCPKG_OSX_ARCHITECTURES": "arm64;x86_64",
"VCPKG_TARGET_TRIPLET": "64-osx-universal",
"CMAKE_CXX_COMPILER": "clang++",
"CMAKE_C_COMPILER": "clang",
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_PREFIX_PATH": "$env{qt_path}/6.5.1/macos",
"CMAKE_PREFIX_PATH": "$env{qt_path}/6.5.2/macos",
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/../vcpkg/scripts/buildsystems/vcpkg.cmake"
}
},
@ -137,7 +137,7 @@
"name": "osx-relwithdebinfo",
"displayName": "ScreenPlay 64bit RelWithDebInfo osx",
"inherits": "osx-debug",
"binaryDir": "${sourceDir}/../build_ScreenPlay_Qt_6.5.1_Clang_RelWithDebInfo",
"binaryDir": "${sourceDir}/../build_ScreenPlay_Qt_6.5.2_Clang_RelWithDebInfo",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}

View File

@ -25,7 +25,9 @@ int main(int argc, char* argv[])
{
#if defined(Q_OS_WIN)
qputenv("QT_MEDIA_BACKEND", "windows"); // Workaround for Qt 6.5.1 crash https://bugreports.qt.io/browse/QTBUG-113832
// Workaround for Qt 6.5.1 crash https://bugreports.qt.io/browse/QTBUG-113832
qputenv("QT_DISABLE_HW_TEXTURES_CONVERSION", "1");
qputenv("QT_MEDIA_BACKEND", "ffmpeg");
#endif
QGuiApplication app(argc, argv);

View File

@ -18,9 +18,10 @@ elif sys.platform == "linux":
OS = "linux"
QT_PLATFORM = "gcc_64"
SCREENPLAY_VERSION = "0.15.0"
QT_PATH = path = Path(os.path.join(os.path.realpath(__file__), "../../../aqt")).resolve()
QT_VERSION = "6.5.1"
SCREENPLAY_VERSION = "0.15.1"
QT_PATH = path = Path(os.path.join(
os.path.realpath(__file__), "../../../aqt")).resolve()
QT_VERSION = "6.5.2"
QT_BIN_PATH = QT_PATH.joinpath(f"{QT_VERSION}/{QT_PLATFORM}/bin")
QT_TOOLS_PATH = QT_PATH.joinpath("Tools/")
QT_IFW_VERSION = "4.6"

View File

@ -36,11 +36,13 @@ class commands_list():
for command in self.commands:
# Check if the command if a string.
if isinstance(command["command"], str):
execute(command["command"], command["cwd"], command["ignore_error"], command["use_shell"], command["print_command"])
execute(command["command"], command["cwd"], command["ignore_error"],
command["use_shell"], command["print_command"])
else:
# Function call
command["command"]()
def download(aqt_path: Path, qt_platform: Path):
if system() == "Windows":
@ -49,19 +51,21 @@ def download(aqt_path: Path, qt_platform: Path):
os = "mac"
elif system() == "Linux":
os = "linux"
# python -m aqt list-qt windows desktop --modules 6.5.1 win64_msvc2019_64
# python -m aqt list-qt windows desktop --modules 6.5.2 win64_msvc2019_64
qt_packages = "qt3d qtquick3d qtconnectivity qt5compat qtimageformats qtmultimedia qtshadertools qtwebchannel qtwebengine qtwebsockets qtwebview qtpositioning"
print(f"Downloading: {qt_packages} to {aqt_path}")
execute(f"{defines.PYTHON_EXECUTABLE} -m aqt install-qt -O {aqt_path} {os} desktop {defines.QT_VERSION} {qt_platform} -m {qt_packages}")
# Tools can only be installed one at the time:
# see: python -m aqt list-tool windows desktop
tools = ["tools_ifw", "tools_qtcreator", "tools_ninja" ,"tools_cmake"]
tools = ["tools_ifw", "tools_qtcreator", "tools_ninja", "tools_cmake"]
if system() == "Windows":
tools += ["tools_opensslv3_x64"]
for tool in tools:
execute(f"{defines.PYTHON_EXECUTABLE} -m aqt install-tool -O {aqt_path} {os} desktop {tool}")
execute(
f"{defines.PYTHON_EXECUTABLE} -m aqt install-tool -O {aqt_path} {os} desktop {tool}")
def setup_qt():
@ -76,24 +80,26 @@ def setup_qt():
elif system() == "Linux":
qt_platform = "gcc_64"
qt_base_path = aqt_path.joinpath(defines.QT_VERSION).resolve()
qt_path = qt_base_path.joinpath(qt_platform).resolve()
if not qt_path.exists():
download(aqt_path, qt_platform)
else:
# Betas & RCs are technically the same version. So limit download to x days
else:
# Betas & RCs are technically the same version. So limit download to x days
days = 30
folder_creation_date: datetime = datetime.datetime.fromtimestamp(qt_base_path.stat().st_mtime, tz=datetime.timezone.utc)
now: datetime = datetime.datetime.now(tz=datetime.timezone.utc)
folder_creation_date: datetime = datetime.datetime.fromtimestamp(
qt_base_path.stat().st_mtime, tz=datetime.timezone.utc)
now: datetime = datetime.datetime.now(tz=datetime.timezone.utc)
two_weeks_ago: datetime = now - datetime.timedelta(days=days)
if(folder_creation_date < two_weeks_ago):
print(f"qt version at `{qt_base_path}` older than {days} days ({folder_creation_date}), redownload!")
if (folder_creation_date < two_weeks_ago):
print(
f"qt version at `{qt_base_path}` older than {days} days ({folder_creation_date}), redownload!")
download(aqt_path, qt_platform)
else:
print(f"Qt {defines.QT_VERSION} is up to date and ready ")
def main():
parser = argparse.ArgumentParser(
description='Build and Package ScreenPlay')
@ -105,10 +111,10 @@ def main():
project_source_parent_path = root_path.joinpath("../").resolve()
vcpkg_path = project_source_parent_path.joinpath("vcpkg").resolve()
vcpkg_packages_list = [
"curl",
"cpp-httplib",
"libarchive"
]
"curl",
"cpp-httplib",
"libarchive"
]
if not args.skip_aqt:
setup_qt()
@ -123,8 +129,8 @@ def main():
vcpkg_triplet = ["x64-windows"]
elif system() == "Darwin":
vcpkg_command = "./vcpkg"
#vcpkg_packages_list.append("infoware[opencl]") does not work with arm
vcpkg_packages_list.append("curl") # Hidden dependency from sentry
# vcpkg_packages_list.append("infoware[opencl]") does not work with arm
vcpkg_packages_list.append("curl") # Hidden dependency from sentry
platform_command = commands_list()
platform_command.add("chmod +x bootstrap-vcpkg.sh", vcpkg_path)
platform_command.add("./bootstrap-vcpkg.sh", vcpkg_path, False)
@ -132,7 +138,7 @@ def main():
vcpkg_triplet = ["64-osx-universal"]
elif system() == "Linux":
vcpkg_command = "./vcpkg"
#vcpkg_packages_list.append("infoware[opengl]")
# vcpkg_packages_list.append("infoware[opengl]")
platform_command = commands_list()
platform_command.add("chmod +x bootstrap-vcpkg.sh", vcpkg_path)
platform_command.add("./bootstrap-vcpkg.sh", vcpkg_path, False)
@ -142,18 +148,21 @@ def main():
raise NotImplementedError("Unknown system: {}".format(system()))
print(f"Clone into {vcpkg_path}")
execute("git clone https://gitlab.com/kelteseth/screenplay-vcpkg vcpkg", project_source_parent_path, True)
execute("git clone https://gitlab.com/kelteseth/screenplay-vcpkg vcpkg",
project_source_parent_path, True)
execute("git fetch", vcpkg_path)
execute(f"git checkout {defines.VCPKG_VERSION}", vcpkg_path)
# Setup vcpkg via boostrap script first
platform_command.execute_commands() # Execute platform specific commands.
platform_command.execute_commands() # Execute platform specific commands.
execute(f"{vcpkg_command} remove --outdated --recurse", vcpkg_path, False)
for triplet in vcpkg_triplet:
vcpkg_packages = " ".join(vcpkg_packages_list)
execute(f"{vcpkg_command} install {vcpkg_packages} --triplet {triplet} --recurse", vcpkg_path, False)
execute(
f"{vcpkg_command} install {vcpkg_packages} --triplet {triplet} --recurse", vcpkg_path, False)
if __name__ == "__main__":
main()
main()