mirror of
https://git.mirrors.martin98.com/https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-12 21:39:04 +08:00
app image builder feature (#86)
* deps/wxWidgets: Disable EGL for wxGLCanvas To work around <https://github.com/supermerill/SuperSlicer/issues/1093>. * Fix USE_GLCANVAS_EGL=OFF for only Linux Builds * Add -r flag to BuildLinux.sh to skip ram check * Add support for AppImage build in containers. * Add GitHub Action Workflow to Build AppImage * Update AppImage-Builder to use upload-artifact v3 Co-authored-by: Zhaofeng Li <hello@zhaofeng.li>
This commit is contained in:
parent
4803c35b76
commit
af44269767
32
.github/workflows/appimage.yml
vendored
Normal file
32
.github/workflows/appimage.yml
vendored
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
name: BambuStudio-SoftFever
|
||||||
|
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
appimage-builder:
|
||||||
|
name: Linux AppImage Build
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install cmake libgl1-mesa-dev libgtk-3-dev libxkbcommon-dev libunwind-dev libfuse2 -y
|
||||||
|
- name: Install dependencies from BuildLinux.sh
|
||||||
|
shell: bash
|
||||||
|
run: sudo ./BuildLinux.sh -ur
|
||||||
|
- name: Fix permissions
|
||||||
|
shell: bash
|
||||||
|
run: sudo chown $USER -R ./
|
||||||
|
- name: Build Bambu Studio dependencies using BuildLinux.sh
|
||||||
|
shell: bash
|
||||||
|
run: ./BuildLinux.sh -dsr
|
||||||
|
- name: Build Bambu Studio AppImage using BuildLinux.sh
|
||||||
|
shell: bash
|
||||||
|
run: ./BuildLinux.sh -ir
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: AppImage
|
||||||
|
path: './build/BambuStudio_ubu64.AppImage'
|
@ -28,7 +28,7 @@ function check_available_memory_and_disk() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
unset name
|
unset name
|
||||||
while getopts ":dsiuhgb" opt; do
|
while getopts ":dsiuhgbr" opt; do
|
||||||
case ${opt} in
|
case ${opt} in
|
||||||
u )
|
u )
|
||||||
UPDATE_LIB="1"
|
UPDATE_LIB="1"
|
||||||
@ -48,6 +48,9 @@ while getopts ":dsiuhgb" opt; do
|
|||||||
g )
|
g )
|
||||||
FOUND_GTK3=""
|
FOUND_GTK3=""
|
||||||
;;
|
;;
|
||||||
|
r )
|
||||||
|
SKIP_RAM_CHECK="1"
|
||||||
|
;;
|
||||||
h ) echo "Usage: ./BuildLinux.sh [-i][-u][-d][-s][-b][-g]"
|
h ) echo "Usage: ./BuildLinux.sh [-i][-u][-d][-s][-b][-g]"
|
||||||
echo " -i: Generate appimage (optional)"
|
echo " -i: Generate appimage (optional)"
|
||||||
echo " -g: force gtk2 build"
|
echo " -g: force gtk2 build"
|
||||||
@ -55,6 +58,7 @@ while getopts ":dsiuhgb" opt; do
|
|||||||
echo " -d: build deps (optional)"
|
echo " -d: build deps (optional)"
|
||||||
echo " -s: build bambu-studio (optional)"
|
echo " -s: build bambu-studio (optional)"
|
||||||
echo " -u: only update clock & dependency packets (optional and need sudo)"
|
echo " -u: only update clock & dependency packets (optional and need sudo)"
|
||||||
|
echo " -r: skip free ram check (low ram compiling)"
|
||||||
echo "For a first use, you want to 'sudo ./BuildLinux.sh -u'"
|
echo "For a first use, you want to 'sudo ./BuildLinux.sh -u'"
|
||||||
echo " and then './BuildLinux.sh -dsi'"
|
echo " and then './BuildLinux.sh -dsi'"
|
||||||
exit 0
|
exit 0
|
||||||
@ -71,6 +75,7 @@ then
|
|||||||
echo " -d: build deps (optional)"
|
echo " -d: build deps (optional)"
|
||||||
echo " -s: build bambu-studio (optional)"
|
echo " -s: build bambu-studio (optional)"
|
||||||
echo " -u: only update clock & dependency packets (optional and need sudo)"
|
echo " -u: only update clock & dependency packets (optional and need sudo)"
|
||||||
|
echo " -r: skip free ram check (low ram compiling)"
|
||||||
echo "For a first use, you want to 'sudo ./BuildLinux.sh -u'"
|
echo "For a first use, you want to 'sudo ./BuildLinux.sh -u'"
|
||||||
echo " and then './BuildLinux.sh -dsi'"
|
echo " and then './BuildLinux.sh -dsi'"
|
||||||
exit 0
|
exit 0
|
||||||
@ -153,7 +158,10 @@ then
|
|||||||
mkdir deps/build
|
mkdir deps/build
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ! [[ -n "$SKIP_RAM_CHECK" ]]
|
||||||
|
then
|
||||||
check_available_memory_and_disk
|
check_available_memory_and_disk
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -n "$BUILD_DEPS" ]]
|
if [[ -n "$BUILD_DEPS" ]]
|
||||||
then
|
then
|
||||||
|
3
deps/wxWidgets/wxWidgets.cmake
vendored
3
deps/wxWidgets/wxWidgets.cmake
vendored
@ -1,6 +1,7 @@
|
|||||||
set(_wx_git_tag v3.1.5)
|
set(_wx_git_tag v3.1.5)
|
||||||
|
|
||||||
set(_wx_toolkit "")
|
set(_wx_toolkit "")
|
||||||
|
set(_wx_glcanvas_egl "")
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
set(_gtk_ver 2)
|
set(_gtk_ver 2)
|
||||||
if (DEP_WX_GTK3)
|
if (DEP_WX_GTK3)
|
||||||
@ -8,6 +9,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|||||||
endif ()
|
endif ()
|
||||||
set(_wx_toolkit "-DwxBUILD_TOOLKIT=gtk${_gtk_ver}")
|
set(_wx_toolkit "-DwxBUILD_TOOLKIT=gtk${_gtk_ver}")
|
||||||
set(_wx_private_font "-DwxUSE_PRIVATE_FONTS=1")
|
set(_wx_private_font "-DwxUSE_PRIVATE_FONTS=1")
|
||||||
|
set(_wx_glcanvas_egl "-DwxUSE_GLCANVAS_EGL=OFF")
|
||||||
else ()
|
else ()
|
||||||
set(_wx_private_font "-DwxUSE_PRIVATE_FONTS=0")
|
set(_wx_private_font "-DwxUSE_PRIVATE_FONTS=0")
|
||||||
endif()
|
endif()
|
||||||
@ -49,6 +51,7 @@ bambustudio_add_cmake_project(wxWidgets
|
|||||||
-DwxUSE_LIBJPEG=sys
|
-DwxUSE_LIBJPEG=sys
|
||||||
-DwxUSE_LIBTIFF=sys
|
-DwxUSE_LIBTIFF=sys
|
||||||
-DwxUSE_EXPAT=sys
|
-DwxUSE_EXPAT=sys
|
||||||
|
${_wx_glcanvas_egl}
|
||||||
)
|
)
|
||||||
|
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
|
@ -7,6 +7,10 @@ APP_IMAGE="@SLIC3R_APP_KEY@_ubu64.AppImage"
|
|||||||
wget ${APPIMAGETOOLURL} -O ../appimagetool.AppImage
|
wget ${APPIMAGETOOLURL} -O ../appimagetool.AppImage
|
||||||
chmod +x ../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@
|
sed -i -e 's#/usr#././#g' bin/@SLIC3R_APP_CMD@
|
||||||
mv @SLIC3R_APP_CMD@ AppRun
|
mv @SLIC3R_APP_CMD@ AppRun
|
||||||
chmod +x AppRun
|
chmod +x AppRun
|
||||||
@ -25,6 +29,11 @@ MimeType=model/stl;application/vnd.ms-3mfdocument;application/prs.wavefront-obj;
|
|||||||
EOF
|
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}
|
mv @SLIC3R_APP_KEY@-x86_64.AppImage ${APP_IMAGE}
|
||||||
chmod +x ${APP_IMAGE}
|
chmod +x ${APP_IMAGE}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user