bambu-studio: init at 01.06.02.04 (#206495)

* wxGTK31: Support enabling WebRequest component

* wxGTK31: Support enabling private fonts

* bambu-studio: init at 01.06.02.04

Co-authored-by: Phileas Lebada <gitpl@woerm.at>

* bambu-studio: 01.06.02.04 -> 01.07.00.65

* bambu-studio: 01.07.00.65 -> 01.07.06.92

The OpenSSL pin is no longer needed.

* bambu-studio: 01.07.06.92 -> 01.08.00.62

* Switch to newer tbb version

tbb was broken up into two versions for backwards compability

https://github.com/NixOS/nixpkgs/pull/217585/files

and put into prusa-slicer

https://github.com/NixOS/nixpkgs/pull/238921/files

Which fixes for 1.8 beta build
```
bambu-studio> CMake Error at src/libslic3r/CMakeLists.txt:490 (target_link_libraries):
bambu-studio> Target "libslic3r" links to:
bambu-studio> TBB::tbbmalloc
bambu-studio> but the target was not found. Possible reasons include:
bambu-studio> * There is a typo in the target name.
bambu-studio> * A find_package call is missing for an IMPORTED target.
bambu-studio> * An ALIAS target is missing.
bambu-studio>
bambu-studio> -- Generating done (0.2s)
bambu-studio> CMake Warning:
bambu-studio> Manually-specified variables were not used by the project:
bambu-studio> CMAKE_EXPORT_NO_PACKAGE_REGISTRY
bambu-studio> DEP_WX_GTK3
bambu-studio>
bambu-studio> CMake Generate step failed. Build files cannot be regenerated correctly.
error: builder for '/nix/store/rzgx01p1ni2xbx5ddg0133pjjlzs8618-bambu-studio-01.08.00.57.drv' failed with exit code 1;
```

* bambu-studio: switch to custom openvdb tbb version

* Downgrade boost to 179 (181 is current default)

---------

Co-authored-by: Phileas Lebada <gitpl@woerm.at>

authored by Zhaofeng Li Phileas Lebada and committed by GitHub 92ec31fb 29d6c969

+224
+172
pkgs/applications/misc/bambu-studio/default.nix
··· 1 + { stdenv 2 + , lib 3 + , openexr 4 + , jemalloc 5 + , c-blosc 6 + , binutils 7 + , fetchFromGitHub 8 + , cmake 9 + , pkg-config 10 + , wrapGAppsHook 11 + , boost179 12 + , cereal 13 + , cgal_5 14 + , curl 15 + , dbus 16 + , eigen 17 + , expat 18 + , gcc-unwrapped 19 + , glew 20 + , glfw 21 + , glib 22 + , glib-networking 23 + , gmp 24 + , gstreamer 25 + , gst-plugins-base 26 + , gst-plugins-bad 27 + , gtest 28 + , gtk3 29 + , hicolor-icon-theme 30 + , ilmbase 31 + , libpng 32 + , mesa 33 + , mpfr 34 + , nlopt 35 + , opencascade-occt 36 + , openvdb 37 + , pcre 38 + , qhull 39 + , systemd 40 + , tbb_2021_8 41 + , webkitgtk 42 + , wxGTK31 43 + , xorg 44 + , fetchpatch 45 + , withSystemd ? stdenv.isLinux 46 + }: 47 + let 48 + wxGTK31' = wxGTK31.overrideAttrs (old: { 49 + configureFlags = old.configureFlags ++ [ 50 + # Disable noisy debug dialogs 51 + "--enable-debug=no" 52 + ]; 53 + }); 54 + openvdb_tbb_2021_8 = openvdb.overrideAttrs (old: rec { 55 + buildInputs = [ openexr boost179 tbb_2021_8 jemalloc c-blosc ilmbase ]; 56 + }); 57 + in 58 + stdenv.mkDerivation rec { 59 + pname = "bambu-studio"; 60 + version = "01.08.00.62"; 61 + 62 + src = fetchFromGitHub { 63 + owner = "bambulab"; 64 + repo = "BambuStudio"; 65 + rev = "v${version}"; 66 + hash = "sha256-Rb8YNf+ZQ8+9jAP/ZLze0PfY/liE7Rr2bJX33AENsbg="; 67 + }; 68 + 69 + nativeBuildInputs = [ 70 + cmake 71 + pkg-config 72 + wrapGAppsHook 73 + ]; 74 + 75 + buildInputs = [ 76 + binutils 77 + boost179 78 + cereal 79 + cgal_5 80 + curl 81 + dbus 82 + eigen 83 + expat 84 + gcc-unwrapped 85 + glew 86 + glfw 87 + glib 88 + glib-networking 89 + gmp 90 + gstreamer 91 + gst-plugins-base 92 + gst-plugins-bad 93 + gtk3 94 + hicolor-icon-theme 95 + ilmbase 96 + libpng 97 + mesa.osmesa 98 + mpfr 99 + nlopt 100 + opencascade-occt 101 + openvdb_tbb_2021_8 102 + pcre 103 + tbb_2021_8 104 + webkitgtk 105 + wxGTK31' 106 + xorg.libX11 107 + ] ++ lib.optionals withSystemd [ 108 + systemd 109 + ] ++ checkInputs; 110 + 111 + patches = [ 112 + # Fix for webkitgtk linking 113 + ./0001-not-for-upstream-CMakeLists-Link-against-webkit2gtk-.patch 114 + ]; 115 + 116 + doCheck = true; 117 + checkInputs = [ gtest ]; 118 + 119 + separateDebugInfo = true; 120 + 121 + # The build system uses custom logic - defined in 122 + # cmake/modules/FindNLopt.cmake in the package source - for finding the nlopt 123 + # library, which doesn't pick up the package in the nix store. We 124 + # additionally need to set the path via the NLOPT environment variable. 125 + NLOPT = nlopt; 126 + 127 + # Disable compiler warnings that clutter the build log. 128 + # It seems to be a known issue for Eigen: 129 + # http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1221 130 + NIX_CFLAGS_COMPILE = "-Wno-ignored-attributes"; 131 + 132 + # prusa-slicer uses dlopen on `libudev.so` at runtime 133 + NIX_LDFLAGS = lib.optionalString withSystemd "-ludev"; 134 + 135 + # TODO: macOS 136 + prePatch = '' 137 + # Since version 2.5.0 of nlopt we need to link to libnlopt, as libnlopt_cxx 138 + # now seems to be integrated into the main lib. 139 + sed -i 's|nlopt_cxx|nlopt|g' cmake/modules/FindNLopt.cmake 140 + ''; 141 + 142 + cmakeFlags = [ 143 + "-DSLIC3R_STATIC=0" 144 + "-DSLIC3R_FHS=1" 145 + "-DSLIC3R_GTK=3" 146 + 147 + # BambuStudio-specific 148 + "-DBBL_RELEASE_TO_PUBLIC=1" 149 + "-DBBL_INTERNAL_TESTING=0" 150 + "-DDEP_WX_GTK3=ON" 151 + "-DSLIC3R_BUILD_TESTS=0" 152 + "-DCMAKE_CXX_FLAGS=-DBOOST_LOG_DYN_LINK" 153 + ]; 154 + 155 + preFixup = '' 156 + gappsWrapperArgs+=( 157 + --prefix LD_LIBRARY_PATH : "$out/lib" 158 + 159 + # Fixes intermittent crash 160 + # The upstream setup links in glew statically 161 + --prefix LD_PRELOAD : "${glew.out}/lib/libGLEW.so" 162 + ) 163 + ''; 164 + 165 + meta = with lib; { 166 + description = "PC Software for BambuLab's 3D printers"; 167 + homepage = "https://github.com/bambulab/BambuStudio"; 168 + license = licenses.agpl3; 169 + maintainers = with maintainers; [ zhaofengli ]; 170 + mainProgram = "bambu-studio"; 171 + }; 172 + }
+6
pkgs/development/libraries/wxwidgets/wxGTK31.nix
··· 1 1 { lib 2 2 , stdenv 3 3 , fetchFromGitHub 4 + , curl 4 5 , gst_all_1 5 6 , gtk3 6 7 , libGL ··· 14 15 , compat28 ? false 15 16 , compat30 ? true 16 17 , unicode ? true 18 + , withCurl ? false 19 + , withPrivateFonts ? false 17 20 , withEGL ? true 18 21 , withMesa ? !stdenv.isDarwin 19 22 , withWebKit ? stdenv.isDarwin ··· 59 62 libXxf86vm 60 63 xorgproto 61 64 ] 65 + ++ lib.optional withCurl curl 62 66 ++ lib.optional withMesa libGLU 63 67 ++ lib.optional (withWebKit && !stdenv.isDarwin) webkitgtk 64 68 ++ lib.optional (withWebKit && stdenv.isDarwin) WebKit ··· 85 89 ] 86 90 ++ lib.optional (!withEGL) "--disable-glcanvasegl" 87 91 ++ lib.optional unicode "--enable-unicode" 92 + ++ lib.optional withCurl "--enable-webrequest" 93 + ++ lib.optional withPrivateFonts "--enable-privatefonts" 88 94 ++ lib.optional withMesa "--with-opengl" 89 95 ++ lib.optionals stdenv.isDarwin [ 90 96 "--with-osx_cocoa"
+12
pkgs/top-level/all-packages.nix
··· 35476 35476 35477 35477 super-slicer-latest = super-slicer.latest; 35478 35478 35479 + bambu-studio = callPackage ../applications/misc/bambu-studio { 35480 + inherit (gst_all_1) gstreamer gst-plugins-base gst-plugins-bad; 35481 + 35482 + glew = glew-egl; 35483 + 35484 + wxGTK31 = wxGTK31.override { 35485 + withCurl = true; 35486 + withPrivateFonts = true; 35487 + withWebKit = true; 35488 + }; 35489 + }; 35490 + 35479 35491 snapmaker-luban = callPackage ../applications/misc/snapmaker-luban { }; 35480 35492 35481 35493 robustirc-bridge = callPackage ../servers/irc/robustirc-bridge { };