%global build_number 52 %global version_full 02.05.01.52 # Disable LTO - FFmpeg bundled dep has assembly that conflicts with -flto %global _lto_cflags %{nil} Name: bambu-studio Version: 2.5.1 Release: 9%{?dist} Summary: Feature-rich 3D printing slicer for Bambu Lab and other 3D printers License: AGPL-3.0-only URL: https://github.com/bambulab/BambuStudio Source0: %{name}-%{version}.tar.gz # On Linux, use system GMP/MPFR in deps stage to avoid bundled GMP GCC15 probe failures Patch0: use-system-gmp-linux.patch Patch1: use-system-mpfr-linux.patch # Boost patch paths are rooted at usr/local/include; strip to boost/* Patch2: boost-patch-strip-level.patch # Build requirements - based on BuildLinux.sh Fedora dependencies BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: cmake >= 3.14 BuildRequires: perl BuildRequires: perl-FindBin BuildRequires: m4 BuildRequires: git-core BuildRequires: gettext BuildRequires: autoconf BuildRequires: automake BuildRequires: libtool BuildRequires: texinfo BuildRequires: wget BuildRequires: procps-ng # Graphics and GUI libraries BuildRequires: mesa-libGL-devel BuildRequires: mesa-libGLU-devel BuildRequires: mesa-compat-libOSMesa-devel BuildRequires: gtk3-devel BuildRequires: webkit2gtk4.1-devel BuildRequires: dbus-devel BuildRequires: eglexternalplatform-devel BuildRequires: libmspack-devel BuildRequires: libsecret-devel # Wayland support BuildRequires: extra-cmake-modules BuildRequires: wayland-devel BuildRequires: wayland-protocols-devel BuildRequires: libxkbcommon-devel # Media libraries BuildRequires: gstreamer1-devel BuildRequires: gstreamer1-plugins-base-devel BuildRequires: gstreamer1-plugin-openh264 BuildRequires: gstreamermm-devel # Bundled dependency build tools BuildRequires: nasm BuildRequires: yasm BuildRequires: x264-devel # Build system BuildRequires: ninja-build # Other utilities BuildRequires: libcurl-devel BuildRequires: openssl-devel BuildRequires: libquadmath-devel BuildRequires: bzip2-devel BuildRequires: gmp-devel BuildRequires: mpfr-devel # Desktop integration BuildRequires: desktop-file-utils # Runtime dependencies Requires: gtk3 Requires: webkit2gtk4.1 Requires: gstreamer1 Requires: gstreamer1-plugins-base Requires: gstreamer1-plugins-good # Bundled libraries - declare per Fedora guidelines Provides: bundled(wxwidgets) = 3.2.0 Provides: bundled(imgui) Provides: bundled(libnest2d) Provides: bundled(admesh) Provides: bundled(miniz) Provides: bundled(polyclipping) Provides: bundled(heatshrink) Provides: bundled(boost) Provides: bundled(cgal) Provides: bundled(openvdb) Provides: bundled(nlopt) Provides: bundled(cereal) %description Bambu Studio is a feature-rich 3D printing slicing software designed for Bambu Lab 3D printers and compatible with other 3D printer brands. It is a fork of PrusaSlicer with enhanced features including advanced support generation, multi-color printing, cloud integration, and project-based workflows with optimized slicing algorithms. %prep %autosetup -n BambuStudio -p1 %build # Set parallel build level based on available memory # Use CMAKE_BUILD_PARALLEL_LEVEL from environment or calculate if [ -z "$CMAKE_BUILD_PARALLEL_LEVEL" ]; then FREE_MEM_GB=$(free -g | grep '^Mem:' | awk '{print $7}') PARALLEL_LEVEL=$((FREE_MEM_GB / 3)) if [ $PARALLEL_LEVEL -lt 1 ]; then PARALLEL_LEVEL=1 fi if [ $PARALLEL_LEVEL -gt 8 ]; then PARALLEL_LEVEL=8 fi export CMAKE_BUILD_PARALLEL_LEVEL=$PARALLEL_LEVEL fi echo "Building with CMAKE_BUILD_PARALLEL_LEVEL=$CMAKE_BUILD_PARALLEL_LEVEL" # Stage 1: Build bundled dependencies # Save and clear Fedora hardening flags that break autotools-based bundled deps # like GMP (configure: error: could not find a working compiler) SAVED_CFLAGS="$CFLAGS" SAVED_CXXFLAGS="$CXXFLAGS" SAVED_LDFLAGS="$LDFLAGS" export CFLAGS="-O2 -fPIC" export CXXFLAGS="-O2 -fPIC" export LDFLAGS="" mkdir -p deps/build/redhat-linux-build cd deps/build/redhat-linux-build cmake \ -DDESTDIR=%{_builddir}/BambuStudio/deps_install \ -DCMAKE_BUILD_TYPE=Release \ -DDEP_WX_GTK3=ON \ ../.. cmake --build . --parallel ${CMAKE_BUILD_PARALLEL_LEVEL} cd ../../.. # Restore Fedora flags for Stage 2 export CFLAGS="$SAVED_CFLAGS" export CXXFLAGS="$SAVED_CXXFLAGS" export LDFLAGS="$SAVED_LDFLAGS" # Stage 2: Build BambuStudio itself mkdir -p build cd build %cmake \ -DSLIC3R_STATIC=ON \ -DSLIC3R_GTK=3 \ -DBBL_RELEASE_TO_PUBLIC=1 \ -DSLIC3R_FHS=1 \ -DSLIC3R_BUILD_TESTS=0 \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_PREFIX_PATH=%{_builddir}/BambuStudio/deps_install/usr/local \ -DCMAKE_INSTALL_PREFIX=%{_prefix} \ .. %cmake_build %install cd build %cmake_install # Install desktop file mkdir -p %{buildroot}%{_datadir}/applications cat > %{buildroot}%{_datadir}/applications/bambu-studio.desktop << 'EOF' [Desktop Entry] Type=Application Name=Bambu Studio GenericName=3D Printing Slicer Comment=Feature-rich 3D printing slicing software Exec=bambu-studio %F Icon=bambu-studio Terminal=false Categories=Graphics;3DGraphics;Engineering; MimeType=model/stl;application/x-amf;application/x-3mf; Keywords=3D;Printing;Slicer;STL;AMF;3MF;BambuLab; EOF # Install icon mkdir -p %{buildroot}%{_datadir}/icons/hicolor/256x256/apps if [ -f %{_builddir}/BambuStudio/resources/images/BambuStudioLogo.png ]; then install -m 644 %{_builddir}/BambuStudio/resources/images/BambuStudioLogo.png \ %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/bambu-studio.png elif [ -f %{_builddir}/BambuStudio/resources/images/BambuStudio.png ]; then install -m 644 %{_builddir}/BambuStudio/resources/images/BambuStudio.png \ %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/bambu-studio.png fi %check desktop-file-validate %{buildroot}%{_datadir}/applications/bambu-studio.desktop %files %license LICENSE %doc README.md %{_bindir}/bambu-studio %{_datadir}/BambuStudio/ %{_datadir}/applications/bambu-studio.desktop %{_datadir}/icons/hicolor/*/apps/bambu-studio.png %changelog * Mon Feb 16 2026 linuxguy123 - 2.5.1-9 - Apply bundled Boost OBS patch only on macOS; skip on Linux - Avoid dep_Boost patch-step failures from non-matching installed-header paths * Mon Feb 16 2026 linuxguy123 - 2.5.1-8 - Adjust Boost patch strip level from -p3 to -p4 (target boost/* paths) - Add BuildRequires: procps-ng so free(1) is available in %%build * Mon Feb 16 2026 linuxguy123 - 2.5.1-7 - Add Patch2 to apply bundled Boost OBS fix with strip level -p3 - Fix missing path errors for boost/process headers in dep_Boost patch step * Mon Feb 16 2026 linuxguy123 - 2.5.1-6 - Replace layered GMP workarounds with one Linux patch using system GMP/MPFR in deps - Add explicit BuildRequires on gmp-devel and mpfr-devel * Mon Feb 16 2026 linuxguy123 - 2.5.1-5 - Refresh Patch3 context so it applies with --fuzz=0 in rpmbuild %prep - Keep ABI=64 + --disable-assembly GMP configure workaround * Mon Feb 16 2026 linuxguy123 - 2.5.1-4 - Add Patch3 to force GMP configure ABI=64 and disable assembly probes - Use conservative CFLAGS (-O0 -fPIC -DPIC) for GMP configure test programs * Mon Feb 16 2026 linuxguy123 - 2.5.1-3 - Add Patch2 to relax GMP configure CFLAGS (drop strict warning flags) - Keep GMP 6.3.0 bump and prior GCC 15 compatibility patch * Mon Feb 16 2026 linuxguy123 - 2.5.1-2 - Add Patch1 to bump bundled GMP from 6.2.1 to 6.3.0 for GCC 15 compatibility - Keep existing GMP compiler-flag patch (remove -pedantic) as additional safeguard * Sun Feb 16 2025 linuxguy123 - 2.5.1-1 - Initial COPR package for Bambu Studio 2.5.1.52 - Built with static dependencies and GTK3 support for Fedora 42 and 43 - Excludes optional non-free networking plugin