Continuing packaging with macos and windows, also fixing a few bugs in the process.

This commit is contained in:
Adsooi 2021-06-22 01:33:42 +02:00
parent 1498028036
commit 1a0b07c79f
Signed by: Ad5001
GPG key ID: EF45F9C6AFE20160
19 changed files with 58 additions and 28 deletions

View file

@ -122,7 +122,10 @@ def run():
if not engine.rootObjects():
print("No root object")
exit(-1)
app.exec_()
exit_code = app.exec_()
os.remove(tempfile)
exit(exit_code)
if __name__ == "__main__":
run()

View file

@ -29,7 +29,7 @@ D.Dialog {
Image {
id: logo
source: "../logplotter.svg"
source: "../../logplotter.svg"
sourceSize.width: 64
sourceSize.height: 64
width: 64

View file

@ -438,7 +438,7 @@ ListView {
icon.name: modelData
icon.width: 24
icon.height: 24
icon.color: 'white'//sysPalette.windowText
icon.color: sysPalette.windowText
onClicked: {
var newObj = Objects.createNewRegisteredObject(modelData)

21
build-macosx.sh Executable file
View file

@ -0,0 +1,21 @@
#!/usr/bin/env bash
# Untested yet
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" \
--add-data "LICENSE.md:." \
--add-data "README.md:." \
--exclude-module "FixTk" \
--exclude-module "tcl" \
--exclude-module "tk" \
--exclude-module "_tkinter" \
--exclude-module "tkinter" \
--exclude-module "Tkinter" \
--noconsole \
--noconfirm \
--icon=mac/logarithmplotter.icns \
--osx-bundle-identifier eu.ad5001.logarithmplotter \
-n LogarithmPlotter \
LogarithmPlotter/__init__.py

2
build-windows.bat Normal file
View file

@ -0,0 +1,2 @@
python -m pip install -U pyinstaller
pyinstaller --add-data "logplotter.svg;." --add-data "LogarithmPlotter/qml;qml" --noconsole LogarithmPlotter/__init__.py --icon=win/logarithmplotter.ico -n logarithmplotter

6
build-wine.sh Normal file
View file

@ -0,0 +1,6 @@
#!/bin/bash
# Giving pyinstaller another run
rm $(find . -name "*.qmlc")
rm $(find . -name "*.pyc")
wine python -m pip install -U pyinstaller
wine pyinstaller --add-data "logplotter.svg;." --add-data "LogarithmPlotter/qml;qml" --noconsole LogarithmPlotter/__init__.py --icon=win/logarithmplotter.ico -n logarithmplotter

View file

@ -5,7 +5,7 @@ mkdir -p ~/.local/share/applications
sed "s+ROOTFOLDER+$APPROOT/+g" "$APPROOT/linux/logplotter.desktop" > ~/.local/share/applications/logarithmplotter.desktop
echo "Installing mime-type..."
mkdir -p ~/.local/share/applications
sed "s+ROOTFOLDER+$APPROOT/+g" "$APPROOT/linux/x-logarithm-plotter-old.xml" > ~/.local/share/mime/packages/x-logarithm-plotter.xml
sed "s+ROOTFOLDER+$APPROOT/+g" "$APPROOT/linux/x-logarithm-plotter.xml" > ~/.local/share/mime/packages/x-logarithm-plotter.xml
mkdir -p ~/.local/share/icons/hicolor/scalable/mimetypes
cp "$APPROOT/logplotterfile.svg" ~/.local/share/icons/hicolor/scalable/mimetypes/application-x-logarithm-plotter.svg
update-mime-database ~/.local/share/mime/

View file

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type xmlns="http://www.freedesktop.org/standards/shared-mime-info" type="application/x-logarithm-plotter">
<comment>Logarithm Plot File</comment>
<comment xml:lang="fr">Fichier Graphe Logarithmique</comment>
<icon name="ROOTFOLDER/logplotterfile.svg"/>
<glob-deleteall/>
<glob pattern="*.json"/>
<glob pattern="*.lgg"/>
<glob pattern="*.lpf"/>
</mime-type>
</mime-info>

BIN
mac/logarithmplotter.icns Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 631 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 995 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

4
package-windows.bat Normal file
View file

@ -0,0 +1,4 @@
cp win/* README.md LICENSE.md dist/logarithmplotter/
rem Creating installer
cd dist/logarithmplotter/
"C:\Program Files (x86)\NSIS\makensis" installer.nsi

6
package-wine.sh Normal file
View file

@ -0,0 +1,6 @@
#!/bin/bash
# Moving files
cp win/* README.md LICENSE.md dist/logarithmplotter/
# Creating installer
cd dist/logarithmplotter/
makensis installer.nsi

View file

@ -53,7 +53,6 @@ def package_data():
for d,folders,files in os.walk("LogarithmPlotter/qml"):
d = d[17:]
pkg_data += [os.path.join(d, f) for f in files]
print("Pkgdata", pkg_data)
return pkg_data
data_files = []

View file

@ -1,3 +1,4 @@
Unicode True
; Modern UI definitions
;--------------------------------
;Include Modern UI
@ -8,10 +9,10 @@
;Definitions
!define APP_NAME "LogarithmPlotter"
!define DEV_NAME "Ad5001"
!define WEBSITE "https://logarithmplotter.org"
!define WEBSITE "https://apps.ad5001.eu/LogarithmPlotter"
!define APP_VERSION "0.0.1.0"
!define COPYRIGHT "Ad5001 © 2021"
!define DESCRIPTION "Browse and use online services, free of account."
!define DESCRIPTION "Create graphs with logarithm scales."
!define REG_UNINSTALL "Software\Microsoft\Windows\CurrentVersion\Uninstall\LogarithmPlotter"
@ -34,7 +35,7 @@ VIAddVersionKey "ProductName" "${APP_NAME}"
VIAddVersionKey "CompanyName" "${DEV_NAME}"
VIAddVersionKey "LegalCopyright" "${COPYRIGHT}"
VIAddVersionKey "FileDescription" "${DESCRIPTION}"
VIAddVersionKey "FileVersion" "${VERSION}"
VIAddVersionKey "FileVersion" "${APP_VERSION}"
;--------------------------------
@ -50,7 +51,7 @@ VIAddVersionKey "FileVersion" "${VERSION}"
;!insertmacro MUI_WELCOMEPAGE_TITLE_3LINES
;Icons
Icon "logplotter.ico"
Icon "logarithmplotter.ico"
;!define MUI_HEADERIMAGE
;!define MUI_HEADERIMAGE_BITMAP "logarithmplotter.bmp"
!define MUI_WELCOMEFINISHPAGE_BITMAP "inst_banner.bmp"
@ -167,16 +168,16 @@ Section ""
WriteRegStr HKLM ${REG_UNINSTALL} "UninstallString" "$INSTDIR\uninstall.exe"
WriteRegStr HKLM ${REG_UNINSTALL} "QuietUninstallString" "$INSTDIR\uninstall.exe /S"
WriteRegStr HKLM ${REG_UNINSTALL} "DisplayIcon" "$INSTDIR\logarithmplotter.bmp"
WriteRegStr HKLM ${REG_UNINSTALL} "DisplayVersion" "${VERSION}"
WriteRegStr HKLM ${REG_UNINSTALL} "DisplayVersion" "${APP_VERSION}"
WriteRegStr HKLM ${REG_UNINSTALL} "Readme" "$INSTDIR\README.md"
WriteRegStr HKLM ${REG_UNINSTALL} "URLInfoAbout" "${WEBSITE}"
SectionEnd
SectionEnd
;--------------------------------
;Uninstaller Section
;
Section "Uninstall"
;--------------------------------
;Uninstaller Section
;
Section "Uninstall"
RMDir /r "$INSTDIR"

View file

Before

Width:  |  Height:  |  Size: 181 KiB

After

Width:  |  Height:  |  Size: 181 KiB