From f639fb6fd8064cee1067dfa19e7549c2b2f727eb Mon Sep 17 00:00:00 2001 From: Ad5001 Date: Tue, 22 Jun 2021 18:39:03 +0200 Subject: [PATCH] Updating setups for all operating systems. --- README.md | 17 ++++++++-- build-macosx.sh | 4 +-- linux/install_after_setup.sh | 18 +++++++++++ linux/install_local.sh | 18 +++++++++++ package-macosx.sh | 61 ++++++++++++++++++++++++++++++++++++ setup.py | 2 +- win/installer.nsi | 2 +- 7 files changed, 115 insertions(+), 7 deletions(-) create mode 100644 package-macosx.sh diff --git a/README.md b/README.md index 20315ef..46259d5 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,26 @@ Create graphs with logarithm scales, namely BODE diagrams. +## Run + +You can simply run LogarithmPlotter using `python3 run.py`. + ## Install -### Windows +### Generate installers: You can generate installers from AccountFree after installing all the dependencies: - Windows installer: - You need `pyinstaller`. You can install it using `pip install pyinstaller`. - - Run the `win/build-windows.bat` script (or `win/build-wine.sh` if you're cross-compiling with wine on Linux) to build an exe for AccountFree. + - 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 [NSIS](https://nsis.sourceforge.io/Main_Page) (Linux users can install the `nsis` package). - - Run the `win/package-windows.bat` script (or `win/package.wine.sh`if you're cross-compiling on Linux). You will find a accountfre-esetup.exe installer in the dist/logarithmplotter/ folder. + - 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/accountfree/ folder. +- MacOS Archive creator installer: + - You need `pyinstaller`. You can install it using `pip install pyinstaller`. + - Run the `build-macosx.sh` script to build an .app for AccountFree which can be found in the dist directory. + - Run the `package-macosx.sh` script. You will find a LogarithmPlotter-v0.0.1-dev-setup.dmg installer in the dist/ folder. +- Linux packages: + - To build a DEB, you need DPKG and stdeb. You can install the later by using `pip install stdeb`. + - Run `package-linux.sh`. ### Linux diff --git a/build-macosx.sh b/build-macosx.sh index fe6d498..6195401 100755 --- a/build-macosx.sh +++ b/build-macosx.sh @@ -3,8 +3,8 @@ rm $(find . -name "*.qmlc") rm $(find . -name "*.pyc") python3 -m pip install -U pyinstaller -iconutil -c icns "mac/logarithmplotter.iconset" - --add-data "AccountLogarithmPlotter/qml:qml" \ +iconutil -c icns "mac/logarithmplotter.iconset" \ +pyinstaller --add-data "LogarithmPlotter/qml:qml" \ --add-data "LICENSE.md:." \ --add-data "README.md:." \ --exclude-module "FixTk" \ diff --git a/linux/install_after_setup.sh b/linux/install_after_setup.sh index 4dd63ab..798bed0 100644 --- a/linux/install_after_setup.sh +++ b/linux/install_after_setup.sh @@ -1,4 +1,22 @@ #!/bin/bash +# +# AccountFree - Browse and use online services, free of account. +# Copyright (C) 2021 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 . +# + APPROOT="$(cd -P "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" echo "Adding desktop file..." mkdir -p ~/.local/share/applications diff --git a/linux/install_local.sh b/linux/install_local.sh index b3aeff3..3d8c54f 100644 --- a/linux/install_local.sh +++ b/linux/install_local.sh @@ -1,4 +1,22 @@ #!/bin/bash +# +# AccountFree - Browse and use online services, free of account. +# Copyright (C) 2021 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 . +# + APPROOT="$(cd -P "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" echo "Adding desktop file..." mkdir -p ~/.local/share/applications diff --git a/package-macosx.sh b/package-macosx.sh new file mode 100644 index 0000000..c41d738 --- /dev/null +++ b/package-macosx.sh @@ -0,0 +1,61 @@ +#!/bin/bash +VERSION=0.0.1-dev0 +title="LogarithmPlotter v${VERSION} Setup" +finalDMGName="LogarithmPlotter-v${VERSION}-setup.dmg" +applicationName=LogarithmPlotter +backgroundPictureName=logarithmplotter-installer-background.png +source=Installer + +cd dist +rm -rf Installer +mkdir -p Installer +mkdir -p Installer/.background +cp ../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 + +# Calculating folder size +duoutput=$(du -h Installer | tail -n1) +size=$(expr ${duoutput%M*} + 2) # +2 for allowing small space to edit. +echo "Creating DMG file with size ${size}M." + +# Adapted from https://stackoverflow.com/a/1513578 +hdiutil create -srcfolder "${source}" -volname "${title}" -fs HFS+ \ + -fsargs "-c c=64,a=16,e=16" -format UDRW -size ${size}M pack.temp.dmg + +device=$(hdiutil attach -readwrite -noverify -noautoopen "pack.temp.dmg" | \ + egrep '^/dev/' | sed 1q | awk '{print $1}') + +sleep 3 + +echo ' + tell application "Finder" + tell disk "'${title}'" + open + set current view of container window to icon view + set toolbar visible of container window to false + set statusbar visible of container window to false + set the bounds of container window to {400, 100, 885, 475} + set theViewOptions to the icon view options of container window + set arrangement of theViewOptions to not arranged + set icon size of theViewOptions to 72 + set background picture of theViewOptions to file ".background:'${backgroundPictureName}'" + make new alias file at container window to POSIX file "/Applications" with properties {name:"Applications"} + set position of item "'${applicationName}'" of container window to {100, 100} + set position of item "Applications" of container window to {375, 100} + set position of item "README.md" of container window to {185, 265} + set position of item "LICENSE.md" of container window to {290, 265} + update without registering applications + delay 5 + close + end tell + end tell +' | osascript +chmod -Rf go-w /Volumes/"${title}" +sync +sync +hdiutil detach ${device} +hdiutil convert "pack.temp.dmg" -format UDZO -imagekey zlib-level=9 -o "${finalDMGName}" +rm -f pack.temp.dmg +rm -rf Installer diff --git a/setup.py b/setup.py index f39eafe..a639e07 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,7 @@ Environment :: Graphic Environment :: X11 Applications :: Qt License :: OSI Approved :: GNU General Public License v3 (GPLv3) Natural Language :: English -Development Status :: 4 - Beta +Development Status :: 3 - Alpha Operating System :: MacOS :: MacOS X Operating System :: Microsoft :: Windows Operating System :: POSIX diff --git a/win/installer.nsi b/win/installer.nsi index 2fdc33d..a584c81 100644 --- a/win/installer.nsi +++ b/win/installer.nsi @@ -136,7 +136,7 @@ Icon "logarithmplotter.ico" !insertmacro MUI_UNPAGE_WELCOME !insertmacro MUI_UNPAGE_CONFIRM -;!insertmacro MUI_UNPAGE_INSTFILES +!insertmacro MUI_UNPAGE_INSTFILES !insertmacro MUI_UNPAGE_FINISH ;--------------------------------