rluv_client-flatpak/build-flatpak.sh

46 lines
1.1 KiB
Bash
Raw Normal View History

2024-06-02 17:55:23 -06:00
#!/usr/bin/env bash
2024-06-01 16:05:40 -06:00
# Convert the archive of the Flutter app to a Flatpak.
# Exit if any command fails
set -e
# Echo all commands for debug purposes
set -x
# No spaces in project name.
2024-06-02 17:55:23 -06:00
projectName=rluvApp
projectId=com.fosscat.rluv
2024-06-01 16:05:40 -06:00
executableName=rluv
# ------------------------------- Build Flatpak ----------------------------- #
# Extract portable Flutter build.
mkdir -p $projectName
tar -xf $projectName-Linux-Portable.tar.gz -C $projectName
# Copy the portable app to the Flatpak-based location.
cp -r $projectName /app/
chmod +x /app/$projectName/$executableName
mkdir -p /app/bin
ln -s /app/$projectName/$executableName /app/bin/$executableName
# Install the icon.
iconDir=/app/share/icons/hicolor/scalable/apps
mkdir -p $iconDir
2024-06-02 17:55:23 -06:00
cp -r assets/app_icon.png $iconDir/
2024-06-01 16:05:40 -06:00
# Install the desktop file.
desktopFileDir=/app/share/applications
mkdir -p $desktopFileDir
cp -r packaging/linux/$projectId.desktop $desktopFileDir/
# Install the AppStream metadata file.
metadataDir=/app/share/metainfo
mkdir -p $metadataDir
cp -r packaging/linux/$projectId.metainfo.xml $metadataDir/