From 5f6e1b8d4f124516b70322208965b36e6b955d92 Mon Sep 17 00:00:00 2001 From: liberodark Date: Tue, 31 Dec 2024 18:28:26 +0100 Subject: [PATCH 1/7] orca-slicer: fix gcc14 (cherry picked from commit aa1203429f56d2e816a77fda34f069705e975f97) --- pkgs/by-name/or/orca-slicer/package.nix | 258 +++++++++++++++--- .../or/orca-slicer/patches/fix-boost.patch | 60 ++++ 2 files changed, 273 insertions(+), 45 deletions(-) create mode 100644 pkgs/by-name/or/orca-slicer/patches/fix-boost.patch diff --git a/pkgs/by-name/or/orca-slicer/package.nix b/pkgs/by-name/or/orca-slicer/package.nix index d6d8c4a93847..73ed55bb1a79 100644 --- a/pkgs/by-name/or/orca-slicer/package.nix +++ b/pkgs/by-name/or/orca-slicer/package.nix @@ -1,52 +1,220 @@ { + stdenv, lib, + binutils, fetchFromGitHub, - bambu-studio, + cmake, + pkg-config, + wrapGAppsHook3, + boost, + cereal, + cgal, + curl, + dbus, + eigen, + expat, + ffmpeg, + gcc-unwrapped, + glew, + glfw, + glib, + glib-networking, + gmp, + gst_all_1, + gtest, + gtk3, + hicolor-icon-theme, + ilmbase, + libpng, + mesa, + mpfr, + nlopt, + opencascade-occt_7_6, + openvdb, + opencv, + pcre, + systemd, + tbb_2021_11, + webkitgtk_4_0, + wxGTK31, + xorg, + withSystemd ? stdenv.hostPlatform.isLinux, }: -bambu-studio.overrideAttrs ( - finalAttrs: previousAttrs: { - version = "2.2.0"; - pname = "orca-slicer"; +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 rec { + pname = "orca-slicer"; + version = "v2.2.0-unstable-2025-01-06"; - src = fetchFromGitHub { - owner = "SoftFever"; - repo = "OrcaSlicer"; - rev = "v${finalAttrs.version}"; - hash = "sha256-h+cHWhrp894KEbb3ic2N4fNTn13WlOSYoMsaof0RvRI="; - }; + src = fetchFromGitHub { + owner = "SoftFever"; + repo = "OrcaSlicer"; + rev = "99a0facfb3a5c9b4e661e536825c08393053cb53"; + hash = "sha256-XWM04Vx65q+Vc+s3YLucS63IhGVw8ODhL2m+47nZKs8="; + }; - patches = [ - # Fix for webkitgtk linking - ./patches/0001-not-for-upstream-CMakeLists-Link-against-webkit2gtk-.patch - ./patches/dont-link-opencv-world-orca.patch + nativeBuildInputs = [ + cmake + pkg-config + wrapGAppsHook3 + wxGTK' + ]; + + buildInputs = + [ + binutils + (boost.override { + enableShared = true; + enableStatic = false; + extraFeatures = [ + "log" + "thread" + "filesystem" + ]; + }) + boost.dev + cereal + cgal + 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 + mesa + mesa.osmesa + mesa.drivers + mpfr + nlopt + opencascade-occt_7_6 + openvdb + pcre + tbb_2021_11 + webkitgtk_4_0 + wxGTK' + xorg.libX11 + opencv + ] + ++ lib.optionals withSystemd [ systemd ] + ++ checkInputs; + + patches = [ + # Fix for webkitgtk linking + ./patches/0001-not-for-upstream-CMakeLists-Link-against-webkit2gtk-.patch + ./patches/dont-link-opencv-world-orca.patch + ./patches/fix-boost.patch + ]; + + doCheck = true; + checkInputs = [ gtest ]; + + separateDebugInfo = true; + + NLOPT = nlopt; + + NIX_CFLAGS_COMPILE = toString [ + "-Wno-ignored-attributes" + "-I${opencv.out}/include/opencv4" + "-Wno-error=template-id-cdtor" + "-Wno-error=incompatible-pointer-types" + "-Wno-template-id-cdtor" + "-Wno-uninitialized" + "-Wno-unused-result" + "-Wno-deprecated-declarations" + "-Wno-use-after-free" + "-Wno-format-overflow" + "-Wno-stringop-overflow" + "-DBOOST_ALLOW_DEPRECATED_HEADERS" + "-DBOOST_MATH_DISABLE_STD_FPCLASSIFY" + "-DBOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS" + "-DBOOST_MATH_DISABLE_FLOAT128" + "-DBOOST_MATH_NO_QUAD_SUPPORT" + "-DBOOST_MATH_MAX_FLOAT128_DIGITS=0" + "-DBOOST_CSTDFLOAT_NO_LIBQUADMATH_SUPPORT" + "-DBOOST_MATH_DISABLE_FLOAT128_BUILTIN_FPCLASSIFY" + ]; + + NIX_LDFLAGS = toString [ + (lib.optionalString withSystemd "-ludev") + "-L${mesa.osmesa}/lib" + "-L${mesa.drivers}/lib" + "-L${boost}/lib" + "-lboost_log" + "-lboost_log_setup" + ]; + + prePatch = '' + sed -i 's|nlopt_cxx|nlopt|g' cmake/modules/FindNLopt.cmake + ''; + + cmakeFlags = [ + "-DSLIC3R_STATIC=0" + "-DSLIC3R_FHS=1" + "-DSLIC3R_GTK=3" + "-DBBL_RELEASE_TO_PUBLIC=1" + "-DBBL_INTERNAL_TESTING=0" + "-DDEP_WX_GTK3=ON" + "-DSLIC3R_BUILD_TESTS=0" + "-DCMAKE_CXX_FLAGS=-DBOOST_LOG_DYN_LINK" + "-DBOOST_LOG_DYN_LINK=1" + "-DBOOST_ALL_DYN_LINK=1" + "-DBOOST_LOG_NO_LIB=OFF" + "-DCMAKE_CXX_FLAGS=-DGL_SILENCE_DEPRECATION" + "-DCMAKE_EXE_LINKER_FLAGS=-Wl,--no-as-needed" + "-DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath,${mesa.drivers}/lib -Wl,-rpath,${mesa.osmesa}/lib" + ]; + + preFixup = '' + gappsWrapperArgs+=( + --prefix LD_LIBRARY_PATH : "$out/lib:${ + lib.makeLibraryPath [ + mesa.drivers + mesa.osmesa + glew + ] + }" + --prefix LIBGL_DRIVERS_PATH : "${mesa.drivers}/lib/dri" + --set WEBKIT_DISABLE_COMPOSITING_MODE 1 + ) + ''; + + meta = { + description = "G-code generator for 3D printers (Bambu, Prusa, Voron, VzBot, RatRig, Creality, etc.)"; + homepage = "https://github.com/SoftFever/OrcaSlicer"; + changelog = "https://github.com/SoftFever/OrcaSlicer/releases/tag/v${version}"; + license = lib.licenses.agpl3Only; + maintainers = with lib.maintainers; [ + zhaofengli + ovlach + pinpox + liberodark ]; - - preFixup = '' - gappsWrapperArgs+=( - # Fixes blackscreen dialogs - --set WEBKIT_DISABLE_COMPOSITING_MODE 1 - ) - ''; - - cmakeFlags = lib.remove "-DFLATPAK=1" previousAttrs.cmakeFlags or [ ]; - - # needed to prevent collisions between the LICENSE.txt files of - # bambu-studio and orca-slicer. - postInstall = '' - mv $out/LICENSE.txt $out/share/OrcaSlicer/LICENSE.txt - ''; - - meta = with lib; { - description = "G-code generator for 3D printers (Bambu, Prusa, Voron, VzBot, RatRig, Creality, etc.)"; - homepage = "https://github.com/SoftFever/OrcaSlicer"; - license = licenses.agpl3Only; - maintainers = with maintainers; [ - zhaofengli - ovlach - pinpox - ]; - mainProgram = "orca-slicer"; - platforms = platforms.linux; - }; - } -) + mainProgram = "orca-slicer"; + platforms = lib.platforms.linux; + }; +} diff --git a/pkgs/by-name/or/orca-slicer/patches/fix-boost.patch b/pkgs/by-name/or/orca-slicer/patches/fix-boost.patch new file mode 100644 index 000000000000..aaced2fe79e5 --- /dev/null +++ b/pkgs/by-name/or/orca-slicer/patches/fix-boost.patch @@ -0,0 +1,60 @@ +diff --git a/src/libslic3r/PrintBase.cpp b/src/libslic3r/PrintBase.cpp +index 25b282c7b..81ee858c2 100644 +--- a/src/libslic3r/PrintBase.cpp ++++ b/src/libslic3r/PrintBase.cpp +@@ -79,7 +79,7 @@ std::string PrintBase::output_filename(const std::string &format, const std::str + cfg.opt_string("input_filename_base") + default_ext : + this->placeholder_parser().process(format, 0, &cfg); + if (filename.extension().empty()) +- filename = boost::filesystem::change_extension(filename, default_ext); ++ filename.replace_extension(default_ext); + return filename.string(); + } catch (std::runtime_error &err) { + throw Slic3r::PlaceholderParserError(L("Failed processing of the filename_format template.") + "\n" + err.what()); +diff --git a/src/slic3r/GUI/AuxiliaryDataViewModel.cpp b/src/slic3r/GUI/AuxiliaryDataViewModel.cpp +index 50368b854..cad5cf545 100644 +--- a/src/slic3r/GUI/AuxiliaryDataViewModel.cpp ++++ b/src/slic3r/GUI/AuxiliaryDataViewModel.cpp +@@ -337,7 +337,7 @@ wxDataViewItemArray AuxiliaryModel::ImportFile(AuxiliaryModelNode* sel, wxArrayS + dir_path += "\\" + src_bfs_path.filename().generic_wstring(); + + boost::system::error_code ec; +- if (!fs::copy_file(src_bfs_path, fs::path(dir_path.ToStdWstring()), fs::copy_option::overwrite_if_exists, ec)) ++ if (!fs::copy_file(src_bfs_path, fs::path(dir_path.ToStdWstring()), fs::copy_options::overwrite_existing, ec)) + continue; + + // Update model data +diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp +index f3782be14..e12f0c321 100644 +--- a/src/slic3r/GUI/Plater.cpp ++++ b/src/slic3r/GUI/Plater.cpp +@@ -10265,7 +10265,7 @@ bool Plater::preview_zip_archive(const boost::filesystem::path& archive_path) + std::replace(name.begin(), name.end(), '\\', '/'); + // rename if file exists + std::string filename = path.filename().string(); +- std::string extension = boost::filesystem::extension(path); ++ std::string extension = path.extension().string(); + std::string just_filename = filename.substr(0, filename.size() - extension.size()); + std::string final_filename = just_filename; + +diff --git a/src/slic3r/GUI/RemovableDriveManager.cpp b/src/slic3r/GUI/RemovableDriveManager.cpp +index a26e13448..83ec4695c 100644 +--- a/src/slic3r/GUI/RemovableDriveManager.cpp ++++ b/src/slic3r/GUI/RemovableDriveManager.cpp +@@ -22,7 +22,6 @@ + #include + #include + #include +-#include + #include + #endif + +@@ -202,7 +201,7 @@ namespace search_for_drives_internal + stat(path.c_str(), &buf); + uid_t uid = buf.st_uid; + if (getuid() == uid) +- out.emplace_back(DriveData{ boost::filesystem::basename(boost::filesystem::path(path)), path }); ++ out.emplace_back(DriveData{ boost::filesystem::path(path).stem().string(), path }); + } + } + } From eae6c6cd8212e9c6589a5e11e8f002badfdd60f5 Mon Sep 17 00:00:00 2001 From: liberodark Date: Wed, 22 Jan 2025 12:48:10 +0100 Subject: [PATCH 2/7] orca-slicer v2.2.0-unstable-2025-01-06 -> v2.2.0-unstable-2025-01-23 (cherry picked from commit 13eb9ce5b5c051be0fa1d0ff073ea8db6dc14d54) --- pkgs/by-name/or/orca-slicer/package.nix | 15 +++-- .../or/orca-slicer/patches/fix-boost.patch | 60 ------------------- 2 files changed, 7 insertions(+), 68 deletions(-) delete mode 100644 pkgs/by-name/or/orca-slicer/patches/fix-boost.patch diff --git a/pkgs/by-name/or/orca-slicer/package.nix b/pkgs/by-name/or/orca-slicer/package.nix index 73ed55bb1a79..faa025a797f0 100644 --- a/pkgs/by-name/or/orca-slicer/package.nix +++ b/pkgs/by-name/or/orca-slicer/package.nix @@ -6,7 +6,7 @@ cmake, pkg-config, wrapGAppsHook3, - boost, + boost186, cereal, cgal, curl, @@ -56,13 +56,13 @@ let in stdenv.mkDerivation rec { pname = "orca-slicer"; - version = "v2.2.0-unstable-2025-01-06"; + version = "v2.2.0-unstable-2025-01-23"; src = fetchFromGitHub { owner = "SoftFever"; repo = "OrcaSlicer"; - rev = "99a0facfb3a5c9b4e661e536825c08393053cb53"; - hash = "sha256-XWM04Vx65q+Vc+s3YLucS63IhGVw8ODhL2m+47nZKs8="; + rev = "1b1288c4353afca44edee323061bdd5c87fcafb9"; + hash = "sha256-IPdKusP2cB5jgr6JjQVu8ZjJ2kiG6mfmfZtDVSlAFNg="; }; nativeBuildInputs = [ @@ -75,7 +75,7 @@ stdenv.mkDerivation rec { buildInputs = [ binutils - (boost.override { + (boost186.override { enableShared = true; enableStatic = false; extraFeatures = [ @@ -84,7 +84,7 @@ stdenv.mkDerivation rec { "filesystem" ]; }) - boost.dev + boost186.dev cereal cgal curl @@ -127,7 +127,6 @@ stdenv.mkDerivation rec { # Fix for webkitgtk linking ./patches/0001-not-for-upstream-CMakeLists-Link-against-webkit2gtk-.patch ./patches/dont-link-opencv-world-orca.patch - ./patches/fix-boost.patch ]; doCheck = true; @@ -163,7 +162,7 @@ stdenv.mkDerivation rec { (lib.optionalString withSystemd "-ludev") "-L${mesa.osmesa}/lib" "-L${mesa.drivers}/lib" - "-L${boost}/lib" + "-L${boost186}/lib" "-lboost_log" "-lboost_log_setup" ]; diff --git a/pkgs/by-name/or/orca-slicer/patches/fix-boost.patch b/pkgs/by-name/or/orca-slicer/patches/fix-boost.patch deleted file mode 100644 index aaced2fe79e5..000000000000 --- a/pkgs/by-name/or/orca-slicer/patches/fix-boost.patch +++ /dev/null @@ -1,60 +0,0 @@ -diff --git a/src/libslic3r/PrintBase.cpp b/src/libslic3r/PrintBase.cpp -index 25b282c7b..81ee858c2 100644 ---- a/src/libslic3r/PrintBase.cpp -+++ b/src/libslic3r/PrintBase.cpp -@@ -79,7 +79,7 @@ std::string PrintBase::output_filename(const std::string &format, const std::str - cfg.opt_string("input_filename_base") + default_ext : - this->placeholder_parser().process(format, 0, &cfg); - if (filename.extension().empty()) -- filename = boost::filesystem::change_extension(filename, default_ext); -+ filename.replace_extension(default_ext); - return filename.string(); - } catch (std::runtime_error &err) { - throw Slic3r::PlaceholderParserError(L("Failed processing of the filename_format template.") + "\n" + err.what()); -diff --git a/src/slic3r/GUI/AuxiliaryDataViewModel.cpp b/src/slic3r/GUI/AuxiliaryDataViewModel.cpp -index 50368b854..cad5cf545 100644 ---- a/src/slic3r/GUI/AuxiliaryDataViewModel.cpp -+++ b/src/slic3r/GUI/AuxiliaryDataViewModel.cpp -@@ -337,7 +337,7 @@ wxDataViewItemArray AuxiliaryModel::ImportFile(AuxiliaryModelNode* sel, wxArrayS - dir_path += "\\" + src_bfs_path.filename().generic_wstring(); - - boost::system::error_code ec; -- if (!fs::copy_file(src_bfs_path, fs::path(dir_path.ToStdWstring()), fs::copy_option::overwrite_if_exists, ec)) -+ if (!fs::copy_file(src_bfs_path, fs::path(dir_path.ToStdWstring()), fs::copy_options::overwrite_existing, ec)) - continue; - - // Update model data -diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp -index f3782be14..e12f0c321 100644 ---- a/src/slic3r/GUI/Plater.cpp -+++ b/src/slic3r/GUI/Plater.cpp -@@ -10265,7 +10265,7 @@ bool Plater::preview_zip_archive(const boost::filesystem::path& archive_path) - std::replace(name.begin(), name.end(), '\\', '/'); - // rename if file exists - std::string filename = path.filename().string(); -- std::string extension = boost::filesystem::extension(path); -+ std::string extension = path.extension().string(); - std::string just_filename = filename.substr(0, filename.size() - extension.size()); - std::string final_filename = just_filename; - -diff --git a/src/slic3r/GUI/RemovableDriveManager.cpp b/src/slic3r/GUI/RemovableDriveManager.cpp -index a26e13448..83ec4695c 100644 ---- a/src/slic3r/GUI/RemovableDriveManager.cpp -+++ b/src/slic3r/GUI/RemovableDriveManager.cpp -@@ -22,7 +22,6 @@ - #include - #include - #include --#include - #include - #endif - -@@ -202,7 +201,7 @@ namespace search_for_drives_internal - stat(path.c_str(), &buf); - uid_t uid = buf.st_uid; - if (getuid() == uid) -- out.emplace_back(DriveData{ boost::filesystem::basename(boost::filesystem::path(path)), path }); -+ out.emplace_back(DriveData{ boost::filesystem::path(path).stem().string(), path }); - } - } - } From 79e878bc15b32b69982954da8c5873098b0c8251 Mon Sep 17 00:00:00 2001 From: shelvacu <1731537+shelvacu@users.noreply.github.com> Date: Wed, 5 Mar 2025 16:15:18 -0800 Subject: [PATCH 3/7] orca-slicer: Don't show update dialog by default (#378396) * orca-slicer: Don't show update dialog by default This pulls in https://github.com/SoftFever/OrcaSlicer/pull/7650 (which I wrote). The idea is, for the binaries that orca-slicer distributes from its github page, it might make sense to remind about updates because the user wouldn't otherwise know they need to take action to install new versions. But when orca-slicer is run using nix, we can safely assume the user will update using nix and they don't need the nag dialog. * Update pkgs/by-name/or/orca-slicer/package.nix --------- Co-authored-by: Shelvacu Co-authored-by: Sandro (cherry picked from commit 274ea258ee704724977160757ac4228ecb6eb31f) --- pkgs/by-name/or/orca-slicer/package.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/by-name/or/orca-slicer/package.nix b/pkgs/by-name/or/orca-slicer/package.nix index faa025a797f0..96b996e4f38c 100644 --- a/pkgs/by-name/or/orca-slicer/package.nix +++ b/pkgs/by-name/or/orca-slicer/package.nix @@ -3,6 +3,7 @@ lib, binutils, fetchFromGitHub, + fetchpatch, cmake, pkg-config, wrapGAppsHook3, @@ -126,7 +127,15 @@ stdenv.mkDerivation rec { patches = [ # Fix for webkitgtk linking ./patches/0001-not-for-upstream-CMakeLists-Link-against-webkit2gtk-.patch + # Link opencv_core and opencv_imgproc instead of opencv_world ./patches/dont-link-opencv-world-orca.patch + # The changeset from https://github.com/SoftFever/OrcaSlicer/pull/7650, can be removed when that PR gets merged + # Allows disabling the update nag screen + (fetchpatch { + name = "pr-7650-configurable-update-check.patch"; + url = "https://github.com/SoftFever/OrcaSlicer/commit/d10a06ae11089cd1f63705e87f558e9392f7a167.patch"; + hash = "sha256-t4own5AwPsLYBsGA15id5IH1ngM0NSuWdFsrxMRXmTk="; + }) ]; doCheck = true; @@ -186,6 +195,7 @@ stdenv.mkDerivation rec { "-DCMAKE_CXX_FLAGS=-DGL_SILENCE_DEPRECATION" "-DCMAKE_EXE_LINKER_FLAGS=-Wl,--no-as-needed" "-DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath,${mesa.drivers}/lib -Wl,-rpath,${mesa.osmesa}/lib" + "-DORCA_VERSION_CHECK_DEFAULT=OFF" ]; preFixup = '' From 6b4c20a9fcd2aaebd4b2b3dfa94dded69423ca81 Mon Sep 17 00:00:00 2001 From: K900 Date: Thu, 6 Mar 2025 09:09:39 +0300 Subject: [PATCH 4/7] orca-slicer: get rid of osmesa dependency, clean up other mesa-related things It's not actually necessary. (cherry picked from commit d3631853bd708955edfe71dca94171efb5749711) --- pkgs/by-name/or/orca-slicer/package.nix | 12 ++---------- pkgs/by-name/or/orca-slicer/patches/no-osmesa.patch | 13 +++++++++++++ 2 files changed, 15 insertions(+), 10 deletions(-) create mode 100644 pkgs/by-name/or/orca-slicer/patches/no-osmesa.patch diff --git a/pkgs/by-name/or/orca-slicer/package.nix b/pkgs/by-name/or/orca-slicer/package.nix index 96b996e4f38c..89e03d1d6997 100644 --- a/pkgs/by-name/or/orca-slicer/package.nix +++ b/pkgs/by-name/or/orca-slicer/package.nix @@ -27,7 +27,6 @@ hicolor-icon-theme, ilmbase, libpng, - mesa, mpfr, nlopt, opencascade-occt_7_6, @@ -107,9 +106,6 @@ stdenv.mkDerivation rec { hicolor-icon-theme ilmbase libpng - mesa - mesa.osmesa - mesa.drivers mpfr nlopt opencascade-occt_7_6 @@ -129,6 +125,8 @@ stdenv.mkDerivation rec { ./patches/0001-not-for-upstream-CMakeLists-Link-against-webkit2gtk-.patch # Link opencv_core and opencv_imgproc instead of opencv_world ./patches/dont-link-opencv-world-orca.patch + # Don't link osmesa + ./patches/no-osmesa.patch # The changeset from https://github.com/SoftFever/OrcaSlicer/pull/7650, can be removed when that PR gets merged # Allows disabling the update nag screen (fetchpatch { @@ -169,8 +167,6 @@ stdenv.mkDerivation rec { NIX_LDFLAGS = toString [ (lib.optionalString withSystemd "-ludev") - "-L${mesa.osmesa}/lib" - "-L${mesa.drivers}/lib" "-L${boost186}/lib" "-lboost_log" "-lboost_log_setup" @@ -194,7 +190,6 @@ stdenv.mkDerivation rec { "-DBOOST_LOG_NO_LIB=OFF" "-DCMAKE_CXX_FLAGS=-DGL_SILENCE_DEPRECATION" "-DCMAKE_EXE_LINKER_FLAGS=-Wl,--no-as-needed" - "-DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath,${mesa.drivers}/lib -Wl,-rpath,${mesa.osmesa}/lib" "-DORCA_VERSION_CHECK_DEFAULT=OFF" ]; @@ -202,12 +197,9 @@ stdenv.mkDerivation rec { gappsWrapperArgs+=( --prefix LD_LIBRARY_PATH : "$out/lib:${ lib.makeLibraryPath [ - mesa.drivers - mesa.osmesa glew ] }" - --prefix LIBGL_DRIVERS_PATH : "${mesa.drivers}/lib/dri" --set WEBKIT_DISABLE_COMPOSITING_MODE 1 ) ''; diff --git a/pkgs/by-name/or/orca-slicer/patches/no-osmesa.patch b/pkgs/by-name/or/orca-slicer/patches/no-osmesa.patch new file mode 100644 index 000000000000..09298b3e55b6 --- /dev/null +++ b/pkgs/by-name/or/orca-slicer/patches/no-osmesa.patch @@ -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} From fe3104ecaf1022e89e77214a7365f3bc11bf0dfe Mon Sep 17 00:00:00 2001 From: liberodark Date: Wed, 26 Feb 2025 17:24:43 +0100 Subject: [PATCH 5/7] orca-slicer: 2.2.0-unstable-2025-01-23 -> 2.3.0-rc (cherry picked from commit 2eb815ad3ed8a2ed96bcea765deae9fa41712821) --- pkgs/by-name/or/orca-slicer/package.nix | 43 ++++++++++--------- .../patches/dont-link-opencv-world-orca.patch | 6 +-- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/pkgs/by-name/or/orca-slicer/package.nix b/pkgs/by-name/or/orca-slicer/package.nix index 89e03d1d6997..337f314302b1 100644 --- a/pkgs/by-name/or/orca-slicer/package.nix +++ b/pkgs/by-name/or/orca-slicer/package.nix @@ -38,6 +38,7 @@ webkitgtk_4_0, wxGTK31, xorg, + libnoise, withSystemd ? stdenv.hostPlatform.isLinux, }: let @@ -54,15 +55,15 @@ let ]; }); in -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "orca-slicer"; - version = "v2.2.0-unstable-2025-01-23"; + version = "v2.3.0-rc"; src = fetchFromGitHub { owner = "SoftFever"; repo = "OrcaSlicer"; - rev = "1b1288c4353afca44edee323061bdd5c87fcafb9"; - hash = "sha256-IPdKusP2cB5jgr6JjQVu8ZjJ2kiG6mfmfZtDVSlAFNg="; + tag = finalAttrs.version; + hash = "sha256-obQUn5vG+6g8PYK9Xatt3QiBPNWskoTs2Byi+1xabBk="; }; nativeBuildInputs = [ @@ -116,9 +117,10 @@ stdenv.mkDerivation rec { wxGTK' xorg.libX11 opencv + libnoise ] ++ lib.optionals withSystemd [ systemd ] - ++ checkInputs; + ++ finalAttrs.checkInputs; patches = [ # Fix for webkitgtk linking @@ -174,23 +176,22 @@ stdenv.mkDerivation rec { prePatch = '' sed -i 's|nlopt_cxx|nlopt|g' cmake/modules/FindNLopt.cmake + sed -i 's|"libnoise/noise.h"|"noise/noise.h"|' src/libslic3r/PerimeterGenerator.cpp ''; cmakeFlags = [ - "-DSLIC3R_STATIC=0" - "-DSLIC3R_FHS=1" - "-DSLIC3R_GTK=3" - "-DBBL_RELEASE_TO_PUBLIC=1" - "-DBBL_INTERNAL_TESTING=0" - "-DDEP_WX_GTK3=ON" - "-DSLIC3R_BUILD_TESTS=0" - "-DCMAKE_CXX_FLAGS=-DBOOST_LOG_DYN_LINK" - "-DBOOST_LOG_DYN_LINK=1" - "-DBOOST_ALL_DYN_LINK=1" - "-DBOOST_LOG_NO_LIB=OFF" - "-DCMAKE_CXX_FLAGS=-DGL_SILENCE_DEPRECATION" - "-DCMAKE_EXE_LINKER_FLAGS=-Wl,--no-as-needed" - "-DORCA_VERSION_CHECK_DEFAULT=OFF" + (lib.cmakeBool "SLIC3R_STATIC" false) + (lib.cmakeBool "SLIC3R_FHS" true) + (lib.cmakeFeature "SLIC3R_GTK" "3") + (lib.cmakeBool "BBL_RELEASE_TO_PUBLIC" true) + (lib.cmakeBool "BBL_INTERNAL_TESTING" false) + (lib.cmakeBool "SLIC3R_BUILD_TESTS" false) + (lib.cmakeFeature "CMAKE_CXX_FLAGS" "-DGL_SILENCE_DEPRECATION") + (lib.cmakeFeature "CMAKE_EXE_LINKER_FLAGS" "-Wl,--no-as-needed") + (lib.cmakeBool "ORCA_VERSION_CHECK_DEFAULT" false) + (lib.cmakeFeature "LIBNOISE_INCLUDE_DIR" "${libnoise}/include/noise") + (lib.cmakeFeature "LIBNOISE_LIBRARY" "${libnoise}/lib/libnoise-static.a") + "-Wno-dev" ]; preFixup = '' @@ -207,7 +208,7 @@ stdenv.mkDerivation rec { meta = { description = "G-code generator for 3D printers (Bambu, Prusa, Voron, VzBot, RatRig, Creality, etc.)"; homepage = "https://github.com/SoftFever/OrcaSlicer"; - changelog = "https://github.com/SoftFever/OrcaSlicer/releases/tag/v${version}"; + changelog = "https://github.com/SoftFever/OrcaSlicer/releases/tag/v${finalAttrs.version}"; license = lib.licenses.agpl3Only; maintainers = with lib.maintainers; [ zhaofengli @@ -218,4 +219,4 @@ stdenv.mkDerivation rec { mainProgram = "orca-slicer"; platforms = lib.platforms.linux; }; -} +}) diff --git a/pkgs/by-name/or/orca-slicer/patches/dont-link-opencv-world-orca.patch b/pkgs/by-name/or/orca-slicer/patches/dont-link-opencv-world-orca.patch index f558b3099ac3..426fd0298d93 100644 --- a/pkgs/by-name/or/orca-slicer/patches/dont-link-opencv-world-orca.patch +++ b/pkgs/by-name/or/orca-slicer/patches/dont-link-opencv-world-orca.patch @@ -1,14 +1,14 @@ diff --git a/src/libslic3r/CMakeLists.txt b/src/libslic3r/CMakeLists.txt -index 38a1b2499..00c9060b3 100644 +index 64e0a9e87..e14f29488 100644 --- a/src/libslic3r/CMakeLists.txt +++ b/src/libslic3r/CMakeLists.txt -@@ -573,7 +573,8 @@ target_link_libraries(libslic3r +@@ -576,7 +576,8 @@ target_link_libraries(libslic3r mcut JPEG::JPEG qoi - opencv_world + opencv_core + opencv_imgproc + noise::noise ) - if(NOT WIN32) From 7f9fdd719cf315b204b2ed88b86a69434e263583 Mon Sep 17 00:00:00 2001 From: Eduwardo Horibe Date: Thu, 20 Mar 2025 21:39:22 -0300 Subject: [PATCH 6/7] orca-slicer: v2.3.0-rc -> v2.3.0 https://github.com/SoftFever/OrcaSlicer/releases/tag/v2.3.0 (cherry picked from commit 42b6fd19a71186e66532f7588c28fd3c48187f64) --- pkgs/by-name/or/orca-slicer/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/or/orca-slicer/package.nix b/pkgs/by-name/or/orca-slicer/package.nix index 337f314302b1..223064576721 100644 --- a/pkgs/by-name/or/orca-slicer/package.nix +++ b/pkgs/by-name/or/orca-slicer/package.nix @@ -57,13 +57,13 @@ let in stdenv.mkDerivation (finalAttrs: { pname = "orca-slicer"; - version = "v2.3.0-rc"; + version = "v2.3.0"; src = fetchFromGitHub { owner = "SoftFever"; repo = "OrcaSlicer"; tag = finalAttrs.version; - hash = "sha256-obQUn5vG+6g8PYK9Xatt3QiBPNWskoTs2Byi+1xabBk="; + hash = "sha256-MEa57jFBJkqwoAkqI7wXOn1X1zxgLQt3SNeanfD88kU="; }; nativeBuildInputs = [ From daa4bc147bafa186527df90c88bbf382311de89f Mon Sep 17 00:00:00 2001 From: Eduwardo Horibe Date: Mon, 24 Mar 2025 21:46:35 -0300 Subject: [PATCH 7/7] orca-slicer: fixing build on GCC < 14 (cherry picked from commit b86e92c05d6331bd40d6fe6bbae59af965acc68a) --- pkgs/by-name/or/orca-slicer/package.nix | 47 ++++++++++++++----------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/pkgs/by-name/or/orca-slicer/package.nix b/pkgs/by-name/or/orca-slicer/package.nix index 223064576721..ac79481e65e6 100644 --- a/pkgs/by-name/or/orca-slicer/package.nix +++ b/pkgs/by-name/or/orca-slicer/package.nix @@ -145,27 +145,32 @@ stdenv.mkDerivation (finalAttrs: { NLOPT = nlopt; - NIX_CFLAGS_COMPILE = toString [ - "-Wno-ignored-attributes" - "-I${opencv.out}/include/opencv4" - "-Wno-error=template-id-cdtor" - "-Wno-error=incompatible-pointer-types" - "-Wno-template-id-cdtor" - "-Wno-uninitialized" - "-Wno-unused-result" - "-Wno-deprecated-declarations" - "-Wno-use-after-free" - "-Wno-format-overflow" - "-Wno-stringop-overflow" - "-DBOOST_ALLOW_DEPRECATED_HEADERS" - "-DBOOST_MATH_DISABLE_STD_FPCLASSIFY" - "-DBOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS" - "-DBOOST_MATH_DISABLE_FLOAT128" - "-DBOOST_MATH_NO_QUAD_SUPPORT" - "-DBOOST_MATH_MAX_FLOAT128_DIGITS=0" - "-DBOOST_CSTDFLOAT_NO_LIBQUADMATH_SUPPORT" - "-DBOOST_MATH_DISABLE_FLOAT128_BUILTIN_FPCLASSIFY" - ]; + NIX_CFLAGS_COMPILE = toString ( + [ + "-Wno-ignored-attributes" + "-I${opencv.out}/include/opencv4" + "-Wno-error=incompatible-pointer-types" + "-Wno-template-id-cdtor" + "-Wno-uninitialized" + "-Wno-unused-result" + "-Wno-deprecated-declarations" + "-Wno-use-after-free" + "-Wno-format-overflow" + "-Wno-stringop-overflow" + "-DBOOST_ALLOW_DEPRECATED_HEADERS" + "-DBOOST_MATH_DISABLE_STD_FPCLASSIFY" + "-DBOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS" + "-DBOOST_MATH_DISABLE_FLOAT128" + "-DBOOST_MATH_NO_QUAD_SUPPORT" + "-DBOOST_MATH_MAX_FLOAT128_DIGITS=0" + "-DBOOST_CSTDFLOAT_NO_LIBQUADMATH_SUPPORT" + "-DBOOST_MATH_DISABLE_FLOAT128_BUILTIN_FPCLASSIFY" + ] + # Making it compatible with GCC 14+, see https://github.com/SoftFever/OrcaSlicer/pull/7710 + ++ lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "14") [ + "-Wno-error=template-id-cdtor" + ] + ); NIX_LDFLAGS = toString [ (lib.optionalString withSystemd "-ludev")