aboutsummaryrefslogtreecommitdiffstats
path: root/build_scripts/wheel_files.py
diff options
context:
space:
mode:
Diffstat (limited to 'build_scripts/wheel_files.py')
-rw-r--r--build_scripts/wheel_files.py232
1 files changed, 164 insertions, 68 deletions
diff --git a/build_scripts/wheel_files.py b/build_scripts/wheel_files.py
index b8caf32ab..2112bba9a 100644
--- a/build_scripts/wheel_files.py
+++ b/build_scripts/wheel_files.py
@@ -2,11 +2,46 @@
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+import json
import sys
from dataclasses import Field, dataclass, field
from typing import Dict, List
+_pyside_package_path = None
+_module_json_file_path = None
+
+
+def set_pyside_package_path(p):
+ global _pyside_package_path, _module_json_file_path
+ _pyside_package_path = p
+ qt_path = p
+ if sys.platform != "win32":
+ qt_path /= "Qt"
+ _module_json_file_path = qt_path / "modules"
+
+
+def get_module_json_data(module):
+ """Read the JSON module data."""
+ json_path = _module_json_file_path / f"{module}.json"
+ json_data = None
+ if not json_path.is_file(): # Wayland is Linux only
+ print(f"Skipping {json_path}", file=sys.stderr)
+ return None
+ with json_path.open(encoding="utf-8") as json_file:
+ json_data = json.load(json_file)
+ return json_data
+
+
+def get_module_plugins(json_data):
+ """Return the plugins from the JSON module data."""
+ if json_data:
+ plugins = json_data.get("plugin_types")
+ if plugins:
+ return plugins
+ return []
+
+
# This dataclass is in charge of holding the file information
# that each Qt module needs to have to be packaged in a wheel
@dataclass
@@ -25,7 +60,6 @@ class ModuleData:
include: List[str] = field(default_factory=list)
glue: List[str] = field(default_factory=list)
metatypes: List[str] = field(default_factory=list)
- examples: List[str] = field(default_factory=list)
plugins: List[str] = field(default_factory=list)
# For special cases when a file/directory doesn't fall into
@@ -55,7 +89,6 @@ class ModuleData:
self.glue.append(f"qt{_lo}.cpp")
if not len(self.metatypes):
self.metatypes.append(f"qt6{_lo}_relwithdebinfo_metatypes.json")
- self.examples.append(f"{_lo}")
# The PySide6 directory that gets packaged by the build_scripts
# 'prepare_packages()' has a certain structure that depends on
@@ -71,7 +104,7 @@ class ModuleData:
self.qml = [f"qml/{i}" for i in self.qml]
self.translations = [f"translations/{i}" for i in self.translations]
self.metatypes = [
- f"lib/metatypes/{i}".replace("_relwithdebinfo", "") for i in self.metatypes
+ f"metatypes/{i}".replace("_relwithdebinfo", "") for i in self.metatypes
]
self.plugins = [f"plugins/{i}" for i in self.plugins]
else:
@@ -83,13 +116,12 @@ class ModuleData:
self.qtlib = [f"Qt/lib/{i}.*{self.ext}*" for i in self.qtlib]
self.qml = [f"Qt/qml/{i}" for i in self.qml]
self.translations = [f"Qt/translations/{i}" for i in self.translations]
- self.metatypes = [f"Qt/lib/metatypes/{i}" for i in self.metatypes]
+ self.metatypes = [f"Qt/metatypes/{i}" for i in self.metatypes]
self.plugins = [f"Qt/plugins/{i}" for i in self.plugins]
self.typesystems = [f"typesystems/{i}" for i in self.typesystems]
self.include = [f"include/{i}" for i in self.include]
self.glue = [f"glue/{i}" for i in self.glue]
- self.examples = [f"examples/{i}" for i in self.examples]
def macos_pyside_wrappers_lib(self, s):
if s.startswith("Qt"):
@@ -125,7 +157,7 @@ def wheel_files_pyside_essentials() -> List[ModuleData]:
module_QtWidgets(),
module_QtHelp(),
module_QtNetwork(),
- module_QtConcurent(),
+ module_QtConcurrent(),
module_QtDBus(),
module_QtDesigner(),
module_QtOpenGL(),
@@ -134,6 +166,7 @@ def wheel_files_pyside_essentials() -> List[ModuleData]:
module_QtQml(),
module_QtQuick(),
module_QtQuickControls2(),
+ module_QtQuickTest(),
module_QtQuickWidgets(),
module_QtXml(),
module_QtTest(),
@@ -141,6 +174,7 @@ def wheel_files_pyside_essentials() -> List[ModuleData]:
module_QtSvg(),
module_QtSvgWidgets(),
module_QtUiTools(),
+ module_QtExampleIcons(),
# Only for plugins
module_QtWayland(),
# there are no bindings for these modules, but their binaries are
@@ -164,6 +198,7 @@ def wheel_files_pyside_addons() -> List[ModuleData]:
module_QtBluetooth(),
module_QtCharts(),
module_QtDataVisualization(),
+ module_QtGraphs(),
module_QtMultimedia(),
module_QtMultimediaWidgets(),
module_QtNetworkAuth(),
@@ -187,16 +222,18 @@ def wheel_files_pyside_addons() -> List[ModuleData]:
module_QtWebEngineWidgets(),
module_QtWebSockets(),
module_QtHttpServer(),
+ module_QtLocation(),
+ module_QtAsyncio(),
]
return files
# Functions that hold the information of all the files that needs
# to be included for the module to work, including Qt libraries,
-# examples, typesystems, glue, etc.
+# typesystems, glue, etc.
def module_QtCore() -> ModuleData:
# QtCore
- data = ModuleData("Core", examples=["corelib"])
+ data = ModuleData("Core")
_typesystems = [
"common.xml",
@@ -208,8 +245,6 @@ def module_QtCore() -> ModuleData:
data.typesystems.extend(_typesystems)
data.include.append("*.h")
if sys.platform == "win32":
- data.plugins.append("assetimporters")
- data.plugins.append("styles")
data.qtlib.append("pyside6.*")
data.extra_files.append("qt.conf")
data.extra_files.append("rcc.exe")
@@ -220,17 +255,9 @@ def module_QtCore() -> ModuleData:
data.extra_files.extend(msvc_redist)
else:
data.lib.append("libpyside6.*")
- if sys.platform == "darwin":
- data.plugins.append("styles")
data.extra_files.append("Qt/libexec/rcc")
data.extra_files.append("Qt/libexec/qt.conf")
- data.examples.append("samplebinding")
- data.examples.append("utils")
-
- if sys.platform == "darwin":
- data.examples.append("macextras")
-
# *.py
data.extra_dirs.append("support")
@@ -273,16 +300,6 @@ def module_QtCore() -> ModuleData:
data.translations.append("qt_help_*")
data.translations.append("qt_*")
- data.extra_files.append("examples/examples.pyproject")
-
- # plugins
- data.plugins.append("platforms")
- data.plugins.append("platformthemes")
- data.plugins.append("platforminputcontexts")
- data.plugins.append("imageformats")
- data.plugins.append("generic")
- data.plugins.append("xcbglintegrations")
-
# Extra libraries
data.qtlib.append("libicudata*")
data.qtlib.append("libicui18n*")
@@ -304,6 +321,7 @@ def module_QtGui() -> ModuleData:
"typesystem_gui_mac.xml",
"typesystem_gui_win.xml",
"typesystem_gui_x11.xml",
+ "typesystem_gui_rhi.xml"
]
_metatypes = [
@@ -323,7 +341,8 @@ def module_QtGui() -> ModuleData:
data.metatypes.extend(_metatypes)
data.qtlib.extend(_qtlib)
- data.plugins.append("egldeviceintegrations")
+ json_data = get_module_json_data("Gui")
+ data.plugins = get_module_plugins(json_data)
data.extra_files.append("Qt/plugins/platforms/libqeglfs*")
return data
@@ -338,10 +357,8 @@ def module_QtWidgets() -> ModuleData:
data.extra_files.append("uic.exe")
else:
data.extra_files.append("Qt/libexec/uic")
-
- data.examples.append("widgetbinding")
- data.examples.append("scriptableapplication")
- data.examples.append("external")
+ json_data = get_module_json_data("Widgets")
+ data.plugins = get_module_plugins(json_data)
return data
@@ -354,19 +371,20 @@ def module_QtHelp() -> ModuleData:
def module_QtNetwork() -> ModuleData:
data = ModuleData("Network")
- data.plugins.append("networkinformation")
- data.plugins.append("tls")
+ json_data = get_module_json_data("Network")
+ data.plugins = get_module_plugins(json_data)
return data
def module_QtBluetooth() -> ModuleData:
data = ModuleData("Bluetooth")
+ data.translations.append("qtconnectivity_*")
return data
-def module_QtConcurent() -> ModuleData:
+def module_QtConcurrent() -> ModuleData:
data = ModuleData("Concurrent")
return data
@@ -382,7 +400,8 @@ def module_QtDesigner() -> ModuleData:
data = ModuleData("Designer")
data.qtlib.append("libQt6DesignerComponents")
data.metatypes.append("qt6designercomponentsprivate_relwithdebinfo_metatypes.json")
- data.plugins.append("designer")
+ json_data = get_module_json_data("Designer")
+ data.plugins = get_module_plugins(json_data)
data.extra_files.append("Qt/plugins/assetimporters/libuip*")
# Designer
@@ -403,6 +422,7 @@ def module_QtNfc() -> ModuleData:
def module_QtPdf() -> ModuleData:
data = ModuleData("Pdf")
+ data.qtlib.append("libQt6PdfQuick")
return data
@@ -416,13 +436,18 @@ def module_QtPdfWidgets() -> ModuleData:
def module_QtPrintSupport() -> ModuleData:
data = ModuleData("PrintSupport")
data.typesystems.append("typesystem_printsupport_common.xml")
- data.plugins.append("printsupport")
+ json_data = get_module_json_data("PrintSupport")
+ data.plugins = get_module_plugins(json_data)
return data
def module_QtQml() -> ModuleData:
data = ModuleData("Qml")
+ json_data = get_module_json_data("Qml")
+ data.plugins = get_module_plugins(json_data)
+ json_data = get_module_json_data("QmlCompilerPrivate")
+ data.plugins += get_module_plugins(json_data)
_qtlib = [
"libQt6LabsAnimation",
@@ -434,6 +459,7 @@ def module_QtQml() -> ModuleData:
"libQt6QmlCore",
"libQt6QmlLocalStorage",
"libQt6QmlModels",
+ "libQt6QmlNetwork",
"libQt6QmlWorkerScript",
"libQt6QmlXmlListModel",
"libQt6QmlCompiler"
@@ -476,8 +502,8 @@ def module_QtQml() -> ModuleData:
]
data.lib.append("libpyside6qml")
- data.examples.append("declarative")
- data.plugins.append("qmltooling")
+ json_data = get_module_json_data("Qml")
+ data.plugins = get_module_plugins(json_data)
data.translations.append("qtdeclarative_*")
if sys.platform == "win32":
data.extra_files.append("pyside6qml.*.lib")
@@ -486,11 +512,13 @@ def module_QtQml() -> ModuleData:
data.extra_files.append("qml/jsroot.qmltypes")
data.extra_files.append("qmlimportscanner.exe")
data.extra_files.append("qmltyperegistrar.exe")
+ data.extra_files.append("qmlcachegen.exe")
else:
data.extra_files.append("Qt/qml/builtins.qmltypes")
data.extra_files.append("Qt/qml/jsroot.qmltypes")
data.extra_files.append("Qt/libexec/qmlimportscanner")
data.extra_files.append("Qt/libexec/qmltyperegistrar")
+ data.extra_files.append("Qt/libexec/qmlcachegen")
data.qtlib.extend(_qtlib)
data.include.extend(_include)
@@ -511,6 +539,7 @@ def module_QtQuick() -> ModuleData:
"qt6quickdialogs2_relwithdebinfo_metatypes.json",
"qt6quickdialogs2quickimpl_relwithdebinfo_metatypes.json",
"qt6quickdialogs2utils_relwithdebinfo_metatypes.json",
+ "qt6quickeffectsprivate_relwithdebinfo_metatypes.json",
"qt6quicketest_relwithdebinfo_metatypes.json",
"qt6quicketestutilsprivate_relwithdebinfo_metatypes.json",
"qt6quicklayouts_relwithdebinfo_metatypes.json",
@@ -522,6 +551,7 @@ def module_QtQuick() -> ModuleData:
"qt6quicktimeline_relwithdebinfo_metatypes.json",
]
_qtlib = [
+ "libQt6QuickEffects",
"libQt6QuickDialogs2",
"libQt6QuickDialogs2QuickImpl",
"libQt6QuickDialogs2Utils",
@@ -531,6 +561,7 @@ def module_QtQuick() -> ModuleData:
"libQt6QuickTemplates2",
"libQt6QuickTest",
"libQt6QuickTimeline",
+ "libQt6QuickTimelineBlendTrees",
]
# Adding GraphicalEffects files
@@ -538,18 +569,43 @@ def module_QtQuick() -> ModuleData:
data.qtlib.extend(_qtlib)
data.metatypes.extend(_metatypes)
+ json_data = get_module_json_data("Quick")
+ data.plugins = get_module_plugins(json_data)
return data
def module_QtQuickControls2() -> ModuleData:
data = ModuleData("QuickControls2")
+ data.qtlib.append("libQt6QuickControls2")
+ data.qtlib.append("libQt6QuickControls2Basic")
+ data.qtlib.append("libQt6QuickControls2BasicStyleImpl")
+ data.qtlib.append("libQt6QuickControls2Fusion")
+ data.qtlib.append("libQt6QuickControls2FusionStyleImpl")
+ data.qtlib.append("libQt6QuickControls2Imagine")
+ data.qtlib.append("libQt6QuickControls2ImagineStyleImpl")
data.qtlib.append("libQt6QuickControls2Impl")
+ data.qtlib.append("libQt6QuickControls2Material")
+ data.qtlib.append("libQt6QuickControls2MaterialStyleImpl")
+ data.qtlib.append("libQt6QuickControls2Universal")
+ data.qtlib.append("libQt6QuickControls2UniversalStyleImpl")
+ if sys.platform == "win32":
+ data.qtlib.append("libQt6QuickControls2WindowsStyleImpl")
+ elif sys.platform == "darwin":
+ data.qtlib.append("libQt6QuickControls2IOSStyleImpl")
+ data.qtlib.append("libQt6QuickControls2MacOSStyleImpl")
+
data.metatypes.append("qt6quickcontrols2impl_relwithdebinfo_metatypes.json")
return data
+def module_QtQuickTest() -> ModuleData:
+ data = ModuleData("QuickTest")
+
+ return data
+
+
def module_QtQuickWidgets() -> ModuleData:
data = ModuleData("QuickWidgets")
return data
@@ -567,14 +623,14 @@ def module_QtTest() -> ModuleData:
def module_QtSql() -> ModuleData:
data = ModuleData("Sql")
- data.plugins.append("sqldrivers")
+ json_data = get_module_json_data("Sql")
+ data.plugins = get_module_plugins(json_data)
return data
def module_QtSvg() -> ModuleData:
data = ModuleData("Svg")
- data.plugins.append("iconengines")
return data
@@ -587,7 +643,8 @@ def module_QtSvgWidgets() -> ModuleData:
def module_QtTextToSpeech() -> ModuleData:
data = ModuleData("TextToSpeech")
- data.plugins.append("texttospeech")
+ json_data = get_module_json_data("TextToSpeech")
+ data.plugins = get_module_plugins(json_data)
return data
@@ -615,34 +672,18 @@ def module_QtWayland() -> ModuleData:
"qt6wlshellintegrationprivate_relwithdebinfo_metatypes.json",
]
- # This is added by module_QtCore()
- # data.plugins.append("platforms")
- _plugins = [
- "wayland-decoration",
- "wayland-decoration-client",
- "wayland-graphics-integration-client",
- "wayland-graphics-integration-server",
- "wayland-shell-integration",
- ]
-
data.qtlib.extend(_qtlib)
data.metatypes.extend(_metatypes)
- data.plugins.extend(_plugins)
+ json_data = get_module_json_data("WaylandClient")
+ data.plugins = get_module_plugins(json_data)
+ json_data = get_module_json_data("WaylandCompositor")
+ data.plugins += get_module_plugins(json_data)
return data
def module_Qt3DCore() -> ModuleData:
data = ModuleData("3DCore", qml=["Qt3D/Core"])
- _plugins = [
- "geometryloaders",
- "renderers",
- "renderplugins",
- "sceneparsers",
- ]
-
- data.plugins.extend(_plugins)
- data.examples.append("3d")
return data
@@ -660,6 +701,8 @@ def module_Qt3DExtras() -> ModuleData:
def module_Qt3DInput() -> ModuleData:
data = ModuleData("3DInput", qml=["Qt3D/Input"])
+ json_data = get_module_json_data("3DInput")
+ data.plugins = get_module_plugins(json_data)
return data
@@ -672,6 +715,8 @@ def module_Qt3DLogic() -> ModuleData:
def module_Qt3DRender() -> ModuleData:
data = ModuleData("3DRender", qml=["Qt3D/Render"])
+ json_data = get_module_json_data("3DRender")
+ data.plugins = get_module_plugins(json_data)
return data
@@ -685,10 +730,14 @@ def module_QtQuick3D() -> ModuleData:
"libQt6Quick3DEffects",
"libQt6Quick3DGlslParser",
"libQt6Quick3DHelpers",
+ "libQt6Quick3DHelpersImpl",
"libQt6Quick3DIblBaker",
"libQt6Quick3DParticleEffects",
"libQt6Quick3DParticles",
+ "libQt6Quick3DPhysics",
+ "libQt6Quick3DPhysicsHelpers",
"libQt6Quick3DRuntimeRender",
+ "libQt6Quick3DSpatialAudio",
"libQt6Quick3DUtils",
"libQt6ShaderTools",
"libQt63DQuick",
@@ -720,9 +769,13 @@ def module_QtQuick3D() -> ModuleData:
"qt6shadertools_relwithdebinfo_metatypes.json",
]
+ json_data = get_module_json_data("Quick3DAssetImport")
+ data.plugins = get_module_plugins(json_data)
data.qtlib.extend(_qtlib)
data.metatypes.extend(_metatypes)
data.extra_files.append("Qt/plugins/assetimporters/libassimp*")
+ data.extra_files.append("qsb*")
+ data.extra_files.append("balsam*")
return data
@@ -743,6 +796,7 @@ def module_QtWebEngineCore() -> ModuleData:
data.extra_dirs.append("Qt/resources")
if sys.platform == "win32":
data.extra_files.append("resources/qtwebengine*.pak")
+ data.extra_files.append("resources/v8_context_snapshot*.*")
data.extra_files.append("QtWebEngineProcess.exe")
else:
data.extra_files.append("Qt/libexec/QtWebEngineProcess")
@@ -781,12 +835,24 @@ def module_QtDataVisualization() -> ModuleData:
return data
+def module_QtGraphs() -> ModuleData:
+ data = ModuleData("Graphs")
+
+ return data
+
+
def module_QtMultimedia() -> ModuleData:
data = ModuleData("Multimedia")
data.qtlib.append("libQt6MultimediaQuick")
data.metatypes.append("qt6multimediaquickprivate_relwithdebinfo_metatypes.json")
+
+ json_data = get_module_json_data("Multimedia")
data.translations.append("qtmultimedia_*")
- data.plugins.append("multimedia")
+ data.plugins = get_module_plugins(json_data)
+
+ if sys.platform == "win32":
+ data.extra_files.extend(["avcodec-60.dll", "avformat-60.dll", "avutil-58.dll",
+ "swresample-4.dll", "swscale-7.dll"])
return data
@@ -807,7 +873,8 @@ def module_QtPositioning() -> ModuleData:
data = ModuleData("Positioning")
data.qtlib.append("libQt6PositioningQuick")
data.metatypes.append("qt6positioningquick_relwithdebinfo_metatypes.json")
- data.plugins.append("position")
+ json_data = get_module_json_data("Positioning")
+ data.plugins = get_module_plugins(json_data)
return data
@@ -824,7 +891,8 @@ def module_QtSensors() -> ModuleData:
data = ModuleData("Sensors")
data.qtlib.append("libQt6SensorsQuick")
data.metatypes.append("qt6sensorsquick_relwithdebinfo_metatypes.json")
- data.plugins.append("sensors")
+ json_data = get_module_json_data("Sensors")
+ data.plugins = get_module_plugins(json_data)
return data
@@ -855,13 +923,15 @@ def module_QtScxml() -> ModuleData:
data = ModuleData("Scxml")
data.qtlib.append("libQt6ScxmlQml")
data.metatypes.append("qt6scxmlqml_relwithdebinfo_metatypes.json")
- data.plugins.append("scxmldatamodel")
+ json_data = get_module_json_data("Scxml")
+ data.plugins = get_module_plugins(json_data)
return data
def module_QtWebChannel() -> ModuleData:
data = ModuleData("WebChannel")
+ data.qtlib.append("libQt6WebChannelQuick")
return data
@@ -877,6 +947,10 @@ def module_QtOpenGL() -> ModuleData:
data = ModuleData("OpenGL")
_typesystems = [
"opengl_common.xml",
+ "typesystem_glgeti_v_includes.xml",
+ "typesystem_glgeti_v_modifications.xml",
+ "typesystem_glgetv_includes.xml",
+ "typesystem_glgetv_modifications.xml",
"typesystem_opengl_modifications1_0.xml",
"typesystem_opengl_modifications1_0_compat.xml",
"typesystem_opengl_modifications1_1.xml",
@@ -915,13 +989,16 @@ def module_QtOpenGLWidgets() -> ModuleData:
def module_QtSerialBus() -> ModuleData:
data = ModuleData("SerialBus")
- data.plugins.append("canbus")
+ json_data = get_module_json_data("SerialBus")
+ data.plugins = get_module_plugins(json_data)
return data
def module_QtVirtualKeyboard() -> ModuleData:
data = ModuleData("VirtualKeyboard")
data.plugins.append("virtualkeyboard")
+ data.qtlib.append("libQt6VirtualKeyboardSettings")
+
return data
@@ -940,3 +1017,22 @@ def module_QtJsonRpc() -> ModuleData:
data = ModuleData("JsonRpc")
data.metatypes.append("qt6jsonrpcprivate_relwithdebinfo_metatypes.json")
return data
+
+
+def module_QtLocation() -> ModuleData:
+ data = ModuleData("Location")
+ json_data = get_module_json_data("Location")
+ data.plugins = get_module_plugins(json_data)
+ data.translations.append("qtlocation_*")
+ return data
+
+
+def module_QtAsyncio() -> ModuleData:
+ data = ModuleData("Asyncio")
+ data.extra_dirs.append("QtAsyncio")
+ return data
+
+
+def module_QtExampleIcons() -> ModuleData:
+ data = ModuleData("ExampleIcons")
+ return data