Skip to content

Commit 9088cfc

Browse files
authored
Merge pull request #53 from ryukinix/add-app-image-generator
feat: add make appimage
2 parents ab3dace + daaf6e3 commit 9088cfc

File tree

3 files changed

+55
-6
lines changed

3 files changed

+55
-6
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
system-index.txt
33
lisp-inference
44
docs/
5+
*.AppImage
6+
*.AppDir

Makefile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
SBCL_CMD := sbcl --noinform --disable-debugger --load scripts/fix-quicklisp.lisp --load
2-
OBJECTS := lisp-inference
32
DOCKER_IMG = lisp-inference
43
VERSION := latest
54
PUBLIC_IMG = ryukinix/$(DOCKER_IMG):$(VERSION)
65

7-
all: $(OBJECTS)
8-
9-
10-
$(OBJECTS): src/*.lisp
6+
lisp-inference: src/*.lisp
117
$(SBCL_CMD) scripts/build.lisp
128

139

@@ -54,4 +50,7 @@ docker-publish: docker-build
5450
deploy: docker-publish
5551
ssh starfox bash /home/lerax/Deploy/logic.sh
5652

57-
.PHONY: check docker-build docs
53+
appimage: lisp-inference
54+
bash scripts/appimage.sh
55+
56+
.PHONY: check docker-build docs appimage

scripts/appimage.sh

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
APPIMAGEDIR=.appimage
6+
mkdir -p "$APPIMAGEDIR"
7+
8+
APPIMAGE_TOOL_URL="https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
9+
APPIMAGE_TOOL_PATH="$APPIMAGEDIR/appimagetool-x86_64.AppImage"
10+
11+
if [ ! -f "$APPIMAGE_TOOL_PATH" ]; then
12+
echo "Downloading appimagetool..."
13+
wget -c "$APPIMAGE_TOOL_URL" -O "$APPIMAGE_TOOL_PATH"
14+
chmod +x "$APPIMAGE_TOOL_PATH"
15+
else
16+
echo "appimagetool already exists, skipping download."
17+
fi
18+
19+
APPDIR="$APPIMAGEDIR/lisp-inference.AppDir"
20+
21+
# Create the AppDir structure
22+
mkdir -p "$APPDIR/usr/bin/"
23+
24+
# Create the .desktop file
25+
cat > "$APPDIR/lisp-inference.desktop" <<EOL
26+
[Desktop Entry]
27+
Name=lisp-inference
28+
Exec=AppRun
29+
Icon=computer-symbolic
30+
Terminal=true
31+
Type=Application
32+
Categories=Utility;
33+
EOL
34+
35+
# Create AppRun
36+
cat > "$APPDIR/AppRun" <<EOL
37+
#!/bin/sh
38+
HERE=\$(dirname "\$(readlink -f "\${0}")")
39+
"\${HERE}/usr/bin/lisp-inference" "\$@"
40+
EOL
41+
chmod +x "$APPDIR/AppRun"
42+
43+
# Copy the binary and icon
44+
cp -v ./lisp-inference "$APPDIR/usr/bin/"
45+
cp -v /usr/share/icons/Adwaita/scalable/devices/computer-symbolic.svg "$APPDIR/"
46+
47+
# Run appimagetool
48+
"$APPIMAGE_TOOL_PATH" "$APPDIR"

0 commit comments

Comments
 (0)