From 16ee59080b688694f503ad2681841c552c0456fa Mon Sep 17 00:00:00 2001 From: Shadowrom Date: Thu, 16 Apr 2026 23:13:02 +0200 Subject: [PATCH 1/5] add CachyOS target --- linux.d/cachyos | 51 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 linux.d/cachyos diff --git a/linux.d/cachyos b/linux.d/cachyos new file mode 100644 index 0000000000..e41244a657 --- /dev/null +++ b/linux.d/cachyos @@ -0,0 +1,51 @@ +FOUND_GTK3=$(pacman -Q gtk3 2>/dev/null || true) + +REQUIRED_DEV_PACKAGES=( + autoconf + automake + base-devel + cmake + cereal + dbus + eglexternalplatform + eigen + extra-cmake-modules + file + gettext + git + gst-plugins-base + gstreamer + gtk3 + libmspack + libsecret + libtool + m4 + mesa + ninja + openssl + perl + texinfo + wayland + wayland-protocols + libxkbcommon + wget + curl + nasm + yasm + x264 + bzip2 +) + +if [[ -n "$UPDATE_LIB" ]] +then + REQUIRED_DEV_PACKAGES+=(webkit2gtk-4.1) + + sudo pacman -Syu --noconfirm + sudo pacman -S --needed --noconfirm ${REQUIRED_DEV_PACKAGES[@]} + + echo -e "done\n" + exit 0 +fi + +# Arch-based distros do not split most libraries into separate -dev packages. +FOUND_GTK3_DEV=$(pacman -Q gtk3 2>/dev/null || true) \ No newline at end of file From f50da15d4d495ec5561536d6d5891ccfc7ec312d Mon Sep 17 00:00:00 2001 From: Shadowrom Date: Thu, 16 Apr 2026 23:14:02 +0200 Subject: [PATCH 2/5] fix build for CachyOS, fix CMake files for newer CMake version --- CMakeLists.txt | 10 +++++++++- cmake/modules/FindOpenVDB.cmake | 2 +- deps/Blosc/Blosc.cmake | 1 + deps/CMakeLists.txt | 2 +- deps/Cereal/Cereal.cmake | 1 + deps/EXPAT/expat/CMakeLists.txt | 2 +- deps/FREETYPE/FREETYPE.cmake | 1 + deps/GLEW/glew/CMakeLists.txt | 2 +- deps/GMP/GMP.cmake | 4 +++- deps/JPEG/JPEG.cmake | 1 + deps/NLopt/NLopt.cmake | 1 + deps/OCCT/OCCT.cmake | 1 + deps/OpenCSG/OpenCSG.cmake | 2 ++ deps/PNG/PNG.cmake | 2 ++ deps/Qhull/Qhull.cmake | 1 + deps/TBB/TBB.cmake | 1 + deps/TIFF/TIFF.cmake | 1 + deps/libnoise/libnoise.cmake | 2 ++ deps/wxWidgets/wxWidgets.cmake | 3 ++- sandboxes/opencsg/CMakeLists.txt | 2 +- src/BambuStudio.cpp | 10 ++++++++++ src/Shiny/CMakeLists.txt | 2 +- src/admesh/CMakeLists.txt | 2 +- src/boost/CMakeLists.txt | 2 +- src/clipper/CMakeLists.txt | 2 +- src/earcut/CMakeLists.txt | 2 +- src/glu-libtess/CMakeLists.txt | 2 +- src/imgui/CMakeLists.txt | 2 +- src/imguizmo/CMakeLists.txt | 2 +- src/libigl/CMakeLists.txt | 2 +- src/minilzo/CMakeLists.txt | 2 +- src/miniz/CMakeLists.txt | 2 +- src/platform/unix/build_appimage.sh.in | 8 ++++++++ src/qhull/CMakeLists.txt | 2 +- src/semver/CMakeLists.txt | 2 +- src/slic3r/CMakeLists.txt | 7 ++++++- tests/cpp17/CMakeLists.txt | 2 +- 37 files changed, 72 insertions(+), 23 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b3d968963d..dafc4a319d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -383,8 +383,13 @@ endif() # boost::process was introduced first in version 1.64.0, # boost::beast::detail::base64 was introduced first in version 1.66.0 set(MINIMUM_BOOST_VERSION "1.83.0") -set(_boost_components "system;filesystem;thread;log;locale;regex;chrono;atomic;date_time;iostreams") +set(_boost_components "filesystem;thread;log;locale;regex;chrono;atomic;date_time;iostreams") +if(POLICY CMP0167) + # Use BoostConfig.cmake (config mode) when available; Boost 1.84+ ships proper per-component configs. + cmake_policy(SET CMP0167 NEW) +endif() find_package(Boost ${MINIMUM_BOOST_VERSION} REQUIRED COMPONENTS ${_boost_components}) +find_package(Boost ${MINIMUM_BOOST_VERSION} QUIET COMPONENTS system) add_library(boost_libs INTERFACE) add_library(boost_headeronly INTERFACE) @@ -420,6 +425,9 @@ if(TARGET Boost::system) foreach(comp ${_boost_components}) list(APPEND _boost_targets "Boost::${comp}") endforeach() + if(TARGET Boost::system) + list(APPEND _boost_targets "Boost::system") + endif() target_link_libraries(boost_libs INTERFACE boost_headeronly # includes the custom compile definitions as well diff --git a/cmake/modules/FindOpenVDB.cmake b/cmake/modules/FindOpenVDB.cmake index 2a61b21a27..46d425eda6 100644 --- a/cmake/modules/FindOpenVDB.cmake +++ b/cmake/modules/FindOpenVDB.cmake @@ -123,7 +123,7 @@ if (OPENVDB_FIND_MODULE_PATH) endif () # ########################################################################### -cmake_minimum_required(VERSION 3.3) +cmake_minimum_required(VERSION 3.5) # Monitoring _ROOT variables if(POLICY CMP0074) cmake_policy(SET CMP0074 NEW) diff --git a/deps/Blosc/Blosc.cmake b/deps/Blosc/Blosc.cmake index 93e4564e88..ca752d0368 100644 --- a/deps/Blosc/Blosc.cmake +++ b/deps/Blosc/Blosc.cmake @@ -23,6 +23,7 @@ bambustudio_add_cmake_project(Blosc # Patching upstream does not work this way with git version 2.28 installed on mac worker # PATCH_COMMAND ${GIT_EXECUTABLE} apply --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/blosc-mods.patch CMAKE_ARGS + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_SHARED=${_build_shared} -DBUILD_STATIC=${_build_static} diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt index ec7bdff7b2..7c02766c95 100644 --- a/deps/CMakeLists.txt +++ b/deps/CMakeLists.txt @@ -21,7 +21,7 @@ # project(BambuStudio-deps) -cmake_minimum_required(VERSION 3.2) +cmake_minimum_required(VERSION 3.5) include(ExternalProject) include(ProcessorCount) diff --git a/deps/Cereal/Cereal.cmake b/deps/Cereal/Cereal.cmake index 1bd9e3f829..aa757ef312 100644 --- a/deps/Cereal/Cereal.cmake +++ b/deps/Cereal/Cereal.cmake @@ -2,6 +2,7 @@ bambustudio_add_cmake_project(Cereal URL "https://github.com/USCiLab/cereal/archive/refs/tags/v1.3.0.zip" URL_HASH SHA256=71642cb54658e98c8f07a0f0d08bf9766f1c3771496936f6014169d3726d9657 CMAKE_ARGS + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DJUST_INSTALL_CEREAL=ON -DSKIP_PERFORMANCE_COMPARISON=ON -DBUILD_TESTS=OFF diff --git a/deps/EXPAT/expat/CMakeLists.txt b/deps/EXPAT/expat/CMakeLists.txt index 585a678b80..30ee5234b8 100644 --- a/deps/EXPAT/expat/CMakeLists.txt +++ b/deps/EXPAT/expat/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.5) project(EXPAT) diff --git a/deps/FREETYPE/FREETYPE.cmake b/deps/FREETYPE/FREETYPE.cmake index d4b5e0811b..dfb64295b9 100644 --- a/deps/FREETYPE/FREETYPE.cmake +++ b/deps/FREETYPE/FREETYPE.cmake @@ -16,6 +16,7 @@ bambustudio_add_cmake_project(FREETYPE #DEPENDS ${ZLIB_PKG} #"${_patch_step}" CMAKE_ARGS + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -D BUILD_SHARED_LIBS=${library_build_shared} ${_ft_disable_zlib} -D FT_DISABLE_BZIP2=TRUE diff --git a/deps/GLEW/glew/CMakeLists.txt b/deps/GLEW/glew/CMakeLists.txt index 513ee4ebb5..e298d97505 100644 --- a/deps/GLEW/glew/CMakeLists.txt +++ b/deps/GLEW/glew/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.5) project(GLEW) find_package(OpenGL REQUIRED) diff --git a/deps/GMP/GMP.cmake b/deps/GMP/GMP.cmake index bc7ef43322..1c6e87f04d 100644 --- a/deps/GMP/GMP.cmake +++ b/deps/GMP/GMP.cmake @@ -29,7 +29,9 @@ if (MSVC) add_custom_target(dep_GMP SOURCES ${_output}) else () - set(_gmp_ccflags "-O2 -DNDEBUG -fPIC -DPIC -Wall -Wmissing-prototypes -Wpointer-arith -pedantic -fomit-frame-pointer -fno-common") + # GCC 15 defaults to a newer C dialect that breaks GMP 6.2.1 configure probes. + # Force a compatible GNU C mode for GMP and dependent MPFR builds. + set(_gmp_ccflags "-std=gnu17 -O2 -DNDEBUG -fPIC -DPIC -Wall -Wmissing-prototypes -Wpointer-arith -pedantic -fomit-frame-pointer -fno-common") set(_gmp_build_tgt "${CMAKE_SYSTEM_PROCESSOR}") if (APPLE) diff --git a/deps/JPEG/JPEG.cmake b/deps/JPEG/JPEG.cmake index b953451468..640b9ed133 100644 --- a/deps/JPEG/JPEG.cmake +++ b/deps/JPEG/JPEG.cmake @@ -22,6 +22,7 @@ bambustudio_add_cmake_project(JPEG URL_HASH SHA256=d6d99e693366bc03897677650e8b2dfa76b5d6c54e2c9e70c03f0af821b0a52f DEPENDS ${ZLIB_PKG} CMAKE_ARGS + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DENABLE_SHARED=OFF -DENABLE_STATIC=ON ${jpeg_flag} diff --git a/deps/NLopt/NLopt.cmake b/deps/NLopt/NLopt.cmake index daa7ac7fac..3695c46066 100644 --- a/deps/NLopt/NLopt.cmake +++ b/deps/NLopt/NLopt.cmake @@ -2,6 +2,7 @@ bambustudio_add_cmake_project(NLopt URL "https://github.com/stevengj/nlopt/archive/v2.5.0.tar.gz" URL_HASH SHA256=c6dd7a5701fff8ad5ebb45a3dc8e757e61d52658de3918e38bab233e7fd3b4ae CMAKE_ARGS + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DNLOPT_PYTHON:BOOL=OFF -DNLOPT_OCTAVE:BOOL=OFF -DNLOPT_MATLAB:BOOL=OFF diff --git a/deps/OCCT/OCCT.cmake b/deps/OCCT/OCCT.cmake index 7afaa8bf26..0c146a6527 100644 --- a/deps/OCCT/OCCT.cmake +++ b/deps/OCCT/OCCT.cmake @@ -15,6 +15,7 @@ bambustudio_add_cmake_project(OCCT #DEPENDS dep_Boost #DEPENDS dep_FREETYPE CMAKE_ARGS + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DBUILD_LIBRARY_TYPE=${library_build_type} -DUSE_TK=OFF -DUSE_TBB=OFF diff --git a/deps/OpenCSG/OpenCSG.cmake b/deps/OpenCSG/OpenCSG.cmake index 477d50fa03..a1ac4ba671 100644 --- a/deps/OpenCSG/OpenCSG.cmake +++ b/deps/OpenCSG/OpenCSG.cmake @@ -6,6 +6,8 @@ bambustudio_add_cmake_project(OpenCSG URL_HASH SHA256=51afe0db79af8386e2027d56d685177135581e0ee82ade9d7f2caff8deab5ec5 PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt.in ./CMakeLists.txt DEPENDS dep_GLEW + CMAKE_ARGS + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 ) if (TARGET ${ZLIB_PKG}) diff --git a/deps/PNG/PNG.cmake b/deps/PNG/PNG.cmake index 11ffd832e0..106e633ac3 100644 --- a/deps/PNG/PNG.cmake +++ b/deps/PNG/PNG.cmake @@ -14,6 +14,7 @@ if(APPLE AND IS_CROSS_COMPILE) PATCH_COMMAND ${GIT_EXECUTABLE} checkout -f -- . && git clean -df && ${GIT_EXECUTABLE} apply --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/macos-arm64.patch ${CMAKE_CURRENT_LIST_DIR}/0002-clang19-macos.patch CMAKE_ARGS + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DPNG_SHARED=OFF -DPNG_STATIC=ON -DPNG_PREFIX=prusaslicer_ @@ -34,6 +35,7 @@ set(_patch_step "") DEPENDS ${ZLIB_PKG} "${_patch_step}" CMAKE_ARGS + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DPNG_SHARED=OFF -DPNG_STATIC=ON -DPNG_PREFIX=prusaslicer_ diff --git a/deps/Qhull/Qhull.cmake b/deps/Qhull/Qhull.cmake index 497eb4b7cb..af92dafb90 100644 --- a/deps/Qhull/Qhull.cmake +++ b/deps/Qhull/Qhull.cmake @@ -3,6 +3,7 @@ bambustudio_add_cmake_project(Qhull URL "https://github.com/qhull/qhull/archive/v8.0.1.zip" URL_HASH SHA256=5287f5edd6a0372588f5d6640799086a4033d89d19711023ef8229dd9301d69b CMAKE_ARGS + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DINCLUDE_INSTALL_DIR=${CMAKE_INSTALL_INCLUDEDIR} ) diff --git a/deps/TBB/TBB.cmake b/deps/TBB/TBB.cmake index 87b76828a8..ba6c7c588a 100644 --- a/deps/TBB/TBB.cmake +++ b/deps/TBB/TBB.cmake @@ -4,6 +4,7 @@ bambustudio_add_cmake_project( URL_HASH SHA256=83ea786c964a384dd72534f9854b419716f412f9d43c0be88d41874763e7bb47 #PATCH_COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-TBB-GCC13.patch CMAKE_ARGS + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DTBB_BUILD_SHARED=OFF -DTBB_BUILD_TESTS=OFF -DTBB_TEST=OFF diff --git a/deps/TIFF/TIFF.cmake b/deps/TIFF/TIFF.cmake index 19bef192f6..203a0def46 100644 --- a/deps/TIFF/TIFF.cmake +++ b/deps/TIFF/TIFF.cmake @@ -5,6 +5,7 @@ bambustudio_add_cmake_project(TIFF URL_HASH SHA256=6F3DBED9D2ECFED33C7192B5C01884078970657FA21B4AD28E3CDF3438EB2419 DEPENDS ${ZLIB_PKG} ${PNG_PKG} ${JPEG_PKG} CMAKE_ARGS + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -Dlzma:BOOL=OFF -Dwebp:BOOL=OFF -Djbig:BOOL=OFF diff --git a/deps/libnoise/libnoise.cmake b/deps/libnoise/libnoise.cmake index 246b2a918b..ccbdca5336 100644 --- a/deps/libnoise/libnoise.cmake +++ b/deps/libnoise/libnoise.cmake @@ -4,4 +4,6 @@ bambustudio_add_cmake_project(libnoise URL https://github.com/bambulab/libnoise/archive/refs/tags/v1.0.0.zip URL_HASH SHA256=7aae3433e4c841a1b15ddf40dc995b3d32efb154b92b6796888002e275bff859 + CMAKE_ARGS + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 ) diff --git a/deps/wxWidgets/wxWidgets.cmake b/deps/wxWidgets/wxWidgets.cmake index c47db9b6b3..46f50becd4 100644 --- a/deps/wxWidgets/wxWidgets.cmake +++ b/deps/wxWidgets/wxWidgets.cmake @@ -28,7 +28,8 @@ bambustudio_add_cmake_project(wxWidgets GIT_TAG master DEPENDS ${PNG_PKG} ${ZLIB_PKG} ${EXPAT_PKG} ${TIFF_PKG} ${JPEG_PKG} CMAKE_ARGS - -DwxBUILD_PRECOMP=ON + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 + -DwxBUILD_PRECOMP=OFF ${_wx_toolkit} "-DCMAKE_DEBUG_POSTFIX:STRING=" -DwxBUILD_DEBUG_LEVEL=0 diff --git a/sandboxes/opencsg/CMakeLists.txt b/sandboxes/opencsg/CMakeLists.txt index ace8f4d539..fd1e5601e2 100644 --- a/sandboxes/opencsg/CMakeLists.txt +++ b/sandboxes/opencsg/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.5) project(OpenCSG-example) diff --git a/src/BambuStudio.cpp b/src/BambuStudio.cpp index 48a7703c03..b81a8bc63f 100644 --- a/src/BambuStudio.cpp +++ b/src/BambuStudio.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -1387,6 +1388,15 @@ int CLI::run(int argc, char **argv) save_main_thread_id(); #ifdef __WXGTK__ + // Snap-packaged IDE terminals may inject GTK/GIO paths that force loading + // /snap/core20 runtime libraries (including libpthread), which are + // incompatible with host glibc on rolling distros. + ::unsetenv("GTK_PATH"); + ::unsetenv("GTK_EXE_PREFIX"); + ::unsetenv("GIO_MODULE_DIR"); + ::unsetenv("GSETTINGS_SCHEMA_DIR"); + ::unsetenv("GDK_PIXBUF_MODULE_FILE"); + // On Linux, wxGTK has no support for Wayland, and the app crashes on // startup if gtk3 is used. This env var has to be set explicitly to // instruct the window manager to fall back to X server mode. diff --git a/src/Shiny/CMakeLists.txt b/src/Shiny/CMakeLists.txt index abdb96a72e..a4e3bbea59 100644 --- a/src/Shiny/CMakeLists.txt +++ b/src/Shiny/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.5) project(Shiny) add_library(Shiny STATIC diff --git a/src/admesh/CMakeLists.txt b/src/admesh/CMakeLists.txt index 217976318a..645495d9bb 100644 --- a/src/admesh/CMakeLists.txt +++ b/src/admesh/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.5) project(admesh) add_library(admesh STATIC diff --git a/src/boost/CMakeLists.txt b/src/boost/CMakeLists.txt index e8c9e11ce6..c8950e1501 100644 --- a/src/boost/CMakeLists.txt +++ b/src/boost/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.5) project(nowide) add_library(nowide STATIC diff --git a/src/clipper/CMakeLists.txt b/src/clipper/CMakeLists.txt index f625088209..5f8675e93d 100644 --- a/src/clipper/CMakeLists.txt +++ b/src/clipper/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.5) project(clipper) add_library(clipper STATIC diff --git a/src/earcut/CMakeLists.txt b/src/earcut/CMakeLists.txt index 08c7bb1bed..13ad5c8f42 100644 --- a/src/earcut/CMakeLists.txt +++ b/src/earcut/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.2) +cmake_minimum_required(VERSION 3.5) project(earcut_hpp LANGUAGES CXX C) option(EARCUT_BUILD_TESTS "Build the earcut test program" ON) diff --git a/src/glu-libtess/CMakeLists.txt b/src/glu-libtess/CMakeLists.txt index 8fca992a3e..bfa43d3693 100644 --- a/src/glu-libtess/CMakeLists.txt +++ b/src/glu-libtess/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.5) project(glu-libtess) add_library(glu-libtess STATIC diff --git a/src/imgui/CMakeLists.txt b/src/imgui/CMakeLists.txt index 592e78c8e3..a358a83fa1 100644 --- a/src/imgui/CMakeLists.txt +++ b/src/imgui/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.5) project(imgui) add_library(imgui STATIC diff --git a/src/imguizmo/CMakeLists.txt b/src/imguizmo/CMakeLists.txt index fec4431805..9d5c8edd65 100644 --- a/src/imguizmo/CMakeLists.txt +++ b/src/imguizmo/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.5) project(imguizmo) add_library(imguizmo STATIC diff --git a/src/libigl/CMakeLists.txt b/src/libigl/CMakeLists.txt index f023826a52..f180ea4168 100644 --- a/src/libigl/CMakeLists.txt +++ b/src/libigl/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.5) project(libigl) add_library(libigl INTERFACE) diff --git a/src/minilzo/CMakeLists.txt b/src/minilzo/CMakeLists.txt index c5122ccf0f..5ab2128c32 100644 --- a/src/minilzo/CMakeLists.txt +++ b/src/minilzo/CMakeLists.txt @@ -1,5 +1,5 @@ project(minilzo) -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 3.5) add_library(minilzo INTERFACE) diff --git a/src/miniz/CMakeLists.txt b/src/miniz/CMakeLists.txt index 04d562b764..3beefa3921 100644 --- a/src/miniz/CMakeLists.txt +++ b/src/miniz/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.5) project(miniz) add_library(miniz INTERFACE) diff --git a/src/platform/unix/build_appimage.sh.in b/src/platform/unix/build_appimage.sh.in index a350dc3722..a6bacda4fa 100644 --- a/src/platform/unix/build_appimage.sh.in +++ b/src/platform/unix/build_appimage.sh.in @@ -15,6 +15,14 @@ sed -i -e 's#/usr#././#g' bin/@SLIC3R_APP_CMD@ mv @SLIC3R_APP_CMD@ AppRun chmod +x AppRun +# Remove bundled glibc libraries to avoid symbol mismatches at runtime +# Let the AppImage use system glibc instead +rm -f usr/lib/x86_64-linux-gnu/libpthread.so.0 +rm -f usr/lib/x86_64-linux-gnu/libc.so.6 +rm -f usr/lib/x86_64-linux-gnu/libm.so.6 +rm -f usr/lib/x86_64-linux-gnu/libdl.so.2 +rm -f usr/lib64/ld-linux-x86-64.so.* 2>/dev/null || true + cp resources/images/@SLIC3R_APP_KEY@_192px.png @SLIC3R_APP_KEY@.png for PNG_SIZE in 32 128 192; do mkdir -p usr/share/icons/hicolor/${PNG_SIZE}x${PNG_SIZE}/apps diff --git a/src/qhull/CMakeLists.txt b/src/qhull/CMakeLists.txt index ab9aba9afa..310976eb22 100644 --- a/src/qhull/CMakeLists.txt +++ b/src/qhull/CMakeLists.txt @@ -28,7 +28,7 @@ endif() else(Qhull_FOUND) project(qhull) -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 3.5) # Define qhull_VERSION in CMakeLists.txt, Makefile, qhull-exports.def, qhull_p-exports.def, qhull_r-exports.def, qhull-warn.pri set(qhull_VERSION2 "2015.2 2016/01/18") # not used, See global.c, global_r.c, rbox.c, rbox_r.c diff --git a/src/semver/CMakeLists.txt b/src/semver/CMakeLists.txt index 4b61a7456e..59f12a4ca5 100644 --- a/src/semver/CMakeLists.txt +++ b/src/semver/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.5) project(semver) add_library(semver STATIC diff --git a/src/slic3r/CMakeLists.txt b/src/slic3r/CMakeLists.txt index 8a707348d8..0ae884ff9a 100644 --- a/src/slic3r/CMakeLists.txt +++ b/src/slic3r/CMakeLists.txt @@ -703,7 +703,12 @@ elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux") FIND_LIBRARY(WAYLAND_EGL_LIBRARIES NAMES wayland-egl) FIND_LIBRARY(WAYLAND_CLIENT_LIBRARIES NAMES wayland-client) find_package(CURL REQUIRED) - target_link_libraries(libslic3r_gui ${DBUS_LIBRARIES} OSMesa) + FIND_LIBRARY(OSMESA_LIBRARY NAMES OSMesa) + if (OSMESA_LIBRARY) + target_link_libraries(libslic3r_gui ${DBUS_LIBRARIES} ${OSMESA_LIBRARY}) + else() + target_link_libraries(libslic3r_gui ${DBUS_LIBRARIES}) + endif() target_link_libraries(libslic3r_gui OpenGL::EGL ${WAYLAND_SERVER_LIBRARIES} diff --git a/tests/cpp17/CMakeLists.txt b/tests/cpp17/CMakeLists.txt index 4e151ecbf0..d535f2083f 100644 --- a/tests/cpp17/CMakeLists.txt +++ b/tests/cpp17/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.5) project(Cpp17Test) From 44180d9e89db3016a4d3f2a7e9604d67f4e17d25 Mon Sep 17 00:00:00 2001 From: Shadowrom Date: Thu, 16 Apr 2026 23:49:36 +0200 Subject: [PATCH 3/5] Fix AppImage --- src/platform/unix/BuildLinuxImage.sh.in | 17 +++++++++++++---- src/platform/unix/build_appimage.sh.in | 19 ++++++++++++++++++- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/src/platform/unix/BuildLinuxImage.sh.in b/src/platform/unix/BuildLinuxImage.sh.in index e29988d9d2..59251ba9a2 100644 --- a/src/platform/unix/BuildLinuxImage.sh.in +++ b/src/platform/unix/BuildLinuxImage.sh.in @@ -34,10 +34,20 @@ echo -n "[9/9] Generating Linux app..." # remove unneeded po from resources ## find package/resources/localization -name "*.po" -type f -delete ## FIXME: DD - do we need this? - # create bin -cat << EOF >@SLIC3R_APP_CMD@ + # create launcher script at package root +cat << EOF >package/@SLIC3R_APP_CMD@ #!/bin/bash DIR=\$(readlink -f "\$0" | xargs dirname) + +# Prevent Snap-hosted shells/IDEs from injecting incompatible runtime paths +# (e.g. /snap/core20 libpthread vs host glibc). +unset GTK_PATH +unset GTK_EXE_PREFIX +unset GIO_MODULE_DIR +unset GSETTINGS_SCHEMA_DIR +unset GDK_PIXBUF_MODULE_FILE +unset LD_PRELOAD + export LD_LIBRARY_PATH="\$DIR/bin" # FIXME: BambuStudio segfault workarounds @@ -47,8 +57,7 @@ export LC_ALL=C exec "\$DIR/bin/@SLIC3R_APP_CMD@" "\$@" EOF - chmod ug+x @SLIC3R_APP_CMD@ - cp -f @SLIC3R_APP_CMD@ package/@SLIC3R_APP_CMD@ + chmod ug+x package/@SLIC3R_APP_CMD@ pushd package tar -cvf ../@SLIC3R_APP_KEY@.tar . &>/dev/null popd diff --git a/src/platform/unix/build_appimage.sh.in b/src/platform/unix/build_appimage.sh.in index a6bacda4fa..efdb689de5 100644 --- a/src/platform/unix/build_appimage.sh.in +++ b/src/platform/unix/build_appimage.sh.in @@ -12,7 +12,24 @@ 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 + +cat <<'EOF' > AppRun +#!/bin/sh + +DIR="$(dirname "$0")" + +# Prevent Snap-hosted shells/IDEs from injecting incompatible runtime paths. +unset GTK_PATH +unset GTK_EXE_PREFIX +unset GIO_MODULE_DIR +unset GSETTINGS_SCHEMA_DIR +unset GDK_PIXBUF_MODULE_FILE +unset LD_PRELOAD + +export LD_LIBRARY_PATH="$DIR/bin" + +exec "$DIR/bin/@SLIC3R_APP_CMD@" "$@" +EOF chmod +x AppRun # Remove bundled glibc libraries to avoid symbol mismatches at runtime From 4187772c357943c5efc57a0e69a48e1901efbafe Mon Sep 17 00:00:00 2001 From: Shadowrom2020 Date: Fri, 17 Apr 2026 13:38:15 +0200 Subject: [PATCH 4/5] build fix for Ubuntu > 24 --- linux.d/debian | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux.d/debian b/linux.d/debian index c076b25e23..2a98610c65 100644 --- a/linux.d/debian +++ b/linux.d/debian @@ -40,7 +40,7 @@ then if [ $ubu_major_version = "22" ] || [ $ubu_major_version = "23" ] then REQUIRED_DEV_PACKAGES+=(libwebkit2gtk-4.0-dev curl libfuse-dev libssl-dev libcurl4-openssl-dev m4) - elif [ $ubu_major_version = "24" ] + elif [ "$ubu_major_version" -ge 24 ] then REQUIRED_DEV_PACKAGES+=(libwebkit2gtk-4.1-dev) else From 2abcea03dd4a4efbd3277661ae7af1c782802355 Mon Sep 17 00:00:00 2001 From: Shadowrom2020 Date: Fri, 17 Apr 2026 14:06:08 +0200 Subject: [PATCH 5/5] fix AppImage build on systems without docker and fuse --- src/platform/unix/BuildLinuxImage.sh.in | 5 +++++ src/platform/unix/build_appimage.sh.in | 12 +++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/platform/unix/BuildLinuxImage.sh.in b/src/platform/unix/BuildLinuxImage.sh.in index 59251ba9a2..f4216d1bfd 100644 --- a/src/platform/unix/BuildLinuxImage.sh.in +++ b/src/platform/unix/BuildLinuxImage.sh.in @@ -72,6 +72,11 @@ echo -n "Creating Appimage for distribution..." chmod +x ../build_appimage.sh ../build_appimage.sh popd + if [ ! -f package/"@SLIC3R_APP_KEY@_ubu64.AppImage" ] + then + echo "AppImage packaging failed: package/@SLIC3R_APP_KEY@_ubu64.AppImage not found" >&2 + exit 1 + fi mv package/"@SLIC3R_APP_KEY@_ubu64.AppImage" "@SLIC3R_APP_KEY@_ubu64.AppImage" #} &> $ROOT/Build.log # Capture all command output echo "done" diff --git a/src/platform/unix/build_appimage.sh.in b/src/platform/unix/build_appimage.sh.in index efdb689de5..7d2747bb1f 100644 --- a/src/platform/unix/build_appimage.sh.in +++ b/src/platform/unix/build_appimage.sh.in @@ -64,10 +64,16 @@ X-AppImage-Version=@SLIC3R_VERSION@ EOF -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') +if [ -f /.dockerenv ] ; then + ../appimagetool.AppImage --appimage-extract-and-run . else - ../appimagetool.AppImage . $([ ! -z "${container}" ] && echo '--appimage-extract-and-run') + # Retry without FUSE when AppImage mount support is unavailable on host. + ../appimagetool.AppImage . || ../appimagetool.AppImage --appimage-extract-and-run . +fi + +if [ ! -f @SLIC3R_APP_KEY@-x86_64.AppImage ]; then + echo "Failed to produce @SLIC3R_APP_KEY@-x86_64.AppImage" >&2 + exit 1 fi mv @SLIC3R_APP_KEY@-x86_64.AppImage ${APP_IMAGE}