From 32998d916995b8b2767c131cb6fdb09df75f57e7 Mon Sep 17 00:00:00 2001 From: Charlie B Date: Wed, 20 Nov 2024 16:53:00 +0000 Subject: [PATCH 01/10] prusa-slicer: Update version and hash --- pkgs/applications/misc/prusa-slicer/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/misc/prusa-slicer/default.nix b/pkgs/applications/misc/prusa-slicer/default.nix index 8d68045e94dd4..a897f1a7e23ab 100644 --- a/pkgs/applications/misc/prusa-slicer/default.nix +++ b/pkgs/applications/misc/prusa-slicer/default.nix @@ -80,13 +80,13 @@ let in stdenv.mkDerivation (finalAttrs: { pname = "prusa-slicer"; - version = "2.8.0"; + version = "2.8.1"; inherit patches; src = fetchFromGitHub { owner = "prusa3d"; repo = "PrusaSlicer"; - hash = "sha256-A/uxNIEXCchLw3t5erWdhqFAeh6nudcMfASi+RoJkFg="; + hash = "sha256-nMLZvvZLIOChCLn8A9sOph1lqWsHb00eTG8z98/l0C8="; rev = "version_${finalAttrs.version}"; }; From 36efb72e4239278f5455ae63cf490226c5e2bae3 Mon Sep 17 00:00:00 2001 From: Charlie B Date: Wed, 20 Nov 2024 17:50:33 +0000 Subject: [PATCH 02/10] prusa-slicer: Set opencascade version --- pkgs/applications/misc/prusa-slicer/default.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/misc/prusa-slicer/default.nix b/pkgs/applications/misc/prusa-slicer/default.nix index a897f1a7e23ab..618e83bd9ee94 100644 --- a/pkgs/applications/misc/prusa-slicer/default.nix +++ b/pkgs/applications/misc/prusa-slicer/default.nix @@ -39,7 +39,15 @@ , wxGTK-override ? null }: let - opencascade-occt = opencascade-occt_7_6; + opencascade-occt = opencascade-occt_7_6.overrideAttrs (old: { + version = "7.6.1"; + src = fetchFromGitHub { + owner = "Open-Cascade-SAS"; + repo = "OCCT"; + rev = "V7_6_1"; + sha256 = "sha256-C02P3D363UwF0NM6R4D4c6yE5ZZxCcu5CpUaoTOxh7E="; + }; + }); wxGTK-prusa = wxGTK32.overrideAttrs (old: rec { pname = "wxwidgets-prusa3d-patched"; version = "3.2.0"; From 5a8fd95ae9496162cb2835cda2236e7dea6f23ac Mon Sep 17 00:00:00 2001 From: Charlie B Date: Fri, 22 Nov 2024 20:15:24 +0000 Subject: [PATCH 03/10] prusa-slicer: Update dependency with version --- pkgs/applications/misc/prusa-slicer/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/applications/misc/prusa-slicer/default.nix b/pkgs/applications/misc/prusa-slicer/default.nix index 618e83bd9ee94..e15baf4eca6f5 100644 --- a/pkgs/applications/misc/prusa-slicer/default.nix +++ b/pkgs/applications/misc/prusa-slicer/default.nix @@ -35,6 +35,7 @@ , libbgcode , heatshrink , catch2 +, webkitgtk_4_0 , withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd, systemd , wxGTK-override ? null }: @@ -134,6 +135,7 @@ stdenv.mkDerivation (finalAttrs: { libbgcode heatshrink catch2 + webkitgtk_4_0 ] ++ lib.optionals withSystemd [ systemd ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ From 5512228ed50db5bb4501559c547d428e517673aa Mon Sep 17 00:00:00 2001 From: Charlie B Date: Sat, 23 Nov 2024 08:29:37 +0000 Subject: [PATCH 04/10] prusa-slicer: Remove existing patches --- pkgs/applications/misc/prusa-slicer/default.nix | 8 -------- 1 file changed, 8 deletions(-) diff --git a/pkgs/applications/misc/prusa-slicer/default.nix b/pkgs/applications/misc/prusa-slicer/default.nix index e15baf4eca6f5..67e5b01c09fce 100644 --- a/pkgs/applications/misc/prusa-slicer/default.nix +++ b/pkgs/applications/misc/prusa-slicer/default.nix @@ -77,14 +77,6 @@ let wxGTK-override' = if wxGTK-override == null then wxGTK-prusa else wxGTK-override; patches = [ - (fetchpatch { - url = "https://raw.githubusercontent.com/gentoo/gentoo/master/media-gfx/prusaslicer/files/prusaslicer-2.8.0-missing-includes.patch"; - hash = "sha256-/R9jv9zSP1lDW6IltZ8V06xyLdxfaYrk3zD6JRFUxHg="; - }) - (fetchpatch { - url = "https://raw.githubusercontent.com/gentoo/gentoo/master/media-gfx/prusaslicer/files/prusaslicer-2.8.0-fixed-linking.patch"; - hash = "sha256-G1JNdVH+goBelag9aX0NctHFVqtoYFnqjwK/43FVgvM="; - }) ]; in stdenv.mkDerivation (finalAttrs: { From 36a2c14bd50bee2c16f8c83fef669a4657f11da5 Mon Sep 17 00:00:00 2001 From: Charlie B Date: Fri, 22 Nov 2024 17:59:47 +0000 Subject: [PATCH 05/10] prusa-slicer: Add and import new patch file --- .../misc/prusa-slicer/281-dependencies.patch | 70 +++++++++++++++++++ .../misc/prusa-slicer/default.nix | 1 + 2 files changed, 71 insertions(+) create mode 100644 pkgs/applications/misc/prusa-slicer/281-dependencies.patch diff --git a/pkgs/applications/misc/prusa-slicer/281-dependencies.patch b/pkgs/applications/misc/prusa-slicer/281-dependencies.patch new file mode 100644 index 0000000000000..fd5776b998eea --- /dev/null +++ b/pkgs/applications/misc/prusa-slicer/281-dependencies.patch @@ -0,0 +1,70 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 31cb4c0ff..42c38102c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -247,6 +247,8 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Linux") + find_package(Threads REQUIRED) + + find_package(DBus REQUIRED) ++ pkg_check_modules(DBUS REQUIRED dbus-1) ++ include_directories(${DBUS_INCLUDE_DIRS}) + endif() + + if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUXX) +@@ -347,7 +349,7 @@ if(WIN32) + add_definitions(-D_USE_MATH_DEFINES -D_WIN32 -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS) + if(MSVC) + # BOOST_ALL_NO_LIB: Avoid the automatic linking of Boost libraries on Windows. Rather rely on explicit linking. +- add_definitions(-DBOOST_ALL_NO_LIB -DBOOST_USE_WINAPI_VERSION=0x601 -DBOOST_SYSTEM_USE_UTF8 ) ++ add_definitions(-DBOOST_ALL_NO_LIB -DBOOST_USE_WINAPI_VERSION=0x601 -DBOOST_SYSTEM_USE_UTF8 -DBOOST_LOG_DYN_LINK) + # Force the source code encoding to UTF-8. See PrusaSlicer GH pull request #5583 + add_compile_options("$<$:/utf-8>") + add_compile_options("$<$:/utf-8>") +@@ -371,10 +373,13 @@ endif() + # boost::process was introduced first in version 1.64.0, + # boost::beast::detail::base64 was introduced first in version 1.66.0 + set(MINIMUM_BOOST_VERSION "1.66.0") +-set(_boost_components "system;filesystem;thread;log;locale;regex;chrono;atomic;date_time;iostreams;nowide") ++# set(Boost_USE_STATIC_LIBS ON) ++find_package(Boost REQUIRED COMPONENTS log) ++set(_boost_components "system;filesystem;thread;log;log_setup;locale;regex;chrono;atomic;date_time;iostreams;nowide") + find_package(Boost ${MINIMUM_BOOST_VERSION} REQUIRED COMPONENTS ${_boost_components}) ++include_directories(${BOOST_INCLUDE_DIRS}) + +-find_package(Eigen3 3.3.7 REQUIRED) ++find_package(Eigen3 3.3.7 REQUIRED NO_MODULE) + + add_library(boost_libs INTERFACE) + add_library(boost_headeronly INTERFACE) +diff --git a/src/slic3r/CMakeLists.txt b/src/slic3r/CMakeLists.txt +index 78369233d..1f9c40aaf 100644 +--- a/src/slic3r/CMakeLists.txt ++++ b/src/slic3r/CMakeLists.txt +@@ -383,6 +383,7 @@ set(SLIC3R_GUI_SOURCES + ) + + find_package(NanoSVG REQUIRED) ++find_package(OpenSSL REQUIRED) + + if (APPLE) + list(APPEND SLIC3R_GUI_SOURCES +@@ -438,6 +439,9 @@ target_link_libraries( + NanoSVG::nanosvgrast + stb_dxt + fastfloat ++ Boost::log ++ OpenSSL::SSL ++ OpenSSL::Crypto + ) + + if (MSVC) +diff --git a/tests/sla_print/CMakeLists.txt b/tests/sla_print/CMakeLists.txt +index b244e76ac..b23f6d4bc 100644 +--- a/tests/sla_print/CMakeLists.txt ++++ b/tests/sla_print/CMakeLists.txt +@@ -18,3 +18,5 @@ endif() + + # catch_discover_tests(${_TEST_NAME}_tests TEST_PREFIX "${_TEST_NAME}: ") + add_test(${_TEST_NAME}_tests ${_TEST_NAME}_tests ${CATCH_EXTRA_ARGS}) ++ ++add_definitions(-DBOOST_LOG_DYN_LINK) diff --git a/pkgs/applications/misc/prusa-slicer/default.nix b/pkgs/applications/misc/prusa-slicer/default.nix index 67e5b01c09fce..620395aaf64b7 100644 --- a/pkgs/applications/misc/prusa-slicer/default.nix +++ b/pkgs/applications/misc/prusa-slicer/default.nix @@ -77,6 +77,7 @@ let wxGTK-override' = if wxGTK-override == null then wxGTK-prusa else wxGTK-override; patches = [ + ./281-dependencies.patch ]; in stdenv.mkDerivation (finalAttrs: { From 40855588208d73eda1a81cc554d3e7786dfab890 Mon Sep 17 00:00:00 2001 From: Charlie B Date: Tue, 26 Nov 2024 16:31:13 +0000 Subject: [PATCH 06/10] Add override for occt 7.6.1 --- pkgs/top-level/all-packages.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4bd94a5606516..c27055db08e5e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10571,6 +10571,17 @@ with pkgs; ]; }; + opencascade-occt_7_6_1 = opencascade-occt.overrideAttrs { + pname = "opencascade-occt"; + version = "7.6.1"; + src = fetchFromGitHub { + owner = "Open-Cascade-SAS"; + repo = "OCCT"; + rev = "V7_6_1"; + sha256 = "sha256-C02P3D363UwF0NM6R4D4c6yE5ZZxCcu5CpUaoTOxh7E="; + }; + }; + opencsg = callPackage ../development/libraries/opencsg { inherit (qt5) qmake; inherit (darwin.apple_sdk.frameworks) GLUT; From 94cd3c4182b4935fbc0f39fd6509e4feed7829cc Mon Sep 17 00:00:00 2001 From: Charlie B Date: Tue, 26 Nov 2024 16:32:15 +0000 Subject: [PATCH 07/10] prusa-slicer: Use new overriden occt vn --- pkgs/applications/misc/prusa-slicer/default.nix | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/pkgs/applications/misc/prusa-slicer/default.nix b/pkgs/applications/misc/prusa-slicer/default.nix index 620395aaf64b7..8dc78251ba6ef 100644 --- a/pkgs/applications/misc/prusa-slicer/default.nix +++ b/pkgs/applications/misc/prusa-slicer/default.nix @@ -25,7 +25,7 @@ , mpfr , nanosvg , nlopt -, opencascade-occt_7_6 +, opencascade-occt_7_6_1 , openvdb , pcre , qhull @@ -40,15 +40,6 @@ , wxGTK-override ? null }: let - opencascade-occt = opencascade-occt_7_6.overrideAttrs (old: { - version = "7.6.1"; - src = fetchFromGitHub { - owner = "Open-Cascade-SAS"; - repo = "OCCT"; - rev = "V7_6_1"; - sha256 = "sha256-C02P3D363UwF0NM6R4D4c6yE5ZZxCcu5CpUaoTOxh7E="; - }; - }); wxGTK-prusa = wxGTK32.overrideAttrs (old: rec { pname = "wxwidgets-prusa3d-patched"; version = "3.2.0"; @@ -118,7 +109,7 @@ stdenv.mkDerivation (finalAttrs: { mpfr nanosvg-fltk nlopt - opencascade-occt + opencascade-occt_7_6_1 openvdb_tbb_2021_8 pcre qhull From fc6f9d18db32db316997feb2ccaa61beda64559f Mon Sep 17 00:00:00 2001 From: Charlie B Date: Tue, 26 Nov 2024 16:38:16 +0000 Subject: [PATCH 08/10] prusa-slicer: Move boost log link from patch to args --- .../misc/prusa-slicer/281-dependencies.patch | 10 ---------- pkgs/applications/misc/prusa-slicer/default.nix | 1 + 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/pkgs/applications/misc/prusa-slicer/281-dependencies.patch b/pkgs/applications/misc/prusa-slicer/281-dependencies.patch index fd5776b998eea..7ba338deb16c9 100644 --- a/pkgs/applications/misc/prusa-slicer/281-dependencies.patch +++ b/pkgs/applications/misc/prusa-slicer/281-dependencies.patch @@ -58,13 +58,3 @@ index 78369233d..1f9c40aaf 100644 ) if (MSVC) -diff --git a/tests/sla_print/CMakeLists.txt b/tests/sla_print/CMakeLists.txt -index b244e76ac..b23f6d4bc 100644 ---- a/tests/sla_print/CMakeLists.txt -+++ b/tests/sla_print/CMakeLists.txt -@@ -18,3 +18,5 @@ endif() - - # catch_discover_tests(${_TEST_NAME}_tests TEST_PREFIX "${_TEST_NAME}: ") - add_test(${_TEST_NAME}_tests ${_TEST_NAME}_tests ${CATCH_EXTRA_ARGS}) -+ -+add_definitions(-DBOOST_LOG_DYN_LINK) diff --git a/pkgs/applications/misc/prusa-slicer/default.nix b/pkgs/applications/misc/prusa-slicer/default.nix index 8dc78251ba6ef..514d720256ad9 100644 --- a/pkgs/applications/misc/prusa-slicer/default.nix +++ b/pkgs/applications/misc/prusa-slicer/default.nix @@ -167,6 +167,7 @@ stdenv.mkDerivation (finalAttrs: { "-DSLIC3R_STATIC=0" "-DSLIC3R_FHS=1" "-DSLIC3R_GTK=3" + "-DCMAKE_CXX_FLAGS=-DBOOST_LOG_DYN_LINK" ]; postInstall = '' From 3ec6fdd565b420a671f00ec663d6f8fb11e822c6 Mon Sep 17 00:00:00 2001 From: Charlie B Date: Tue, 26 Nov 2024 16:40:08 +0000 Subject: [PATCH 09/10] prusa-slicer: disable slic3r tests --- pkgs/applications/misc/prusa-slicer/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/applications/misc/prusa-slicer/default.nix b/pkgs/applications/misc/prusa-slicer/default.nix index 514d720256ad9..9fa61864860e9 100644 --- a/pkgs/applications/misc/prusa-slicer/default.nix +++ b/pkgs/applications/misc/prusa-slicer/default.nix @@ -167,6 +167,7 @@ stdenv.mkDerivation (finalAttrs: { "-DSLIC3R_STATIC=0" "-DSLIC3R_FHS=1" "-DSLIC3R_GTK=3" + "-DSLIC3R_BUILD_TESTS=0" "-DCMAKE_CXX_FLAGS=-DBOOST_LOG_DYN_LINK" ]; From 6453595ea5c8ccb159e76d8d0fdd4e7d08e6351c Mon Sep 17 00:00:00 2001 From: Charlie B Date: Tue, 26 Nov 2024 18:07:38 +0000 Subject: [PATCH 10/10] prusa-slicer: remove other cmake arg in patch --- .../misc/prusa-slicer/281-dependencies.patch | 9 --------- 1 file changed, 9 deletions(-) diff --git a/pkgs/applications/misc/prusa-slicer/281-dependencies.patch b/pkgs/applications/misc/prusa-slicer/281-dependencies.patch index 7ba338deb16c9..e677eb1d23b07 100644 --- a/pkgs/applications/misc/prusa-slicer/281-dependencies.patch +++ b/pkgs/applications/misc/prusa-slicer/281-dependencies.patch @@ -11,15 +11,6 @@ index 31cb4c0ff..42c38102c 100644 endif() if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUXX) -@@ -347,7 +349,7 @@ if(WIN32) - add_definitions(-D_USE_MATH_DEFINES -D_WIN32 -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS) - if(MSVC) - # BOOST_ALL_NO_LIB: Avoid the automatic linking of Boost libraries on Windows. Rather rely on explicit linking. -- add_definitions(-DBOOST_ALL_NO_LIB -DBOOST_USE_WINAPI_VERSION=0x601 -DBOOST_SYSTEM_USE_UTF8 ) -+ add_definitions(-DBOOST_ALL_NO_LIB -DBOOST_USE_WINAPI_VERSION=0x601 -DBOOST_SYSTEM_USE_UTF8 -DBOOST_LOG_DYN_LINK) - # Force the source code encoding to UTF-8. See PrusaSlicer GH pull request #5583 - add_compile_options("$<$:/utf-8>") - add_compile_options("$<$:/utf-8>") @@ -371,10 +373,13 @@ endif() # boost::process was introduced first in version 1.64.0, # boost::beast::detail::base64 was introduced first in version 1.66.0