From 3f49f2d9783151520ac0b9a588581454b60fd2ad Mon Sep 17 00:00:00 2001
From: Lin Xianyi <iynaix@gmail.com>
Date: Sat, 2 Aug 2025 01:15:23 +0800
Subject: [PATCH] orca-slicer: remove dependency on libsoup2

---
 pkgs/by-name/or/orca-slicer/package.nix             | 13 +++++++++++--
 ...stream-CMakeLists-Link-against-webkit2gtk-.patch |  7 +++----
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/pkgs/by-name/or/orca-slicer/package.nix b/pkgs/by-name/or/orca-slicer/package.nix
index 7e817859988acd..e1376110dcd38e 100644
--- a/pkgs/by-name/or/orca-slicer/package.nix
+++ b/pkgs/by-name/or/orca-slicer/package.nix
@@ -35,7 +35,7 @@
   pcre,
   systemd,
   tbb_2021,
-  webkitgtk_4_0,
+  webkitgtk_4_1,
   wxGTK31,
   xorg,
   libnoise,
@@ -47,8 +47,17 @@ let
       withCurl = true;
       withPrivateFonts = true;
       withWebKit = true;
+      webkitgtk_4_0 = webkitgtk_4_1;
     }).overrideAttrs
       (old: {
+        src = fetchFromGitHub {
+          owner = "SoftFever";
+          repo = "Orca-deps-wxWidgets";
+          rev = "acdc6db5064274405c323c3823eedf559bbe0474";
+          hash = "sha256-Rt03VK0AzZyROkya0zRKpckS/OSa74pLTNbZoJiitfo=";
+          fetchSubmodules = true;
+        };
+
         configureFlags = old.configureFlags ++ [
           # Disable noisy debug dialogs
           "--enable-debug=no"
@@ -112,7 +121,7 @@ stdenv.mkDerivation (finalAttrs: {
     openvdb
     pcre
     tbb_2021
-    webkitgtk_4_0
+    webkitgtk_4_1
     wxGTK'
     xorg.libX11
     opencv.cxxdev
diff --git a/pkgs/by-name/or/orca-slicer/patches/0001-not-for-upstream-CMakeLists-Link-against-webkit2gtk-.patch b/pkgs/by-name/or/orca-slicer/patches/0001-not-for-upstream-CMakeLists-Link-against-webkit2gtk-.patch
index 15f1bf8f0b59e1..8cf3345131449f 100644
--- a/pkgs/by-name/or/orca-slicer/patches/0001-not-for-upstream-CMakeLists-Link-against-webkit2gtk-.patch
+++ b/pkgs/by-name/or/orca-slicer/patches/0001-not-for-upstream-CMakeLists-Link-against-webkit2gtk-.patch
@@ -20,15 +20,14 @@ index 9c5cb96..e92a0e3 100644
 @@ -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.0")
++    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
-
