Skip to content

Commit

Permalink
Added linux installer script
Browse files Browse the repository at this point in the history
Updated linux installer build to 1.0.0
Added AppImage for linux
  • Loading branch information
realkalash committed Sep 16, 2024
1 parent cba77c9 commit fa67041
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 13 deletions.
File renamed without changes
55 changes: 55 additions & 0 deletions build_appimage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/bin/bash

# Build the Flutter app for Linux
flutter build linux

# Create temporary AppDir structure
mkdir -p linux-temp-installer/AppDir/usr/bin
cp -r build/linux/x64/release/bundle/* linux-temp-installer/AppDir/usr/bin/

# Download AppImageTool if not already downloaded
if [ ! -f linux-installer/appimagetool-x86_64.AppImage ]; then
mkdir -p linux-installer
wget -O linux-installer/appimagetool-x86_64.AppImage https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
chmod +x linux-installer/appimagetool-x86_64.AppImage
fi

# Create AppRun script
cat > linux-temp-installer/AppDir/AppRun << 'EOF'
#!/bin/sh
HERE="$(dirname "$(readlink -f "${0}")")"
exec "${HERE}/usr/bin/FluentGPT"
EOF
chmod +x linux-temp-installer/AppDir/AppRun

# Create desktop entry
cat > linux-temp-installer/AppDir/FluentGPT.desktop << 'EOF'
[Desktop Entry]
Name=FluentGPT
Exec=FluentGPT
Icon=app_icon512
Type=Application
Categories=Utility;
EOF

# Copy the app icon
cp assets/app_icon512.png linux-temp-installer/AppDir/app_icon512.png

# Create installers directory if it doesn't exist
mkdir -p installers

# Bundle everything into an AppImage
ARCH=x86_64 linux-installer/appimagetool-x86_64.AppImage linux-temp-installer/AppDir

# Rename the AppImage file
mv FluentGPT-x86_64.AppImage FluentGPT.appimage

# Move the AppImage to the installers directory
mv FluentGPT.appimage installers/

# Zip the contents of the build/linux/x64/release/bundle folder
zip -r installers/fluent-gpt-linux.zip build/linux/x64/release/bundle

# Clean up temporary directory
rm -rf linux-temp-installer
echo "AppImage and zip file created successfully and moved to installers directory."
1 change: 1 addition & 0 deletions fluent_gpt.desktop
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env xdg-open
[Desktop Entry]
Name=Fluent GPT
Comment=An open-source, multi-platform desktop application that brings the power of GPT models to your fingertips.
Expand Down
Binary file added installers/FluentGPT.appimage
Binary file not shown.
Binary file modified installers/fluent-gpt-linux.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion lib/tray.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Future<void> initSystemTray() async {
} else if (Platform.isMacOS) {
path = 'assets/transparent_app_icon_32x32.png';
} else if (Platform.isLinux) {
path = 'assets/app_icon.png';
path = 'assets/app_icon512.png';
}
if (path == null) return;

Expand Down
Binary file added linux-installer/appimagetool-x86_64.AppImage
Binary file not shown.
24 changes: 12 additions & 12 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -873,18 +873,18 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
url: "https://pub.dev"
source: hosted
version: "10.0.5"
version: "10.0.4"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
url: "https://pub.dev"
source: hosted
version: "3.0.5"
version: "3.0.3"
leak_tracker_testing:
dependency: transitive
description:
Expand Down Expand Up @@ -945,10 +945,10 @@ packages:
dependency: transitive
description:
name: material_color_utilities
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
url: "https://pub.dev"
source: hosted
version: "0.11.1"
version: "0.8.0"
math_expressions:
dependency: transitive
description:
Expand All @@ -969,10 +969,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
url: "https://pub.dev"
source: hosted
version: "1.15.0"
version: "1.12.0"
mime:
dependency: transitive
description:
Expand Down Expand Up @@ -1638,10 +1638,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
url: "https://pub.dev"
source: hosted
version: "0.7.2"
version: "0.7.0"
timezone:
dependency: transitive
description:
Expand Down Expand Up @@ -1782,10 +1782,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
url: "https://pub.dev"
source: hosted
version: "14.2.5"
version: "14.2.1"
watcher:
dependency: transitive
description:
Expand Down

0 comments on commit fa67041

Please sign in to comment.