Reorganizing paths

This commit is contained in:
Adsooi 2024-09-30 00:23:39 +02:00
parent e9d204daab
commit 34cb856dd4
Signed by: Ad5001
GPG key ID: EF45F9C6AFE20160
249 changed files with 118 additions and 294 deletions

View file

@ -1,20 +1,17 @@
#!/usr/bin/env bash
DIR="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$DIR/.."
cd "$DIR/.." || exit 1
rm -rf build
bash scripts/build.sh
cd build || exit 1
rm $(find . -name "*.qmlc")
rm $(find . -name "*.pyc")
# Building translations
cd "LogarithmPlotter/i18n/"
bash release.sh
cd ../../
pyinstaller --add-data "LogarithmPlotter/qml:qml" \
--add-data "LogarithmPlotter/i18n:i18n" \
--add-data "LICENSE.md:." \
--add-data "mac/logarithmplotterfile.icns:." \
--add-data "../assets/native/mac/logarithmplotterfile.icns:." \
--add-data "README.md:." \
--exclude-module "FixTk" \
--exclude-module "tcl" \
@ -24,21 +21,19 @@ pyinstaller --add-data "LogarithmPlotter/qml:qml" \
--exclude-module "Tkinter" \
--noconsole \
--noconfirm \
--icon=mac/logarithmplotter.icns \
--icon=../assets/native/mac/logarithmplotter.icns \
--osx-bundle-identifier eu.ad5001.LogarithmPlotter \
-n LogarithmPlotter \
LogarithmPlotter/logarithmplotter.py
cp 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}
rm -rf dist/LogarithmPlotter.app/Contents/MacOS/PySide6/{QtNetwork.abi3.so}
# Removing QtQuick3D
rm -rf dist/LogarithmPlotter.app/Contents/MacOS/PySide6/Qt/qml/QtQuick3D
rm -rf dist/LogarithmPlotter.app/Contents/MacOS/PySide6/Qt/qml/Qt3D
rm -rf dist/LogarithmPlotter.app/Contents/MacOS/PySide6/Qt/qml/QtWebEngine
rm -rf dist/LogarithmPlotter.app/Contents/MacOS/PySide6/Qt/qml/{QtQuick3D,Qt3D,QtWebEngine}
# Remove the QtQuick styles that are unused
rm -rf dist/LogarithmPlotter.app/Contents/MacOS/PySide6/Qt/qml/QtQuick/Controls/{Imagine,Material,iOS,Universal,designer}

View file

@ -1,17 +0,0 @@
rem Make sure pyinstaller is installed
python -m pip install -U pyinstaller
rem Building translations
cd "LogarithmPlotter\i18n"
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

View file

@ -1,22 +1,18 @@
#!/bin/bash
cd "$(dirname "$(readlink -f "$0" || realpath "$0")")/.."
cd "$(dirname "$(readlink -f "$0" || realpath "$0")")/.." || exit
rm -rf dist
rm -rf build
bash scripts/build.sh
cd build || exit 1
rm $(find . -name "*.qmlc")
rm -rf $(find . -name "*.pyc")
# Building translations
cd "LogarithmPlotter/i18n/"
bash release.sh
cd ../../
wine pyinstaller --add-data "logplotter.svg;." \
wine pyinstaller --add-data "LogarithmPlotter/logarithmplotter.svg;." \
--add-data "LogarithmPlotter/qml;qml" \
--add-data "LogarithmPlotter/i18n;i18n" \
--noconsole \
LogarithmPlotter/logarithmplotter.py \
--icon=win/logarithmplotter.ico \
--icon=../assets/native/win/logarithmplotter.ico \
-n logarithmplotter
# Copy Qt6ShaderTools, a required library for for Qt5Compat

49
scripts/build.sh Executable file
View file

