-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-flatpak.sh
executable file
·45 lines (32 loc) · 1.18 KB
/
build-flatpak.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
# 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.
projectName=telsis_translator_flutter
projectId=com.maplerain.telsis_translator_flutter
executableName=telsis_translator_flutter
archiveName=telsis-translator-flutter_0.2.1.tar.gz
# ------------------------------- Build Flatpak ----------------------------- #
# Extract portable Flutter build.
mkdir -p $projectName
tar -xf $archiveName -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/256x256/apps/
mkdir -p $iconDir
cp -r packaging/linux/com.maplerain.telsis_translator_flutter.png $iconDir/
# 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/