%global srcname BambuStudio %global _description %{expand: Bambu Studio is a cutting-edge, feature-rich slicing software. It contains project-based workflows, systematically optimized slicing algorithms, and an easy-to-use graphic interface, bringing users an incredibly smooth printing experience.} # This badly fails to build for now %bcond tests 0 Name: bambu-studio Version: 01.10.01.50 Release: %autorelease Summary: PC Software for BambuLab and other 3D printers License: AGPL-3.0-only URL: https://github.com/bambulab/BambuStudio Source0: %{url}/archive/v%{version}/%{srcname}-%{version}.tar.gz # Sync to modern FindOpenVDB.cmake Patch: %{url}/pull/5102.patch # OpenVDB doesn't build for i686 ExcludeArch: %{ix86} BuildRequires: cmake BuildRequires: desktop-file-utils BuildRequires: gcc-c++ BuildRequires: sed BuildRequires: boost-devel BuildRequires: mesa-libGL-devel BuildRequires: mesa-libOSMesa-devel BuildRequires: openvdb-devel BuildRequires: webkit2gtk4.1-devel BuildRequires: wxGTK-devel BuildRequires: cmake(cereal) # We need to use a compat package on f42+ as upstream doesn't support CGAL6 yet # https://github.com/prusa3d/PrusaSlicer/pull/13081 %if 0%{?fedora} > 41 BuildRequires: CGAL5-devel %else BuildRequires: cmake(CGAL) < 6 %endif BuildRequires: cmake(DBus1) BuildRequires: cmake(Eigen3) BuildRequires: cmake(glfw3) BuildRequires: cmake(Imath) BuildRequires: cmake(NLopt) BuildRequires: cmake(OpenCASCADE) BuildRequires: cmake(OpenCV) BuildRequires: cmake(TBB) BuildRequires: pkgconfig(blosc) BuildRequires: pkgconfig(expat) BuildRequires: pkgconfig(glew) BuildRequires: pkgconfig(gstreamer-1.0) BuildRequires: pkgconfig(libavcodec) BuildRequires: pkgconfig(libavutil) BuildRequires: pkgconfig(libcurl) BuildRequires: pkgconfig(libpng) BuildRequires: pkgconfig(openssl) BuildRequires: pkgconfig(libswscale) BuildRequires: pkgconfig(zlib-ng) %if %{with tests} # TODO: this is copypasta from prusa-slicer and needs to be reviewed BuildRequires: perl-devel BuildRequires: perl-generators BuildRequires: perl(Class::XSAccessor) BuildRequires: perl(Devel::CheckLib) BuildRequires: perl(ExtUtils::CppGuess) BuildRequires: perl(ExtUtils::Embed) BuildRequires: perl(ExtUtils::MakeMaker) BuildRequires: perl(ExtUtils::ParseXS) BuildRequires: perl(ExtUtils::Typemaps) BuildRequires: perl(ExtUtils::Typemaps::Basic) BuildRequires: perl(ExtUtils::XSpp) BuildRequires: perl(ExtUtils::XSpp::Cmd) BuildRequires: perl(File::Basename) BuildRequires: perl(File::Spec) BuildRequires: perl(Getopt::Long) BuildRequires: perl(IO::Scalar) BuildRequires: perl(List::Util) BuildRequires: perl(local::lib) BuildRequires: perl(Module::Build::WithXSpp) BuildRequires: perl(Moo) BuildRequires: perl(parent) BuildRequires: perl(POSIX) BuildRequires: perl(Scalar::Util) BuildRequires: perl(Test::Harness) BuildRequires: perl(Test::More) BuildRequires: perl(Time::HiRes) BuildRequires: perl(Wx) %endif Requires: %{name}-data = %{version}-%{release} Requires: hicolor-icon-theme # In case someone looks for the upstream name Provides: %{srcname} = %{version}-%{release} %description %{_description} %package data Summary: Data files for Bambu Studio BuildArch: noarch %description data %{_description} This package contains data files for Bambu Studio. %prep %autosetup -n %{srcname}-%{version} -p1 # Do not attempt to copy and install host shared libraries sed -i /bambustudio_copy_sos/d src/CMakeLists.txt sed -i '/install(FILES ${LIBRARY_FILES}/d' CMakeLists.txt # Drop broken macro usage sed -i /wxFAIL/d src/slic3r/GUI/Widgets/StateColor.cpp # Cereal is a header-only library, don't attempt to link against it sed -i 's/BambuStudio libslic3r cereal/BambuStudio libslic3r/' src/CMakeLists.txt sed -i 's/libslic3r_gui libslic3r cereal/libslic3r_gui libslic3r/g' src/slic3r/CMakeLists.txt # Fix OpenCV linkage: https://github.com/SoftFever/OrcaSlicer/pull/6691 sed -i 's/OpenCV REQUIRED core/OpenCV REQUIRED core imgproc/' src/libslic3r/CMakeLists.txt sed -i '/EXPAT_INCLUDE_DIRS/atarget_include_directories(libslic3r PUBLIC ${OpenCV_INCLUDE_DIRS})' src/libslic3r/CMakeLists.txt sed -i 's/opencv_world/${OpenCV_LIBS}/' src/libslic3r/CMakeLists.txt # Use the right library: https://github.com/prusa3d/PrusaSlicer/pull/13761 sed -i 's/TKXDESTEP/TKDESTEP/' src/libslic3r/CMakeLists.txt # These libraries do not exist for lib in cereal TKSTEP TKSTEP209 TKSTEPAttr TKSTEPBase; do sed -i "/${lib}/d" src/libslic3r/CMakeLists.txt done # Forcibly link against webkit2gtk # https://github.com/SoftFever/OrcaSlicer/blob/d7789282b92a15545c90fa52b4bc64298567b926/src/slic3r/CMakeLists.txt#L668 sed -i '/find_package(GTK/apkg_check_modules(webkit2gtk REQUIRED webkit2gtk-4.1)\ntarget_link_libraries (libslic3r_gui ${webkit2gtk_LIBRARIES})' src/slic3r/CMakeLists.txt # Clipper2 is an internal library, ensure it's statically linked sed -i 's/add_library(Clipper2/add_library(Clipper2 STATIC/' src/clipper2/CMakeLists.txt # Drop build docs rm doc/'How to build'* %build # - enable column-tracking for large sources to avoid some noisy warnings # - unbreak usage of boost/timer.hpp as it's all over the place # - allow dynamic linking for boost::log (https://github.com/SoftFever/OrcaSlicer/pull/6697) CXXFLAGS="$CXXFLAGS -flarge-source-files -DBOOST_TIMER_ENABLE_DEPRECATED=1 -DBOOST_LOG_DYN_LINK=1" \ %cmake \ -DSLIC3R_FHS=ON \ -DSLIC3R_GTK=3 \ %if %{with tests} -DSLIC3R_BUILD_TESTS=ON \ -DSLIC3R_PERL_XS=ON \ %endif -DBBL_RELEASE_TO_PUBLIC=1 \ -DBBL_INTERNAL_TESTING=0 \ -DDEP_WX_GTK3=ON \ %{nil} %cmake_build %install %cmake_install # Remove some cruft rm %{buildroot}%{_prefix}/LICENSE.txt rm %{buildroot}%{_prefix}/README.md rm -r %{buildroot}%{_includedir}/ %check desktop-file-validate %{buildroot}%{_datadir}/applications/%{srcname}.desktop %cmake_build -- test ARGS=-V %files %doc README.md doc %{_bindir}/%{name} %files data %license LICENSE %{_datadir}/%{srcname}/ %{_datadir}/applications/%{srcname}.desktop %{_datadir}/icons/hicolor/32x32/apps/%{srcname}.png %{_datadir}/icons/hicolor/128x128/apps/%{srcname}.png %{_datadir}/icons/hicolor/192x192/apps/%{srcname}.png %changelog %autochangelog