From 66da751b3662f85ef812c9f97c1918110356836b Mon Sep 17 00:00:00 2001 From: Ad5001 Date: Fri, 26 May 2023 06:25:29 +0200 Subject: [PATCH] Updating windows builders for pyside6 (halving the bundled installer size) --- scripts/build-windows.bat | 12 ++++++++++-- scripts/build-wine.sh | 18 +++++++++++++++++- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/scripts/build-windows.bat b/scripts/build-windows.bat index a29d291..ef92aee 100644 --- a/scripts/build-windows.bat +++ b/scripts/build-windows.bat @@ -1,5 +1,5 @@ -rem Need pyinstaller >= 4.3, or there is an issue regarding the PATH of the building. -python -m pip install -U pyinstaller>=4.3 +rem Make sure pyinstaller is installed +python -m pip install -U pyinstaller rem Building translations cd "LogarithmPlotter\i18n" @@ -7,3 +7,11 @@ cmd release.sh cd ..\.. pyinstaller --add-data "logplotter.svg;." --add-data "LogarithmPlotter/qml;qml" --add-data "LogarithmPlotter/i18n;i18n" --noconsole LogarithmPlotter/logarithmplotter.py --icon=win/logarithmplotter.ico -n logarithmplotter + +rem Remove QtWebEngine +del dist\logarithmplotter\PySide6\Qt6WebEngineCore.dll +rem Remove the QtQuick styles that are unused +rmdir dist\logarithmplotter\PySide6\qml\QtQuick\Controls\Imagine /s /q +rmdir dist\logarithmplotter\PySide6\qml\QtQuick\Controls\Material /s /q +rmdir dist\logarithmplotter\PySide6\qml\QtQuick\Controls\designer /s /q +rem Remove unused translations diff --git a/scripts/build-wine.sh b/scripts/build-wine.sh index 3406bbc..7ff3394 100644 --- a/scripts/build-wine.sh +++ b/scripts/build-wine.sh @@ -1,7 +1,8 @@ #!/bin/bash cd "$(dirname "$(readlink -f "$0" || realpath "$0")")/.." -# Giving pyinstaller another run +rm -rf dist + rm $(find . -name "*.qmlc") rm -rf $(find . -name "*.pyc") wine python -m pip install -U pyinstaller @@ -12,3 +13,18 @@ bash release.sh cd ../../ wine pyinstaller --add-data "logplotter.svg;." --add-data "LogarithmPlotter/qml;qml" --add-data "LogarithmPlotter/i18n;i18n" --noconsole LogarithmPlotter/logarithmplotter.py --icon=win/logarithmplotter.ico -n logarithmplotter + +# Copy Qt6ShaderTools, a required library for for Qt5Compat +PYSIDE6PATH="$(wine python -c "import PySide6; from os import path; print(path.dirname(PySide6.__file__));")" +# Converting PySide6 path to absolute path +DRIVEC="${WINEPREFIX:-$HOME/.wine}/drive_c" +PYSIDE6PATH="${PYSIDE6PATH%$'\r'}" +PYSIDE6PATH="${PYSIDE6PATH//\\/\/}" +PYSIDE6PATH="${PYSIDE6PATH//C:/$DRIVEC}" +cp "$PYSIDE6PATH/Qt6ShaderTools.dll" dist/logarithmplotter/PySide6/ + +# Remove QtWebEngine +rm dist/logarithmplotter/PySide6/Qt6WebEngineCore.dll + +# Remove the QtQuick styles that are unused +rm -rf dist/logarithmplotter/PySide6/qml/QtQuick/Controls/{Imagine,Material,designer}