push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,197 @@
{
stdenv,
lib,
binutils,
fetchFromGitHub,
cmake,
ninja,
pkg-config,
wrapGAppsHook3,
boost183,
cereal,
cgal_5,
curl,
dbus,
eigen,
expat,
ffmpeg,
gcc-unwrapped,
glew,
glfw,
glib,
glib-networking,
gmp,
gst_all_1,
gtest,
gtk3,
hicolor-icon-theme,
ilmbase,
libpng,
mpfr,
nlopt,
opencascade-occt_7_6,
openvdb,
opencv,
pcre,
systemd,
onetbb,
webkitgtk_4_1,
wxGTK31,
xorg,
withSystemd ? stdenv.hostPlatform.isLinux,
}:
let
wxGTK' =
(wxGTK31.override {
withCurl = true;
withPrivateFonts = true;
withWebKit = true;
}).overrideAttrs
(old: {
configureFlags = old.configureFlags ++ [
# Disable noisy debug dialogs
"--enable-debug=no"
];
});
in
stdenv.mkDerivation (finalAttrs: {
pname = "bambu-studio";
version = "02.02.02.56";
src = fetchFromGitHub {
owner = "bambulab";
repo = "BambuStudio";
tag = "v${finalAttrs.version}";
hash = "sha256-vg+sEIztFBfzROl2surRd4l/afZ+tGMtG65m3kDIPAY=";
};
nativeBuildInputs = [
cmake
ninja
pkg-config
wrapGAppsHook3
];
buildInputs = [
binutils
boost183
cereal
cgal_5
curl
dbus
eigen
expat
ffmpeg
gcc-unwrapped
glew
glfw
glib
glib-networking
gmp
gst_all_1.gstreamer
gst_all_1.gst-plugins-base
gst_all_1.gst-plugins-bad
gst_all_1.gst-plugins-good
gtk3
hicolor-icon-theme
ilmbase
libpng
mpfr
nlopt
opencascade-occt_7_6
openvdb
pcre
onetbb
webkitgtk_4_1
wxGTK'
xorg.libX11
opencv
]
++ lib.optionals withSystemd [ systemd ]
++ finalAttrs.checkInputs;
patches = [
# Fix for webkitgtk linking
./patches/0001-not-for-upstream-CMakeLists-Link-against-webkit2gtk-.patch
# Fix an issue with
./patches/dont-link-opencv-world-bambu.patch
# Don't link osmesa
./patches/no-osmesa.patch
];
doCheck = true;
checkInputs = [ gtest ];
separateDebugInfo = true;
# The build system uses custom logic - defined in
# cmake/modules/FindNLopt.cmake in the package source - for finding the nlopt
# library, which doesn't pick up the package in the nix store. We
# additionally need to set the path via the NLOPT environment variable.
NLOPT = nlopt;
NIX_CFLAGS_COMPILE = toString [
"-DBOOST_TIMER_ENABLE_DEPRECATED"
# Disable compiler warnings that clutter the build log.
# It seems to be a known issue for Eigen:
# http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1221
"-Wno-ignored-attributes"
"-I${opencv}/include/opencv4"
];
# prusa-slicer uses dlopen on `libudev.so` at runtime
NIX_LDFLAGS = lib.optionalString withSystemd "-ludev" + " -L${opencv}/lib -lopencv_imgcodecs";
# TODO: macOS
prePatch = ''
# Since version 2.5.0 of nlopt we need to link to libnlopt, as libnlopt_cxx
# now seems to be integrated into the main lib.
sed -i 's|nlopt_cxx|nlopt|g' cmake/modules/FindNLopt.cmake
'';
cmakeFlags = [
"-DSLIC3R_STATIC=0"
"-DSLIC3R_FHS=1"
"-DSLIC3R_GTK=3"
# Skips installing ffmpeg, since we BYO.
"-DFLATPAK=1"
# BambuStudio-specific
"-DBBL_RELEASE_TO_PUBLIC=1"
"-DBBL_INTERNAL_TESTING=0"
"-DDEP_WX_GTK3=ON"
"-DSLIC3R_BUILD_TESTS=0"
"-DCMAKE_CXX_FLAGS=-DBOOST_LOG_DYN_LINK"
];
preFixup = ''
gappsWrapperArgs+=(
--prefix LD_LIBRARY_PATH : "$out/lib"
# Fixes intermittent crash
# The upstream setup links in glew statically
--prefix LD_PRELOAD : "${glew.out}/lib/libGLEW.so"
)
'';
# needed to prevent collisions between the LICENSE.txt files of
# bambu-studio and orca-slicer.
postInstall = ''
mv $out/LICENSE.txt $out/share/BambuStudio/LICENSE.txt
mv $out/README.md $out/share/BambuStudio/README.md
'';
meta = {
description = "PC Software for BambuLab's 3D printers";
homepage = "https://github.com/bambulab/BambuStudio";
changelog = "https://github.com/bambulab/BambuStudio/releases/tag/v${finalAttrs.version}";
license = lib.licenses.agpl3Plus;
maintainers = with lib.maintainers; [
zhaofengli
dsluijk
];
mainProgram = "bambu-studio";
platforms = lib.platforms.linux;
};
})

