From e2841c012984dec48c1552f44ef612883c17dfc8 Mon Sep 17 00:00:00 2001 From: Ad5001 Date: Mon, 30 Sep 2024 01:27:30 +0200 Subject: [PATCH] Updating remaining paths in scripts --- README.md | 30 +++++++++++++----------------- runtime-pyside6/poetry.lock | 2 +- runtime-pyside6/pyproject.toml | 4 ++-- scripts/build-macosx.sh | 6 +++--- scripts/build-wine.sh | 6 +++--- scripts/package-macosx.sh | 9 ++++----- scripts/package-wine.sh | 4 ++-- scripts/run-tests.sh | 4 ++++ snapcraft.yaml | 2 +- 9 files changed, 33 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 8402402..4a44ced 100644 --- a/README.md +++ b/README.md @@ -19,15 +19,15 @@ You can find more screenshots on the [app's website](https://apps.ad5001.eu/loga First, you'll need to install all the required dependencies: -- [Python 3](https://python.org) with [poetry](https://python-poetry.org/), and setup a virtual environment and call +- [Python 3](https://python.org) with [poetry](https://python-poetry.org/), setup a virtual environment, go to the `runtime-pyside6` directory, and call `poetry install`. -- [npm](https://npmjs.com) (or [yarn](https://yarnpkg.com/)), and run `npm install` (or `yarn install`). +- [npm](https://npmjs.com) (or [yarn](https://yarnpkg.com/)), go to the `common` directory, and run `npm install` (or `yarn install`). You can simply run LogarithmPlotter using `python3 run.py`. It automatically compiles the language files (requires `lrelease` to be installed and in path), and the JavaScript modules. -If you do not wish do recompile the files again on every run, you can use -`python3 LogarithmPlotter/logarithmplotter.py`. +If you do not wish do recompile the files again on every run, you can use the build script (`scripts/build.sh`) and run +`python3 build/runtime-pyside6/LogarithmPlotter/logarithmplotter.py`. In order to test translations, you can use the `--lang=` commandline option to force the locale. @@ -39,22 +39,18 @@ All scripts noted here can be found in the `scripts` directory. You can generate installers for LogarithmPlotter after installing all the dependencies. -- Windows installer: - - Run the `build-windows.bat` script (or `build-wine.sh` if you're cross-compiling with wine on Linux) to build an - exe for LogarithmPlotter. - - You also need [NSIS](https://nsis.sourceforge.io/Main_Page) (Linux users can install - the [nsis](https://pkgs.org/download/nsis) package). - - Run the `package-windows.bat` script (or `package-wine.sh`if you're cross-compiling on Linux). You will find a - logarithmplotter-setup.exe installer in the dist/logarithmplotter/ folder. +- Windows installer (crosscompiling from Linux): + - Run `build-wine.sh` (requires wine) to build an exe for LogarithmPlotter in build/runtime-pyside6/dist. + - You also need [NSIS](https://nsis.sourceforge.io/Main_Page) (the [nsis](https://pkgs.org/download/nsis) package is available on linux). + - Run the `package-wine.sh` script. You will find a logarithmplotter-setup.exe installer in the build/runtime-pyside6/dist/logarithmplotter/ folder. - MacOS Archive creator installer: - - Run the `build-macosx.sh` script to build an .app for LogarithmPlotter which can be found in the dist directory. + - Run the `build-macosx.sh` script to build an .app for LogarithmPlotter which can be found in the build/runtime-pyside6/dist directory. - Run the `package-macosx.sh` script. You will find a LogarithmPlotter-v<version>-setup.dmg installer in the - dist/ folder. + build/runtime-pyside6/build/pysdist/ folder. - Linux packages: - - To build and install the flatpak, you - need [flatpak-builder](https://docs.flatpak.org/en/latest/flatpak-builder.html) installed. - - To build the snap, you need [snapcraft](https://snapcraft.io) installed. - - Run `package-linux.sh`. + - Run `package-deb.sh`. It will create an DSC and a DEB in build/runtime-pyside6/deb_dist/ + - Run `scripts/build.sh` followed by `snapcraft`. It .snap file in the root directory. + - See [the flatpak repo](https://github.com/Ad5001/eu.ad5001.LogarithmPlotter) for instrutions on how to build the flatpak. ## Contribute diff --git a/runtime-pyside6/poetry.lock b/runtime-pyside6/poetry.lock index 2979b69..a4727e1 100644 --- a/runtime-pyside6/poetry.lock +++ b/runtime-pyside6/poetry.lock @@ -449,4 +449,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = ">=3.9,<3.13" -content-hash = "867f6da20f7e5b66e5d6cf927b56b335e81ff15f53d4ee0fc3c68ab1603de7af" +content-hash = "5636605737f21954e102a0110972e6bd3df07f2d5929f41fe541c7347c3ecf08" diff --git a/runtime-pyside6/pyproject.toml b/runtime-pyside6/pyproject.toml index 94af012..5293365 100644 --- a/runtime-pyside6/pyproject.toml +++ b/runtime-pyside6/pyproject.toml @@ -9,8 +9,8 @@ package-mode = false [tool.poetry.dependencies] python = ">=3.9,<3.13" -PySide6-Essentials = "^6.7.2" -pyside6-addons = "^6.7.2" +PySide6-Essentials = "^6.7" +PySide6-Addons = "^6.7" [tool.poetry.group.packaging.dependencies] pyinstaller = "^6.10.0" diff --git a/scripts/build-macosx.sh b/scripts/build-macosx.sh index c398735..c76b5ec 100755 --- a/scripts/build-macosx.sh +++ b/scripts/build-macosx.sh @@ -4,7 +4,7 @@ cd "$DIR/.." || exit 1 rm -rf build bash scripts/build.sh -cd build || exit 1 +cd build/runtime-pyside6 || exit 1 rm $(find . -name "*.pyc") @@ -21,12 +21,12 @@ pyinstaller --add-data "LogarithmPlotter/qml:qml" \ --exclude-module "Tkinter" \ --noconsole \ --noconfirm \ - --icon=../assets/native/mac/logarithmplotter.icns \ + --icon=../../assets/native/mac/logarithmplotter.icns \ --osx-bundle-identifier eu.ad5001.LogarithmPlotter \ -n LogarithmPlotter \ LogarithmPlotter/logarithmplotter.py -cp ../assets/native/mac/Info.plist dist/LogarithmPlotter.app/Contents/Info.plist +cp ../../assets/native/mac/Info.plist dist/LogarithmPlotter.app/Contents/Info.plist # Remove QtWebEngine, 3D and all other unused libs libs 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} diff --git a/scripts/build-wine.sh b/scripts/build-wine.sh index c99d1e1..bf8a7ff 100644 --- a/scripts/build-wine.sh +++ b/scripts/build-wine.sh @@ -3,16 +3,16 @@ cd "$(dirname "$(readlink -f "$0" || realpath "$0")")/.." || exit rm -rf build bash scripts/build.sh -cd build || exit 1 +cd build/runtime-pyside6 || exit 1 rm -rf $(find . -name "*.pyc") -wine pyinstaller --add-data "LogarithmPlotter/logarithmplotter.svg;." \ +wine_py pyinstaller --add-data "LogarithmPlotter/logarithmplotter.svg;." \ --add-data "LogarithmPlotter/qml;qml" \ --add-data "LogarithmPlotter/i18n;i18n" \ --noconsole \ LogarithmPlotter/logarithmplotter.py \ - --icon=../assets/native/win/logarithmplotter.ico \ + --icon=../../assets/native/win/logarithmplotter.ico \ -n logarithmplotter # Copy Qt6ShaderTools, a required library for for Qt5Compat diff --git a/scripts/package-macosx.sh b/scripts/package-macosx.sh index cf312a4..d38ecdc 100644 --- a/scripts/package-macosx.sh +++ b/scripts/package-macosx.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -cd "$(dirname "$(readlink -f "$0" || realpath "$0")")/.." +cd "$(dirname "$(readlink -f "$0" || realpath "$0")")/../build/runtime-pyside6/dist" || exit 1 VERSION=0.6.0 title="LogarithmPlotter v${VERSION} Setup" @@ -8,14 +8,13 @@ applicationName=LogarithmPlotter backgroundPictureName=logarithmplotter-installer-background.png source=Installer -cd build/dist rm -rf Installer mkdir -p Installer mkdir -p Installer/.background -cp ../../assets/native/mac/install-bg.png "./Installer/.background/${backgroundPictureName}" +cp ../../../assets/native/mac/install-bg.png "./Installer/.background/${backgroundPictureName}" cp -r LogarithmPlotter.app Installer/LogarithmPlotter.app -cp ../../LICENSE.md Installer/LICENSE.md -cp ../../README.md Installer/README.md +cp ../../../LICENSE.md Installer/LICENSE.md +cp ../../../README.md Installer/README.md # Calculating folder size duoutput=$(du -h Installer | tail -n1) diff --git a/scripts/package-wine.sh b/scripts/package-wine.sh index 2b6391c..89295e7 100644 --- a/scripts/package-wine.sh +++ b/scripts/package-wine.sh @@ -2,7 +2,7 @@ cd "$(dirname "$(readlink -f "$0" || realpath "$0")")/.." || exit 1 # Moving files -cp assets/native/win/* README.md LICENSE.md build/dist/logarithmplotter/ +cp assets/native/win/* README.md LICENSE.md build/runtime-pyside6/dist/logarithmplotter/ # Creating installer -cd build/dist/logarithmplotter/ +cd build/runtime-pyside6/dist/logarithmplotter/ || exit 1 makensis installer.nsi diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh index 257d748..ac612f4 100644 --- a/scripts/run-tests.sh +++ b/scripts/run-tests.sh @@ -1,7 +1,11 @@ #!/bin/bash cd "$(dirname "$(readlink -f "$0" || realpath "$0")")/.." +rm -rf build +bash scripts/build.sh + # Run python tests +cp -r runtime-pyside6/tests build/runtime-pyside6 PYTHONPATH="$PYTHONPATH:." pytest --cov=LogarithmPlotter --cov-report term-missing . npm test diff --git a/snapcraft.yaml b/snapcraft.yaml index 2811b21..12b41d2 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -69,7 +69,7 @@ parts: logarithmplotter.desktop: usr/share/applications/logarithmplotter.desktop x-logarithm-plot.xml: usr/share/mime/packages/x-logarithm-plot.xml application-x-logarithm-plot.svg: usr/share/mime/packages/application-x-logarithm-plot.svg - linuxfiles: + filetypeicon: source: assets/ plugin: dump organize: