From f9e2c5443cf6072546b7d9ee7231dcc829a01d7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9-Patrick=20Bubel?= Date: Sun, 24 Apr 2022 10:00:53 +0200 Subject: [PATCH] prusa-slicer: use patched wxWidgets With the upstream wxWidgets version prusa-slicer crashes under certain circumstances (https://github.com/NixOS/nixpkgs/issues/168358) Prusa3D provides a patched version of wxWidgets, fixing this and other issues. The 'wxGTK31-gtk3-override' option provides a way to specify the wxWidgets package, e.g. so that `super-slicer` can use its own version. --- .../misc/prusa-slicer/default.nix | 26 ++++++++++++++----- .../misc/prusa-slicer/super-slicer.nix | 6 ++--- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/pkgs/applications/misc/prusa-slicer/default.nix b/pkgs/applications/misc/prusa-slicer/default.nix index dd6184f4ff6f..1d49f280dbfc 100644 --- a/pkgs/applications/misc/prusa-slicer/default.nix +++ b/pkgs/applications/misc/prusa-slicer/default.nix @@ -1,8 +1,22 @@ -{ stdenv, lib, fetchFromGitHub, cmake, copyDesktopItems, makeDesktopItem, pkg-config, wrapGAppsHook -, boost, cereal, cgal_5, curl, dbus, eigen, expat, glew, glib, gmp, gtest, gtk3, hicolor-icon-theme -, ilmbase, libpng, mpfr, nlopt, openvdb, pcre, qhull, systemd, tbb, wxGTK31-gtk3, xorg, fetchpatch -}: -stdenv.mkDerivation rec { +{ stdenv, lib, fetchFromGitHub, cmake, copyDesktopItems, makeDesktopItem +, pkg-config, wrapGAppsHook, boost, cereal, cgal_5, curl, dbus, eigen, expat +, glew, glib, gmp, gtest, gtk3, hicolor-icon-theme, ilmbase, libpng, mpfr, nlopt +, openvdb, pcre, qhull, systemd, tbb, wxGTK31-gtk3, xorg, fetchpatch +, wxGTK31-gtk3-override ? null }: +let + wxGTK31-gtk3-prusa = wxGTK31-gtk3.overrideAttrs (old: rec { + pname = "wxwidgets-prusa3d-patched"; + version = "3.1.4"; + src = fetchFromGitHub { + owner = "prusa3d"; + repo = "wxWidgets"; + rev = "489f6118256853cf5b299d595868641938566cdb"; + hash = "sha256-xGL5I2+bPjmZGSTYe1L7VAmvLHbwd934o/cxg9baEvQ="; + fetchSubmodules = true; + }; + }); + wxGTK31-gtk3-override' = if wxGTK31-gtk3-override == null then wxGTK31-gtk3-prusa else wxGTK31-gtk3-override; +in stdenv.mkDerivation rec { pname = "prusa-slicer"; version = "2.4.1"; @@ -34,7 +48,7 @@ stdenv.mkDerivation rec { pcre systemd tbb - wxGTK31-gtk3 + wxGTK31-gtk3-override' xorg.libX11 ] ++ checkInputs; diff --git a/pkgs/applications/misc/prusa-slicer/super-slicer.nix b/pkgs/applications/misc/prusa-slicer/super-slicer.nix index 41ba78622708..742fa6f8e20e 100644 --- a/pkgs/applications/misc/prusa-slicer/super-slicer.nix +++ b/pkgs/applications/misc/prusa-slicer/super-slicer.nix @@ -1,4 +1,4 @@ -{ lib, fetchFromGitHub, makeDesktopItem, prusa-slicer }: +{ lib, fetchFromGitHub, makeDesktopItem, prusa-slicer, wxGTK31-gtk3 }: let appname = "SuperSlicer"; pname = "super-slicer"; @@ -54,7 +54,7 @@ let passthru = allVersions; }; - - allVersions = builtins.mapAttrs (_name: version: (prusa-slicer.overrideAttrs (override version))) versions; + prusa-slicer' = prusa-slicer.override { wxGTK31-gtk3-override = wxGTK31-gtk3; }; + allVersions = builtins.mapAttrs (_name: version: (prusa-slicer'.overrideAttrs (override version))) versions; in allVersions.stable