2021-06-21 23:33:42 +00:00
|
|
|
#!/usr/bin/env bash
|
2023-05-27 08:36:37 +00:00
|
|
|
DIR="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
2024-09-29 22:23:39 +00:00
|
|
|
cd "$DIR/.." || exit 1
|
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
|
2022-01-26 18:48:46 +00:00
|
|
|
|
2021-06-21 23:33:42 +00:00
|
|
|
rm $(find . -name "*.pyc")
|
2022-01-20 17:19:36 +00:00
|
|
|
|
2021-06-22 16:39:03 +00:00
|
|
|
pyinstaller --add-data "LogarithmPlotter/qml:qml" \
|
2022-01-20 17:19:36 +00:00
|
|
|
--add-data "LogarithmPlotter/i18n:i18n" \
|
2024-10-29 00:37:44 +00:00
|
|
|
--add-data "../../LICENSE.md:." \
|
|
|
|
--add-data "../../assets/native/mac/logarithmplotterfile.icns:." \
|
|
|
|
--add-data "../../README.md:." \
|
2021-06-21 23:33:42 +00:00
|
|
|
--exclude-module "FixTk" \
|
|
|
|
--exclude-module "tcl" \
|
|
|
|
--exclude-module "tk" \
|
|
|
|
--exclude-module "_tkinter" \
|
|
|
|
--exclude-module "tkinter" \
|
|
|
|
--exclude-module "Tkinter" \
|
|
|
|
--noconsole \
|
|
|
|
--noconfirm \
|
2024-09-29 23:27:30 +00:00
|
|
|
--icon=../../assets/native/mac/logarithmplotter.icns \
|
2021-07-19 17:06:29 +00:00
|
|
|
--osx-bundle-identifier eu.ad5001.LogarithmPlotter \
|
2021-06-21 23:33:42 +00:00
|
|
|
-n LogarithmPlotter \
|
2021-08-16 17:50:54 +00:00
|
|
|
LogarithmPlotter/logarithmplotter.py
|
2021-07-11 20:46:21 +00:00
|
|
|
|
2024-09-29 23:27:30 +00:00
|
|
|
cp ../../assets/native/mac/Info.plist dist/LogarithmPlotter.app/Contents/Info.plist
|
2023-05-27 08:36:37 +00:00
|
|
|
|
|
|
|
# Remove QtWebEngine, 3D and all other unused libs libs
|
2023-05-27 09:09:13 +00:00
|
|
|
rm -rf dist/LogarithmPlotter.app/Contents/MacOS/{QtWeb*,*3D*,QtRemote*,QtPdf,QtCharts,QtLocation,QtTest,QtMultimedia,QtSpatialAudio,QtDataVisualization,QtQuickParticles,QtChartsQml,QtScxml,QtDataVisualizationQml,QtTest,QtPositioningQuick,QtQuickTest,QtSql,QtSensorsQuick}
|
2024-10-01 19:50:10 +00:00
|
|
|
rm -rf dist/LogarithmPlotter.app/Contents/MacOS/PySide6/QtNetwork.abi3.so
|
2023-05-27 08:36:37 +00:00
|
|
|
|
|
|
|
# Removing QtQuick3D
|
2024-09-29 22:23:39 +00:00
|
|
|
rm -rf dist/LogarithmPlotter.app/Contents/MacOS/PySide6/Qt/qml/{QtQuick3D,Qt3D,QtWebEngine}
|
2023-05-27 08:36:37 +00:00
|
|
|
|
|
|
|
# Remove the QtQuick styles that are unused
|
2023-05-27 09:09:13 +00:00
|
|
|
rm -rf dist/LogarithmPlotter.app/Contents/MacOS/PySide6/Qt/qml/QtQuick/Controls/{Imagine,Material,iOS,Universal,designer}
|