40 withSystemd ? stdenv.hostPlatform.isLinux,
46 withPrivateFonts = true;
50 configureFlags = old.configureFlags ++ [
51 # Disable noisy debug dialogs
56 stdenv.mkDerivation rec {
57 pname = "bambu-studio";
58 version = "01.09.07.52";
60 src = fetchFromGitHub {
64 hash = "sha256-fhH4N29P/ysdHHbZt+FnBl3+QtTNhbVE3j4ZnFJyJH0=";
89 gst_all_1.gst-plugins-base
90 gst_all_1.gst-plugins-bad
91 gst_all_1.gst-plugins-good
107 ] ++ lib.optionals withSystemd [ systemd ] ++ checkInputs;
110 # Fix for webkitgtk linking
111 ./patches/0001-not-for-upstream-CMakeLists-Link-against-webkit2gtk-.patch
112 # Fix build with cgal-5.6.1+
113 ./patches/meshboolean-const.patch
115 ./patches/dont-link-opencv-world-bambu.patch
119 checkInputs = [ gtest ];
121 separateDebugInfo = true;
123 # The build system uses custom logic - defined in
124 # cmake/modules/FindNLopt.cmake in the package source - for finding the nlopt
125 # library, which doesn't pick up the package in the nix store. We
126 # additionally need to set the path via the NLOPT environment variable.
129 # Disable compiler warnings that clutter the build log.
130 # It seems to be a known issue for Eigen:
131 # http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1221
132 NIX_CFLAGS_COMPILE = toString [
133 "-Wno-ignored-attributes"
134 "-I${opencv.out}/include/opencv4"
137 # prusa-slicer uses dlopen on `libudev.so` at runtime
138 NIX_LDFLAGS = lib.optionalString withSystemd "-ludev";
142 # Since version 2.5.0 of nlopt we need to link to libnlopt, as libnlopt_cxx
143 # now seems to be integrated into the main lib.
144 sed -i 's|nlopt_cxx|nlopt|g' cmake/modules/FindNLopt.cmake
152 # BambuStudio-specific
153 "-DBBL_RELEASE_TO_PUBLIC=1"
154 "-DBBL_INTERNAL_TESTING=0"
156 "-DSLIC3R_BUILD_TESTS=0"
157 "-DCMAKE_CXX_FLAGS=-DBOOST_LOG_DYN_LINK"
162 --prefix LD_LIBRARY_PATH : "$out/lib"
164 # Fixes intermittent crash
165 # The upstream setup links in glew statically
166 --prefix LD_PRELOAD : "${glew.out}/lib/libGLEW.so"
170 # needed to prevent collisions between the LICENSE.txt files of
171 # bambu-studio and orca-slicer.
173 mv $out/LICENSE.txt $out/share/BambuStudio/LICENSE.txt
174 mv $out/README.md $out/share/BambuStudio/README.md
178 description = "PC Software for BambuLab's 3D printers";
179 homepage = "https://github.com/bambulab/BambuStudio";
180 changelog = "https://github.com/bambulab/BambuStudio/releases/tag/v${version}";
181 license = licenses.agpl3Plus;
182 maintainers = with maintainers; [
186 mainProgram = "bambu-studio";
187 platforms = platforms.linux;