[Backport release-24.11] orca-slicer: v2.3.0-rc -> v2.3.0 (#392957)

This commit is contained in:
Gaétan Lepage
2025-04-08 10:07:24 +02:00
committed by GitHub
3 changed files with 236 additions and 48 deletions

View File

@@ -1,52 +1,227 @@
{
stdenv,
lib,
binutils,
fetchFromGitHub,
bambu-studio,
fetchpatch,
cmake,
pkg-config,
wrapGAppsHook3,
boost186,
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,
mpfr,
nlopt,
opencascade-occt_7_6,
openvdb,
opencv,
pcre,
systemd,
tbb_2021_11,
webkitgtk_4_0,
wxGTK31,
xorg,
libnoise,
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 (finalAttrs: {
pname = "orca-slicer";
version = "v2.3.0";
src = fetchFromGitHub {
owner = "SoftFever";
repo = "OrcaSlicer";
rev = "v${finalAttrs.version}";
hash = "sha256-h+cHWhrp894KEbb3ic2N4fNTn13WlOSYoMsaof0RvRI=";
};
src = fetchFromGitHub {
owner = "SoftFever";
repo = "OrcaSlicer";
tag = finalAttrs.version;
hash = "sha256-MEa57jFBJkqwoAkqI7wXOn1X1zxgLQt3SNeanfD88kU=";
};
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
(boost186.override {
enableShared = true;
enableStatic = false;
extraFeatures = [
"log"
"thread"
"filesystem"
];
})
boost186.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
mpfr
nlopt
opencascade-occt_7_6
openvdb
pcre
tbb_2021_11
webkitgtk_4_0
wxGTK'
xorg.libX11
opencv
libnoise
]
++ lib.optionals withSystemd [ systemd ]
++ finalAttrs.checkInputs;
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
# 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 {
name = "pr-7650-configurable-update-check.patch";
url = "https://github.com/SoftFever/OrcaSlicer/commit/d10a06ae11089cd1f63705e87f558e9392f7a167.patch";
hash = "sha256-t4own5AwPsLYBsGA15id5IH1ngM0NSuWdFsrxMRXmTk=";
})
];
doCheck = true;
checkInputs = [ gtest ];
separateDebugInfo = true;
NLOPT = nlopt;
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")
"-L${boost186}/lib"
"-lboost_log"
"-lboost_log_setup"
];
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 = [
(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 = ''
gappsWrapperArgs+=(
--prefix LD_LIBRARY_PATH : "$out/lib:${
lib.makeLibraryPath [
glew
]
}"
--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${finalAttrs.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;
};
})

View File

@@ -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)

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}