View File

@@ -0,0 +1,34 @@
From 7eed499898226222a949a792e0400ec10db4a1c9 Mon Sep 17 00:00:00 2001
From: Zhaofeng Li <hello@zhaofeng.li>
Date: Tue, 22 Nov 2022 13:00:39 -0700
Subject: [PATCH] [not for upstream] CMakeLists: Link against webkit2gtk in
libslic3r_gui
WebView.cpp uses symbols from webkitgtk directly. Upstream setup
links wxGTK statically so webkitgtk is already pulled in.
> /nix/store/039g378vc3pc3dvi9dzdlrd0i4q93qwf-binutils-2.39/bin/ld: slic3r/liblibslic3r_gui.a(WebView.cpp.o): undefined reference to symbol 'webkit_web_view_run_javascript_finish'
> /nix/store/039g378vc3pc3dvi9dzdlrd0i4q93qwf-binutils-2.39/bin/ld: /nix/store/8yvy428jy2nwq4dhmrcs7gj5r27a2pv6-webkitgtk-2.38.2+abi=4.0/lib/libwebkit2gtk-4.0.so.37: error adding symbols: DSO missing from command line
---
src/CMakeLists.txt | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 9c5cb96..e92a0e3 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -175,6 +175,11 @@ if (WIN32)
target_link_libraries(BambuStudio_app_gui PRIVATE boost_headeronly)
endif ()
+# We link against webkit2gtk symbols in src/slic3r/GUI/Widgets/WebView.cpp
+if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ target_link_libraries(libslic3r_gui "-lwebkit2gtk-4.1")
+endif ()
+
# Link the resources dir to where Slic3r GUI expects it
set(output_dlls_Release "")
set(output_dlls_Debug "")
--
2.38.1

View File

@@ -0,0 +1,14 @@
diff --git a/src/libslic3r/CMakeLists.txt b/src/libslic3r/CMakeLists.txt
index 2cdc525..44e6602 100644
--- a/src/libslic3r/CMakeLists.txt
+++ b/src/libslic3r/CMakeLists.txt
@@ -533,7 +533,8 @@ target_link_libraries(libslic3r
${OCCT_LIBS}
Clipper2
mcut
- opencv_world
+ opencv_core
+ opencv_imgproc
)
if(NOT WIN32)

View File

@@ -0,0 +1,13 @@
diff --git a/src/slic3r/CMakeLists.txt b/src/slic3r/CMakeLists.txt
index e695acd48..174e233e6 100644
--- a/src/slic3r/CMakeLists.txt
+++ b/src/slic3r/CMakeLists.txt
@@ -587,7 +587,7 @@ 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)
+ target_link_libraries(libslic3r_gui ${DBUS_LIBRARIES})
target_link_libraries(libslic3r_gui
OpenGL::EGL
${WAYLAND_SERVER_LIBRARIES}