2021-06-21 23:33:42 +00:00
|
|
|
#!/bin/bash
|
2024-09-29 22:23:39 +00:00
|
|
|
cd "$(dirname "$(readlink -f "$0" || realpath "$0")")/.." || exit
|
2022-01-26 18:48:46 +00:00
|
|
|
|
2024-10-01 19:50:10 +00:00
|
|
|
rebuild=true
|
|
|
|
|
|
|
|
while [ $# -gt 0 ]; do
|
|
|
|
case "$1" in
|
|
|
|
--no-rebuild)
|
|
|
|
rebuild=false
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
box "Error: Invalid argument."
|
|
|
|
exit 1
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ "$rebuild" == "true" ]; then
|
|
|
|
rm -rf build
|
|
|
|
bash scripts/build.sh
|
|
|
|
fi
|
|
|
|
|
2024-09-29 23:27:30 +00:00
|
|
|
cd build/runtime-pyside6 || exit 1
|
2023-05-26 04:25:29 +00:00
|
|
|
|
2022-01-24 18:27:02 +00:00
|
|
|
rm -rf $(find . -name "*.pyc")
|
2022-01-20 17:19:36 +00:00
|
|
|
|
2024-09-29 23:39:59 +00:00
|
|
|
wine pyinstaller --add-data "LogarithmPlotter/logarithmplotter.svg;." \
|
2024-09-18 21:26:07 +00:00
|
|
|
--add-data "LogarithmPlotter/qml;qml" \
|
|
|
|
--add-data "LogarithmPlotter/i18n;i18n" \
|
|
|
|
--noconsole \
|
|
|
|
LogarithmPlotter/logarithmplotter.py \
|
2024-09-29 23:27:30 +00:00
|
|
|
--icon=../../assets/native/win/logarithmplotter.ico \
|
2024-09-18 21:26:07 +00:00
|
|
|
-n logarithmplotter
|
2023-05-26 04:25:29 +00:00
|
|
|
|
|
|
|
# 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}"
|
2023-10-09 20:26:50 +00:00
|
|
|
cp "$PYSIDE6PATH/Qt6ShaderTools.dll" dist/logarithmplotter/_internal/PySide6/
|
2023-05-26 04:25:29 +00:00
|
|
|
|
|
|
|
# Remove QtWebEngine
|
2023-10-09 20:26:50 +00:00
|
|
|
rm dist/logarithmplotter/_internal/PySide6/Qt6WebEngineCore.dll
|
2023-05-26 04:25:29 +00:00
|
|
|
|
|
|
|
# Remove the QtQuick styles that are unused
|
2023-10-09 20:26:50 +00:00
|
|
|
rm -rf dist/logarithmplotter/_internal/PySide6/qml/QtQuick/Controls/{Imagine,Material,designer}
|
2024-01-11 00:15:43 +00:00
|
|
|
|
|
|
|
# Remove unused tools
|
2024-01-11 18:56:25 +00:00
|
|
|
rm -r dist/logarithmplotter/_internal/PySide6/qml/{Qt3D,QtQuick3D}
|
2024-01-11 00:15:43 +00:00
|
|
|
rm dist/logarithmplotter/_internal/PySide6/Qt6{Pdf.dll,*3D*,Location.dll}
|