Fixed flatpak build script style

Signed-off-by: Maxim Logaev <maxlogaev@proton.me>
This commit is contained in:
Maxim Logaev 2024-03-20 17:29:37 +03:00
parent 2376226650
commit aaa7c8ee75
2 changed files with 15 additions and 10 deletions

2
.gitignore vendored
View file

@ -10,5 +10,5 @@ windows-installer/win64-dist/
*.exe *.exe
*.dll *.dll
*.flatpak *.flatpak
linux-distributives flatpak-dist
.flatpak-builder .flatpak-builder

View file

@ -3,7 +3,7 @@ set -e
APP_NAME="im.dino.Dino" APP_NAME="im.dino.Dino"
DIST_NAME=${DIST_NAME:-"${APP_NAME}.flatpak"} DIST_NAME=${DIST_NAME:-"${APP_NAME}.flatpak"}
DIST_DIR="$PWD/linux-distributives" DIST_DIR="$PWD/flatpak-dist"
BUILD_TEMP_DIR="$DIST_DIR/buildtemp" BUILD_TEMP_DIR="$DIST_DIR/buildtemp"
BUILD_EXPORT_DIR="$DIST_DIR/export" BUILD_EXPORT_DIR="$DIST_DIR/export"
@ -18,7 +18,8 @@ fatal()
exit 1 exit 1
} }
getFlatpakDependencies(){ get_flatpak_dependencies()
{
msg "Installing Flatpak dependencies..." msg "Installing Flatpak dependencies..."
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
flatpak install flathub org.gnome.Sdk//44 flatpak install flathub org.gnome.Sdk//44
@ -26,19 +27,22 @@ getFlatpakDependencies(){
msg "Flatpak dependencies installed" msg "Flatpak dependencies installed"
} }
pullSharedModules() { pull_shared_modules()
{
msg "Pulling shared modules..." msg "Pulling shared modules..."
git submodule init git submodule init
git submodule update git submodule update
msg "Shared modules successfully pulled" msg "Shared modules successfully pulled"
} }
prepare(){ prepare()
getFlatpakDependencies {
pullSharedModules get_flatpak_dependencies
pull_shared_modules
} }
build(){ build()
{
msg "Build commencing!" msg "Build commencing!"
rm -rf $BUILD_TEMP_DIR rm -rf $BUILD_TEMP_DIR
flatpak-builder $BUILD_TEMP_DIR "${APP_NAME}.json" flatpak-builder $BUILD_TEMP_DIR "${APP_NAME}.json"
@ -47,7 +51,8 @@ build(){
msg "Flatpack bundle ready and saved to ${DIST_NAME}" msg "Flatpack bundle ready and saved to ${DIST_NAME}"
} }
clean(){ clean()
{
msg "Wiping intermediate files..." msg "Wiping intermediate files..."
rm -rf $BUILD_TEMP_DIR $BUILD_EXPORT_DIR rm -rf $BUILD_TEMP_DIR $BUILD_EXPORT_DIR
msg "Cleanup complete!" msg "Cleanup complete!"