diff options
| author | gabrix73 <gabriel1@frozenstar.info> | 2026-04-12 16:18:58 +0200 |
|---|---|---|
| committer | gabrix73 <gabriel1@frozenstar.info> | 2026-04-12 16:18:58 +0200 |
| commit | b5f34ae76c7b226e844317bd221c77f2d8fa1d3e (patch) | |
| tree | f479b8a92b4557ee15407b6b9d2fef1df57cc829 | |
| parent | 713033fc2e7c6214c3cbe51dd9255e0eff9868bb (diff) | |
| download | khimera-b5f34ae76c7b226e844317bd221c77f2d8fa1d3e.tar.gz khimera-b5f34ae76c7b226e844317bd221c77f2d8fa1d3e.tar.xz khimera-b5f34ae76c7b226e844317bd221c77f2d8fa1d3e.zip | |
feat: add AppImage build target via Docker Ubuntu 20.04 for portable Linux release
| -rw-r--r-- | Makefile | 47 | ||||
| -rw-r--r-- | appimage/khimera.desktop | 8 | ||||
| -rw-r--r-- | docker/Dockerfile.appimage | 31 |
3 files changed, 83 insertions, 3 deletions
@@ -14,7 +14,7 @@ BLUE := \033[0;34m RED := \033[0;31m NC := \033[0m -.PHONY: all clean windows linux android portable help test install-deps +.PHONY: all clean windows linux android portable appimage help test install-deps # Default target all: portable @@ -24,9 +24,10 @@ help: @echo "Khimera Portable Build System v$(VERSION)" @echo "" @echo "Usage:" - @echo " make portable - Build all portable executables" + @echo " make portable - Build all portable executables (local dev)" + @echo " make linux - Build Linux executable only (local dev)" @echo " make windows - Build Windows executable only" - @echo " make linux - Build Linux executable only" + @echo " make appimage - Build portable AppImage via Docker (release)" @echo " make android - Build Android APK only" @echo " make clean - Clean build artifacts" @echo " make test - Run tests" @@ -81,6 +82,44 @@ linux: install-deps echo "$(RED)✗$(NC) Linux build failed"; \ fi +# Build AppImage (portable Linux release via Docker) +appimage: + @echo "$(BLUE)╔════════════════════════════════════════╗$(NC)" + @echo "$(BLUE)║ KHIMERA APPIMAGE BUILD v$(VERSION) ║$(NC)" + @echo "$(BLUE)╚════════════════════════════════════════╝$(NC)" + @echo "" + @echo "$(BLUE)[AppImage]$(NC) Building Docker image..." + docker build -t khimera-builder -f docker/Dockerfile.appimage . + @echo "$(BLUE)[AppImage]$(NC) Compiling and packaging..." + docker run --rm --privileged \ + -v $(shell pwd):/build \ + -w /build \ + khimera-builder \ + bash -c " \ + go mod tidy && \ + CGO_ENABLED=1 go build \ + -ldflags='$(LDFLAGS)' \ + -o /tmp/khimera-bin \ + ./khimera-main.go && \ + mkdir -p AppDir/usr/bin AppDir/usr/share/applications AppDir/usr/share/icons/hicolor/256x256/apps && \ + cp /tmp/khimera-bin AppDir/usr/bin/khimera && \ + cp appimage/khimera.desktop AppDir/usr/share/applications/ && \ + cp appimage/khimera.desktop AppDir/ && \ + cp appimage/khimera.png AppDir/usr/share/icons/hicolor/256x256/apps/ 2>/dev/null || true && \ + cp appimage/khimera.png AppDir/ 2>/dev/null || true && \ + linuxdeploy --appdir AppDir \ + --library /usr/lib/x86_64-linux-gnu/libGL.so.1 \ + --library /usr/lib/x86_64-linux-gnu/libX11.so.6 \ + --output appimage \ + --desktop-file appimage/khimera.desktop \ + " + @mkdir -p $(OUTPUT_DIR)/Linux + @mv Khimera*.AppImage $(OUTPUT_DIR)/Linux/Khimera-v$(VERSION)-x86_64.AppImage 2>/dev/null || \ + mv khimera*.AppImage $(OUTPUT_DIR)/Linux/Khimera-v$(VERSION)-x86_64.AppImage + @rm -rf AppDir + @echo "$(GREEN)✓ AppImage build complete!$(NC)" + @echo "Output: $(OUTPUT_DIR)/Linux/Khimera-v$(VERSION)-x86_64.AppImage" + # Build Android APK (placeholder - requires Android SDK) android: @echo "$(YELLOW)[Android]$(NC) Android build not yet implemented" @@ -112,6 +151,8 @@ clean: rm -rf $(OUTPUT_DIR) rm -rf khimera-portable-v*.zip rm -rf khimera-portable-v*.tar.gz + rm -rf AppDir + rm -f *.AppImage @echo "$(GREEN)✓$(NC) Clean complete" # Package distribution diff --git a/appimage/khimera.desktop b/appimage/khimera.desktop new file mode 100644 index 0000000..9cd4c7e --- /dev/null +++ b/appimage/khimera.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Name=Khimera +Comment=Privacy-First P2P Messenger +Exec=khimera +Icon=khimera +Type=Application +Categories=Network;InstantMessaging;Security; +Keywords=privacy;encryption;p2p;messenger;tor; diff --git a/docker/Dockerfile.appimage b/docker/Dockerfile.appimage new file mode 100644 index 0000000..80429dd --- /dev/null +++ b/docker/Dockerfile.appimage @@ -0,0 +1,31 @@ +FROM ubuntu:20.04 + +ENV DEBIAN_FRONTEND=noninteractive +ENV GO_VERSION=1.23.0 +ENV APPIMAGE_TOOL_VERSION=13 + +RUN apt-get update && apt-get install -y \ + wget curl git \ + gcc g++ \ + libgl1-mesa-dev \ + libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev \ + libxxf86vm-dev \ + pkg-config \ + fuse libfuse2 \ + file \ + && rm -rf /var/lib/apt/lists/* + +# Install Go +RUN wget -q https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz \ + && tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz \ + && rm go${GO_VERSION}.linux-amd64.tar.gz + +ENV PATH="/usr/local/go/bin:${PATH}" +ENV GOPATH="/root/go" + +# Install linuxdeploy + AppImage plugin +RUN wget -q https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage \ + && chmod +x linuxdeploy-x86_64.AppImage \ + && mv linuxdeploy-x86_64.AppImage /usr/local/bin/linuxdeploy + +WORKDIR /build |
