File orca-slicer-link-webkit2gtk.patch of Package orca-slicer

From b4cb442562a07b592497a6985b0e027dc9b3140a Mon Sep 17 00:00:00 2001
From: Oleg Girko <ol@infoserver.lv>
Date: Thu, 12 Dec 2024 16:25:21 +0000
Subject: [PATCH] Link webkit2gtk libraries explicitly in Linux.

This is needed not only for Flatpak builds.

Signed-off-by: Oleg Girko <ol@infoserver.lv>
---
 src/slic3r/CMakeLists.txt | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/slic3r/CMakeLists.txt b/src/slic3r/CMakeLists.txt
index 0c54d835a..c1b36af06 100644
--- a/src/slic3r/CMakeLists.txt
+++ b/src/slic3r/CMakeLists.txt
@@ -662,10 +662,11 @@ if (UNIX AND NOT APPLE)
         # I don't know why this is needed, but for whatever reason slic3r isn't
         # linking to X11 and webkit2gtk. force it.
         find_package(X11 REQUIRED)
-        find_package(PkgConfig REQUIRED)
-        pkg_check_modules(webkit2gtk REQUIRED webkit2gtk-4.1)
-        target_link_libraries (libslic3r_gui ${X11_LIBRARIES} ${webkit2gtk_LIBRARIES})
+        target_link_libraries (libslic3r_gui ${X11_LIBRARIES})
     endif()
+    find_package(PkgConfig REQUIRED)
+    pkg_check_modules(webkit2gtk REQUIRED webkit2gtk-4.1)
+    target_link_libraries (libslic3r_gui ${webkit2gtk_LIBRARIES})
     target_include_directories(libslic3r_gui PRIVATE ${GTK${SLIC3R_GTK}_INCLUDE_DIRS})
     target_link_libraries(libslic3r_gui ${GTK${SLIC3R_GTK}_LIBRARIES} fontconfig)
 
-- 
2.47.1