Skip to content

Commit

Permalink
AppImage building improved
Browse files Browse the repository at this point in the history
  • Loading branch information
GleammerRay committed Jul 16, 2022
1 parent f3981f3 commit c5ed0d0
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 25 deletions.
45 changes: 25 additions & 20 deletions appimage_builder → appimage/appimage_builder
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

# downloaded from https://gist.github.com/naveenadi/8dbe75c04cae7739f5cce0a260eb3e08

if [ ! -d ../build ]; then
echo 'ERROR: current directory is not contained within a flutter project';
exit 0;
fi

export ARCH=$(uname -m)

echo "INFO:Generator:Searching AppDir"
Expand All @@ -19,42 +24,42 @@ read -p "? Version [Eg: 1.0.0]: " appVersion
# read -p "? Architecture: " x86_64

function download_appimagetool() {
if [ ! -d ./build ]; then mkdir ./build; fi
if [ ! -d ./build/appimage ]; then mkdir ./build/appimage; fi
if [ ! -d ./build/appimage/appimage-build ]; then mkdir ./build/appimage/appimage-build; fi
if [ ! -x ./build/appimage/appimage-build/appimagetool-$ARCH.AppImage ]; then
curl -L -o ./build/appimage/appimage-build/appimagetool-$ARCH.AppImage https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-$ARCH.AppImage
chmod a+x ./build/appimage/appimage-build/appimagetool-$ARCH.AppImage
if [ ! -d ../build ]; then mkdir ../build; fi
if [ ! -d ../build/appimage ]; then mkdir ../build/appimage; fi
if [ ! -d ../build/appimage/appimage-build ]; then mkdir ../build/appimage/appimage-build; fi
if [ ! -x ../build/appimage/appimage-build/appimagetool-$ARCH.AppImage ]; then
curl -L -o ../build/appimage/appimage-build/appimagetool-$ARCH.AppImage https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-$ARCH.AppImage
chmod a+x ../build/appimage/appimage-build/appimagetool-$ARCH.AppImage
fi
}

function create_appdir() {
if [ -d "./build/appimage/$appName.AppDir" ]; then rm -rf ./build/appimage/$appName.AppDir; fi
mkdir ./build/appimage/$appName.AppDir
if [ -d "../build/appimage/$appName.AppDir" ]; then rm -rf ../build/appimage/$appName.AppDir; fi
mkdir ../build/appimage/$appName.AppDir
}

function after_bundle() {
cp build/linux/x64/release/bundle/assistant build/appimage/$appName.AppDir
cp -r build/linux/x64/release/bundle/lib/. build/appimage/$appName.AppDir/lib
cp -r build/linux/x64/release/bundle/data build/appimage/$appName.AppDir
cp -r build/linux/x64/release/bundle/passy build/appimage/$appName.AppDir
cp ../build/linux/x64/release/bundle/assistant ../build/appimage/$appName.AppDir
cp -r ../build/linux/x64/release/bundle/lib/ ../build/appimage/$appName.AppDir/lib
cp -r ../build/linux/x64/release/bundle/data ../build/appimage/$appName.AppDir
cp -r ../build/linux/x64/release/bundle/passy ../build/appimage/$appName.AppDir
# cp $appIcon AppDir/usr/share/icons/

# cp -r build/linux/*/release/bundle/ $appName.AppDir

# if [[ $(file -b "$appIcon.[ps]*g") =~ ]];

if [ ! -b "$appIcon.[ps]*g" ]; then
cp $appIcon.[ps]*g build/appimage/$appName.AppDir
cp $appIcon.[ps]*g ../build/appimage/$appName.AppDir
# mkdir -p $appName.AppDir/usr/share/icons/
# cp $appIcon.[ps]*g $appName.AppDir/usr/share/icons/
fi
}

function create_apprun() {
touch build/appimage/$appName.AppDir/AppRun
echo -e '#!/bin/sh\n\ncd "$(dirname "$0")"\nexec ./'$appExec'' > ./build/appimage/$appName.AppDir/AppRun
chmod +x ./build/appimage/$appName.AppDir/AppRun
touch ../build/appimage/$appName.AppDir/AppRun
echo -e '#!/bin/sh\n\ncd "$(dirname "$0")"\nexec ./'$appExec'' > ../build/appimage/$appName.AppDir/AppRun
chmod +x ../build/appimage/$appName.AppDir/AppRun
}

function create_desktop() {
Expand All @@ -71,17 +76,17 @@ function create_desktop() {
local ca="Categories=Utility;"
local co="Comment=Cross-Platform Password Manager"

touch ./build/appimage/$appName.AppDir/$appId.desktop
echo -e "$de\n$xaa\n$xav\n$xan\n$v\n$ty\n$te\n$n\n$e\n$i\n$ca\n$co" > ./build/appimage/$appName.AppDir/$appId.desktop
touch ../build/appimage/$appName.AppDir/$appId.desktop
echo -e "$de\n$xaa\n$xav\n$xan\n$v\n$ty\n$te\n$n\n$e\n$i\n$ca\n$co" > ../build/appimage/$appName.AppDir/$appId.desktop
}

function build_appimage() {
# the build command itself:
./build/appimage/appimage-build/appimagetool-$ARCH.AppImage ./build/appimage/$appName.AppDir
../build/appimage/appimage-build/appimagetool-$ARCH.AppImage ../build/appimage/$appName.AppDir

# move result in build folder

mv ./$appName-$ARCH.AppImage ./build/appimage/$appName-$appVersion-$ARCH.AppImage
mv ./$appName-$ARCH.AppImage ../build/appimage/$appName-$appVersion-$ARCH.AppImage

}

Expand Down
Binary file added appimage/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c5ed0d0

Please sign in to comment.