From e39ed902e9a92c38492ac50ce78e9ee785ddd171 Mon Sep 17 00:00:00 2001 From: Frans de Jonge Date: Mon, 9 Apr 2018 23:17:06 +0200 Subject: [PATCH] [build] AppImage: support creation in Docker container (#3852) --- Makefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7148f0012..82885e0b3 100644 --- a/Makefile +++ b/Makefile @@ -45,6 +45,9 @@ WIN32_DIR=$(PLATFORM_DIR)/win32 APPIMAGETOOL=appimagetool-x86_64.AppImage APPIMAGETOOL_URL=https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage +# set to 1 if in Docker +DOCKER:=$(shell grep -q docker /proc/1/cgroup && echo 1) + # files to link from main directory INSTALL_FILES=reader.lua setupkoenv.lua frontend resources defaults.lua datastorage.lua \ l10n tools README.md COPYING @@ -309,6 +312,11 @@ ifeq ("$(wildcard $(APPIMAGETOOL))","") # download appimagetool wget "$(APPIMAGETOOL_URL)" chmod a+x "$(APPIMAGETOOL)" +endif +ifeq ($(DOCKER), 1) + # remove previously extracted appimagetool, if any + rm -rf squashfs-root + ./$(APPIMAGETOOL) --appimage-extract endif cd $(INSTALL_DIR) && pwd && \ rm -rf tmp && mkdir -p tmp && \ @@ -319,7 +327,7 @@ endif # generate AppImage cd $(INSTALL_DIR)/tmp && \ - ARCH=x86_64 ../../$(APPIMAGETOOL) koreader && \ + ARCH=x86_64 ../../$(if $(DOCKER),squashfs-root/AppRun,$(APPIMAGETOOL)) koreader && \ mv *.AppImage ../../koreader-$(DIST)-$(MACHINE)-$(VERSION).AppImage androidupdate: all