Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AppImage Release #270

Open
ManBearPigg opened this issue May 21, 2024 · 3 comments
Open

AppImage Release #270

ManBearPigg opened this issue May 21, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@ManBearPigg
Copy link

ManBearPigg commented May 21, 2024

The Case for AppImage

I see that there is discussion about a Flatpak release and that's great. But for now, there is a single binary. Usually this type of single file release uses AppImage format. There is commonly used tooling to essentially install an AppImage, providing a taskbar shortcut with an icon, adding it to the application launcher, etc. When foregoing package managers, AppImage is a more polished and user friendly release that accommodates the Linux user's GUI. People don't really want to start a graphical app with the terminal.

Furthermore, converting the binary into an AppImage is super easy. It will take literally two minutes and it will work the first try.

How to Convert the Linux Binary to an AppImage File

I'm not experienced with Github release CLI or whatever, so I'll just explain how I converted the binary to an AppImage.

Create the following directory structure:

Lorien.AppDir/
├── AppRun
├── Lorien.desktop
├── LorienIcon.png
└── usr/
    └── bin/
        ├── Lorien
        └── Lorien.pck

Copy and paste the AppRun file:

#!/bin/bash
   HERE="$(dirname "$(readlink -f "${0}")")"
   exec "${HERE}/usr/bin/Lorien" "$@"

Copy and paste the Lorien.desktop file:

[Desktop Entry]
Name=Lorien
Comment=Infinite Canvas
Exec=AppRun
Icon=LorienIcon
Type=Application
Categories=Utility;

Make AppRun and Lorien (the Lorien binary, I might have renamed it) executable.

chmod +x AppRun
chmod +x usr/bin/Lorien

Download the appimagetool (itself an AppImage!) which is the official software used to build an AppImage: https://github.com/AppImage/AppImageKit/releases

Then simply:
./appimagetool-x86_64.AppImage Lorien.AppDir

That will produce the Lorien-x86_64.AppImage file which can be included as a release.

Then the Linux user can use their GearLever or whatever to install the program, and they will be appreciative.

@ManBearPigg ManBearPigg added the enhancement New feature or request label May 21, 2024
@Samueru-sama
Copy link

This script turns the released binary into a appimage.

#!/bin/sh
set -u
APP=Lorien
SITE="mbrlabs/Lorien"
APPIMAGETOOL=$(wget -q https://api.github.com/repos/probonopd/go-appimage/releases -O - | sed 's/[()",{} ]/\n/g' | grep -oi 'https.*continuous.*tool.*86_64.*mage$')

# CREATE DIRECTORIES AND PREPARE ARCHIVE
[ -n "$APP" ] && mkdir -p ./"$APP".AppDir && cd ./"$APP".AppDir
version=$(wget -q https://api.github.com/repos/"$SITE"/releases/latest -O - | sed 's/[()",{} ]/\n/g' | grep -oi 'https.*linux.*xz$' | head -1)
wget "$version" && tar fx ./*tar* && rm -f ./*tar* && mv ./*/* ./ && find . -empty -type d -delete && mv ./*x86_64 ./"$APP" || exit 1
mkdir -p ./usr/bin ./usr/share/applications && mv "$APP"* ./usr/bin/ || exit 1

# DESKTOP ENTRY AND ICON
DESKTOP="https://raw.githubusercontent.com/mbrlabs/Lorien/main/public/linux/com.github.mbrlabs.Lorien.desktop"
ICON="https://raw.githubusercontent.com/mbrlabs/Lorien/main/art/logo.svg"
wget -q "$DESKTOP" -O ./usr/share/applications/com.github.mbrlabs.Lorien.desktop || exit 1
wget -q "$ICON" -O ./com.github.mbrlabs.Lorien.svg || exit 1
ln -s usr/share/applications/*desktop ./ && ln -s ./*.svg ./.DirIcon || exit 1

# AppRun
cat >> ./AppRun << 'EOF'
#!/bin/sh
CURRENTDIR="$(readlink -f "$(dirname "$0")")"
exec "$CURRENTDIR"/usr/bin/Lorien "$@"
EOF
chmod a+x ./AppRun

# MAKE APPIMAGE
cd ..
export ARCH=x86_64
export VERSION="$(./"$APP".AppDir/AppRun --version)"
wget -q "$APPIMAGETOOL" -O ./appimagetool && chmod a+x ./appimagetool || exit 1
./appimagetool -s ./"$APP".AppDir || exit 1
echo "All Done!"

It uses go-appimagetool instead as it makes the appimage with the static runtime which means there is no libfuse2 requirement on the host.

@Samueru-sama
Copy link

Samueru-sama commented Jul 23, 2024

I tried to add an appimage job ci

However I get error Required helper tool file missing from appimagetool, this is because the docker container doesn't have file available.

I don't know how to make it available.

@xplshn
Copy link

xplshn commented Sep 1, 2024

I tried to add an appimage job ci

However I get error Required helper tool file missing from appimagetool, this is because the docker container doesn't have file available.

I don't know how to make it available.

The CI should be using the .AppImage releases of appimagetool :-"|

Azathothas added a commit to Azathothas/Toolpacks that referenced this issue Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants