mirror of
https://git.srhtnin.garden/sarah/SaraView.git
synced 2026-10-14 18:38:11 +02:00
Add Flet desktop client
This commit is contained in:
1 parent
16787aba14
commit
0eecfba224
18 files changed
+2588
No files matched your search
Executable
+38
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
# Builds dist/SaraView-x86_64.AppImage: a PyInstaller one-file build (with
|
||||
# the font and icon bundled) wrapped by appimagetool, the same way SaraSort's,
|
||||
# SaraSuite's and SaraFem's AppImages are made. Needs appimagetool on PATH.
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$(readlink -f "$0")")/.."
|
||||
|
||||
[ -d .venv ] || python3 -m venv .venv
|
||||
.venv/bin/pip install --quiet --disable-pip-version-check -r requirements.txt pyinstaller
|
||||
|
||||
# --collect-data flet: without it ft.Icons crashes when frozen.
|
||||
.venv/bin/pyinstaller --noconfirm --clean --log-level WARN \
|
||||
--onefile --windowed --name SaraView --collect-data flet \
|
||||
--add-data "$PWD/assets:assets" \
|
||||
--distpath build/PyInstaller/dist --workpath build/PyInstaller/work --specpath build/PyInstaller \
|
||||
"$PWD/Main.py"
|
||||
|
||||
AppDir=build/AppDir
|
||||
rm -rf "$AppDir"
|
||||
mkdir -p "$AppDir/usr/bin"
|
||||
cp build/PyInstaller/dist/SaraView "$AppDir/usr/bin/SaraView"
|
||||
ln -s usr/bin/SaraView "$AppDir/AppRun"
|
||||
cp assets/Icon.png "$AppDir/SaraView.png"
|
||||
ln -s SaraView.png "$AppDir/.DirIcon"
|
||||
cat > "$AppDir/SaraView.desktop" << DESKTOP
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=SaraView
|
||||
Comment=View and edit files, locally or on a SaraView server
|
||||
Exec=SaraView
|
||||
Icon=SaraView
|
||||
Terminal=false
|
||||
Categories=Utility;
|
||||
DESKTOP
|
||||
|
||||
mkdir -p dist
|
||||
ARCH=x86_64 appimagetool --no-appstream "$AppDir" dist/SaraView-x86_64.AppImage
|
||||
echo "Built dist/SaraView-x86_64.AppImage"
|
||||
Reference in new issue
Block a user