mirror of
https://git.srhtnin.garden/sarah/SaraTune.git
synced 2026-10-14 02:18:11 +02:00
39 lines
1.3 KiB
Bash
Executable File
39 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
# Builds dist/SaraTune-x86_64.AppImage: a PyInstaller one-file build (with
|
|
# the font and icon bundled) wrapped by appimagetool, the same way 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 SaraTune --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/SaraTune "$AppDir/usr/bin/SaraTune"
|
|
ln -s usr/bin/SaraTune "$AppDir/AppRun"
|
|
cp assets/Icon.png "$AppDir/SaraTune.png"
|
|
ln -s SaraTune.png "$AppDir/.DirIcon"
|
|
cat > "$AppDir/SaraTune.desktop" << DESKTOP
|
|
[Desktop Entry]
|
|
Type=Application
|
|
Name=SaraTune
|
|
Comment=Play audio files and your music library
|
|
Exec=SaraTune %F
|
|
Icon=SaraTune
|
|
Terminal=false
|
|
Categories=AudioVideo;Audio;Player;
|
|
DESKTOP
|
|
|
|
mkdir -p dist
|
|
ARCH=x86_64 appimagetool --no-appstream "$AppDir" dist/SaraTune-x86_64.AppImage
|
|
echo "Built dist/SaraTune-x86_64.AppImage"
|