biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / applications / misc / prusa-slicer / super-slicer.nix
blob218fe6f96bf38e421a4a5e9bf059959cde0fc5f9
1 { lib, fetchFromGitHub, fetchpatch, makeDesktopItem, wxGTK31, prusa-slicer, libspnav }:
2 let
3   appname = "SuperSlicer";
4   pname = "super-slicer";
5   description = "PrusaSlicer fork with more features and faster development cycle";
7   patches = [
8     # Fix compile error with boost 1.79. See https://github.com/supermerill/SuperSlicer/issues/2823
9     (fetchpatch {
10       url = "https://raw.githubusercontent.com/gentoo/gentoo/81e3ca3b7c131e8345aede89e3bbcd700e1ad567/media-gfx/superslicer/files/superslicer-2.4.58.3-boost-1.79-port-v2.patch";
11       # Excludes Linux-only patches
12       excludes = [
13         "src/slic3r/GUI/FreeCADDialog.cpp"
14         "src/slic3r/GUI/Tab.cpp"
15         "src/slic3r/Utils/Http.cpp"
16       ];
17       sha256 = "sha256-v0q2MhySayij7+qBTE5q01IOq/DyUcWnjpbzB/AV34c=";
18     })
19     ./meshboolean-const.patch
20   ];
22   versions = {
23     stable = {
24       version = "2.3.57.12";
25       sha256 = "sha256-lePhDRHI++9zs54bTt2/Lu6ZQ7egjJCWb752aI0s7Mw==";
26       patches = null;
27     };
28     latest = {
29       version = "2.4.58.5";
30       sha256 = "sha256-UywxEGedXaBUTKojEkbkuejI6SdPSkPxTJMwUDNW6W0=";
31       inherit patches;
32     };
33     beta = {
34       version = "2.5.59.6";
35       sha256 = "sha256-4ivhkcvVw5NlPsDz3J840aWc0qnp/XzCnTTCICwi3/c=";
36       inherit patches;
37     };
38   };
40   override = { version, sha256, patches }: super: {
41     inherit version pname patches;
43     src = fetchFromGitHub {
44       owner = "supermerill";
45       repo = "SuperSlicer";
46       inherit sha256;
47       rev = version;
48       fetchSubmodules = true;
49     };
51     # - wxScintilla is not used on macOS
52     # - Partially applied upstream changes cause a bug when trying to link against a nonexistent libexpat
53     prePatch = super.prePatch + ''
54       substituteInPlace src/CMakeLists.txt \
55         --replace "scintilla" "" \
56         --replace "list(APPEND wxWidgets_LIBRARIES libexpat)" "list(APPEND wxWidgets_LIBRARIES EXPAT::EXPAT)"
58       substituteInPlace src/libslic3r/CMakeLists.txt \
59         --replace "libexpat" "EXPAT::EXPAT"
60     '';
62     # We don't need PS overrides anymore, and gcode-viewer is embedded in the binary.
63     postInstall = null;
64     separateDebugInfo = true;
66     buildInputs = super.buildInputs ++ [
67       libspnav
68     ];
70     desktopItems = [
71       (makeDesktopItem {
72         name = "superslicer";
73         exec = "superslicer";
74         icon = appname;
75         comment = description;
76         desktopName = appname;
77         genericName = "3D printer tool";
78         categories = [ "Development" ];
79       })
80     ];
82     meta = with lib; {
83       inherit description;
84       homepage = "https://github.com/supermerill/SuperSlicer";
85       license = licenses.agpl3Plus;
86       maintainers = with maintainers; [ cab404 moredread tmarkus ];
87       mainProgram = "superslicer";
88     };
90     passthru = allVersions;
92   };
93  wxGTK31-prusa = wxGTK31.overrideAttrs (old: rec {
94     pname = "wxwidgets-prusa3d-patched";
95     version = "3.1.4";
96     src = fetchFromGitHub {
97       owner = "prusa3d";
98       repo = "wxWidgets";
99       rev = "489f6118256853cf5b299d595868641938566cdb";
100       hash = "sha256-xGL5I2+bPjmZGSTYe1L7VAmvLHbwd934o/cxg9baEvQ=";
101       fetchSubmodules = true;
102     };
103   });
104   prusa-slicer-wxGTK-override = prusa-slicer.override { wxGTK-override = wxGTK31-prusa; };
105   allVersions = builtins.mapAttrs (_name: version: (prusa-slicer-wxGTK-override.overrideAttrs (override version))) versions;
107 allVersions.stable