@ -0,0 +1,49 @@
#!/usr/bin/env bash
#
# LogarithmPlotter - 2D plotter software to make BODE plots, sequences and distribution functions.
# Copyright (C) 2021-2024 Ad5001
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# This script builds a dist version of LogarithmPlotter
DIR="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$DIR/.." || exit 1
box() {
len=${#1}
echo "┌─$(printf '─%.0s' $(seq 1 "$len"))─┐"
echo "$1"
echo "└─$(printf '─%.0s' $(seq 1 "$len"))─┘"
}
rm -rf build
mkdir -p build/runtime-pyside6
# Copy python
box "Copying pyside6 python runtime..."
cp -r runtime-pyside6/{setup.py,LogarithmPlotter} build/runtime-pyside6
box "Building ecmascript modules..."
mkdir -p build/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js
cd common && (npm run build || exit) && cd ..
box "Building translations..."
cd assets/i18n/ && (bash release.sh || exit) && cd ../../
mkdir -p build/runtime-pyside6/LogarithmPlotter/i18n && cp assets/i18n/*.qm build/runtime-pyside6/LogarithmPlotter/i18n/
box "Building icons..."
cp -r assets/icons build/runtime-pyside6/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/
cp assets/logarithmplotter.svg build/runtime-pyside6/LogarithmPlotter/

11
scripts/package-deb.sh Executable file
View file

@ -0,0 +1,11 @@
#!/bin/bash
cd "$(dirname "$(readlink -f "$0" || realpath "$0")")/.."
rm -rf build
bash scripts/build.sh
cd build || exit 1
# Deb
sudo python3 setup.py --remove-git-version --command-packages=stdeb.command sdist_dsc \
--package logarithmplotter --copyright-file linux/debian/copyright --suite noble --depends3 "$(cat linux/debian/depends)" --section science \
bdist_deb

View file

@ -1,32 +0,0 @@
#!/bin/bash
cd "$(dirname "$(readlink -f "$0" || realpath "$0")")/.."
# Building translations
cd "LogarithmPlotter/i18n/"
bash release.sh
cd ../../
# Deb
sudo python3 setup.py --remove-git-version --command-packages=stdeb.command sdist_dsc \
--package logarithmplotter --copyright-file linux/debian/copyright --suite noble --depends3 "$(cat linux/debian/depends)" --section science \
bdist_deb
# Flatpak building
FLATPAK_BUILDER=$(which flatpak-builder)
if [ -z $FLATPAK_BUILDER ]; then
echo "flatpak-builder not installed. Will not proceed to build flatpak."
else
cd linux
git clone https://github.com/Ad5001/eu.ad5001.LogarithmPlotter
cd eu.ad5001.LogarithmPlotter
flatpak-builder AppDir eu.ad5001.LogarithmPlotter.json --user --force-clean --install
cd ../../
fi
# Snapcraft building
SNAPCRAFT=$(which snapcraft)
if [ -z $SNAPCRAFT ]; then
echo "snapcraft not installed. Will not proceed to build snap"
else
snapcraft
fi

View file

@ -8,14 +8,14 @@ applicationName=LogarithmPlotter
backgroundPictureName=logarithmplotter-installer-background.png
source=Installer
cd dist
cd build/dist
rm -rf Installer
mkdir -p Installer
mkdir -p Installer/.background
cp ../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)

View file

@ -1,7 +0,0 @@
XCOPY win\*.* dist\logarithmplotter /C /S /D /Y /I
XCOPY README.md dist\logarithmplotter /C /D /Y
XCOPY LICENSE.md dist\logarithmplotter /C /D /Y
rem Creating installer
cd dist\logarithmplotter
"C:\Program Files (x86)\NSIS\makensis" installer.nsi
cd ..\..

View file

@ -1,8 +1,8 @@
#!/bin/bash
cd "$(dirname "$(readlink -f "$0" || realpath "$0")")/.."
cd "$(dirname "$(readlink -f "$0" || realpath "$0")")/.." || exit 1
# Moving files
cp win/* README.md LICENSE.md dist/logarithmplotter/
cp assets/native/win/* README.md LICENSE.md build/dist/logarithmplotter/
# Creating installer
cd dist/logarithmplotter/
cd build/dist/logarithmplotter/
makensis installer.nsi