From 472da36b7ec1cf16630f1a586d29c73eb87a0dda Mon Sep 17 00:00:00 2001 From: fang64 Date: Sat, 31 Dec 2022 17:35:36 -0500 Subject: [PATCH] Add support for AppImage build in containers. --- src/platform/unix/build_appimage.sh.in | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/platform/unix/build_appimage.sh.in b/src/platform/unix/build_appimage.sh.in index 0e12d85f7..8e67e8617 100644 --- a/src/platform/unix/build_appimage.sh.in +++ b/src/platform/unix/build_appimage.sh.in @@ -7,6 +7,10 @@ APP_IMAGE="@SLIC3R_APP_KEY@_ubu64.AppImage" wget ${APPIMAGETOOLURL} -O ../appimagetool.AppImage chmod +x ../appimagetool.AppImage +if [ -f /.dockerenv ] ; then # Only run if inside of a Docker Container +sed '0,/AI\x02/{s|AI\x02|\x00\x00\x00|}' -i ../appimagetool.AppImage +fi + sed -i -e 's#/usr#././#g' bin/@SLIC3R_APP_CMD@ mv @SLIC3R_APP_CMD@ AppRun chmod +x AppRun @@ -25,6 +29,11 @@ MimeType=model/stl;application/vnd.ms-3mfdocument;application/prs.wavefront-obj; EOF -../appimagetool.AppImage . $([ ! -z "${container}" ] && echo '--appimage-extract-and-run') +if [ -f /.dockerenv ] ; then # Only run if inside of a Docker Container + ../appimagetool.AppImage --appimage-extract-and-run . $([ ! -z "${container}" ] && echo '--appimage-extract-and-run') +else + ../appimagetool.AppImage . $([ ! -z "${container}" ] && echo '--appimage-extract-and-run') +fi + mv @SLIC3R_APP_KEY@-x86_64.AppImage ${APP_IMAGE} chmod +x ${APP_IMAGE}