Unverified Commit 2e2fc521 authored by Maciej Krüger's avatar Maciej Krüger Committed by GitHub
Browse files

prusa-slicer: 2.8.0 -> 2.9.0 (#367376)

parents 1b041784 1bd956fe
Loading
Loading
Loading
Loading
+20 −15
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@
, pkg-config
, wrapGAppsHook3
, boost
, boost183
, cereal
, cgal
, curl
@@ -25,7 +26,7 @@
, mpfr
, nanosvg
, nlopt
, opencascade-occt_7_6
, opencascade-occt_7_6_1
, openvdb
, pcre
, qhull
@@ -35,11 +36,12 @@
, libbgcode
, heatshrink
, catch2
, webkitgtk_4_0
, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd, systemd
, wxGTK-override ? null
, opencascade-override ? null
}:
let
  opencascade-occt = opencascade-occt_7_6;
  wxGTK-prusa = wxGTK32.overrideAttrs (old: rec {
    pname = "wxwidgets-prusa3d-patched";
    version = "3.2.0";
@@ -66,34 +68,35 @@ let
  });
  openvdb_tbb_2021_8 = openvdb.override { tbb = tbb_2021_11; };
  wxGTK-override' = if wxGTK-override == null then wxGTK-prusa else wxGTK-override;
  opencascade-override' = if opencascade-override == null then opencascade-occt_7_6_1 else opencascade-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=";
    })
  ];

  # Build requires at least Boost v1.83.  If the mainline package satisfies
  # that, just use the mainline package, otherwise use an explicitly versioned
  # package.
  boost183OrBetter =
    if lib.versionAtLeast boost.version "1.83"
    then boost
    else boost183;
in
stdenv.mkDerivation (finalAttrs: {
  pname = "prusa-slicer";
  version = "2.8.0";
  version = "2.9.0";
  inherit patches;

  src = fetchFromGitHub {
    owner = "prusa3d";
    repo = "PrusaSlicer";
    hash = "sha256-A/uxNIEXCchLw3t5erWdhqFAeh6nudcMfASi+RoJkFg=";
    hash = "sha256-6BrmTNIiu6oI/CbKPKoFQIh1aHEVfJPIkxomQou0xKk=";
    rev = "version_${finalAttrs.version}";
  };

  # required for GCC 14
  # (not applicable to super-slicer fork)
  postPatch = lib.optionalString (finalAttrs.pname == "prusa-slicer") ''
    substituteInPlace src/libslic3r/Arrange/Core/DataStoreTraits.hpp \
    substituteInPlace src/slic3r-arrange/include/arrange/DataStoreTraits.hpp \
      --replace-fail \
      "WritableDataStoreTraits<ArrItem>::template set" \
      "WritableDataStoreTraits<ArrItem>::set"
@@ -108,7 +111,7 @@ stdenv.mkDerivation (finalAttrs: {

  buildInputs = [
    binutils
    boost
    boost183OrBetter
    cereal
    cgal
    curl
@@ -126,7 +129,7 @@ stdenv.mkDerivation (finalAttrs: {
    mpfr
    nanosvg-fltk
    nlopt
    opencascade-occt
    opencascade-override'
    openvdb_tbb_2021_8
    pcre
    qhull
@@ -136,6 +139,7 @@ stdenv.mkDerivation (finalAttrs: {
    libbgcode
    heatshrink
    catch2
    webkitgtk_4_0
  ] ++ lib.optionals withSystemd [
    systemd
  ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
@@ -185,6 +189,7 @@ stdenv.mkDerivation (finalAttrs: {
    "-DSLIC3R_STATIC=0"
    "-DSLIC3R_FHS=1"
    "-DSLIC3R_GTK=3"
    "-DCMAKE_CXX_FLAGS=-DBOOST_LOG_DYN_LINK"
  ];

  postInstall = ''
+7 −3
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@
  wxGTK31,
  prusa-slicer,
  libspnav,
  opencascade-occt_7_6,
}:
let
  appname = "SuperSlicer";
@@ -59,7 +60,7 @@ let
      # - wxScintilla is not used on macOS
      # - Partially applied upstream changes cause a bug when trying to link against a nonexistent libexpat
      postPatch =
        super.postPatch
        (super.postPatch or "")
        + ''
          substituteInPlace src/CMakeLists.txt \
            --replace "scintilla" "" \
@@ -125,9 +126,12 @@ let
      fetchSubmodules = true;
    };
  });
  prusa-slicer-wxGTK-override = prusa-slicer.override { wxGTK-override = wxGTK31-prusa; };
  prusa-slicer-deps-override = prusa-slicer.override {
    wxGTK-override = wxGTK31-prusa;
    opencascade-override = opencascade-occt_7_6;
  };
  allVersions = builtins.mapAttrs (
    _name: version: (prusa-slicer-wxGTK-override.overrideAttrs (override version))
    _name: version: (prusa-slicer-deps-override.overrideAttrs (override version))
  ) versions;
in
allVersions.stable
+11 −0
Original line number Diff line number Diff line
@@ -10231,6 +10231,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;