Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
system-index.txt
lisp-inference
docs/
*.AppImage
*.AppDir
11 changes: 5 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
SBCL_CMD := sbcl --noinform --disable-debugger --load scripts/fix-quicklisp.lisp --load
OBJECTS := lisp-inference
DOCKER_IMG = lisp-inference
VERSION := latest
PUBLIC_IMG = ryukinix/$(DOCKER_IMG):$(VERSION)

all: $(OBJECTS)


$(OBJECTS): src/*.lisp
lisp-inference: src/*.lisp
$(SBCL_CMD) scripts/build.lisp


Expand Down Expand Up @@ -54,4 +50,7 @@ docker-publish: docker-build
deploy: docker-publish
ssh starfox bash /home/lerax/Deploy/logic.sh

.PHONY: check docker-build docs
appimage: lisp-inference
bash scripts/appimage.sh

.PHONY: check docker-build docs appimage
48 changes: 48 additions & 0 deletions scripts/appimage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/bash

set -e

APPIMAGEDIR=.appimage
mkdir -p "$APPIMAGEDIR"

APPIMAGE_TOOL_URL="https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
APPIMAGE_TOOL_PATH="$APPIMAGEDIR/appimagetool-x86_64.AppImage"

if [ ! -f "$APPIMAGE_TOOL_PATH" ]; then
echo "Downloading appimagetool..."
wget -c "$APPIMAGE_TOOL_URL" -O "$APPIMAGE_TOOL_PATH"
chmod +x "$APPIMAGE_TOOL_PATH"
else
echo "appimagetool already exists, skipping download."
fi

APPDIR="$APPIMAGEDIR/lisp-inference.AppDir"

# Create the AppDir structure
mkdir -p "$APPDIR/usr/bin/"

# Create the .desktop file
cat > "$APPDIR/lisp-inference.desktop" <<EOL
[Desktop Entry]
Name=lisp-inference
Exec=AppRun
Icon=computer-symbolic
Terminal=true
Type=Application
Categories=Utility;
EOL

# Create AppRun
cat > "$APPDIR/AppRun" <<EOL
#!/bin/sh
HERE=\$(dirname "\$(readlink -f "\${0}")")
"\${HERE}/usr/bin/lisp-inference" "\$@"
EOL
chmod +x "$APPDIR/AppRun"

# Copy the binary and icon
cp -v ./lisp-inference "$APPDIR/usr/bin/"
cp -v /usr/share/icons/Adwaita/scalable/devices/computer-symbolic.svg "$APPDIR/"

# Run appimagetool
"$APPIMAGE_TOOL_PATH" "$APPDIR"