NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.05k stars 14.04k forks source link

Build failure: Orca-Slicer 2.2.0 MeshBoolean.cpp #352078

Open foxos21 opened 2 days ago

foxos21 commented 2 days ago

idk who to ask @r-ryantm

Steps To Reproduce

Steps to reproduce the behavior:

  1. build

Build log

Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file src/libslic3r/MeshBoolean.cpp.rej
error: builder for '/nix/store/bdkjgw39wynf4gfmw3b0sap771k5avwv-orca-slicer-2.2.0.drv' failed with exit code 1;
       last 10 log lines:
       > Running phase: patchPhase
       > applying patch /nix/store/7jq52w8wjqykpiycbvhy1qkfw9rfr339-0001-not-for-upstream-CMakeLists-Link-against-webkit2gtk-.patch
       > patching file src/CMakeLists.txt
       > Hunk #1 succeeded at 188 with fuzz 1 (offset 13 lines).
       > applying patch /nix/store/v6c7kmf13nfrjgqyyr2j8m4xz9jf9wnf-meshboolean-const.patch
       > patching file src/libslic3r/MeshBoolean.cpp
       > Reversed (or previously applied) patch detected!  Assume -R? [n]
       > Apply anyway? [n]
       > Skipping patch.
       > 1 out of 1 hunk ignored -- saving rejects to file src/libslic3r/MeshBoolean.cpp.rej
       For full logs, run 'nix-store -l /nix/store/bdkjgw39wynf4gfmw3b0sap771k5avwv-orca-slicer-2.2.0.drv'.

Additional context

# TO BUILD 
#  nix-build -E 'with import <nixpkgs> { }; callPackage ./orca-slicer.nix { } '

{ lib, fetchFromGitHub, fetchpatch, bambu-studio, opencv2 }:

bambu-studio.overrideAttrs (
  finalAttrs: previousAttrs: {
    version = "2.2.0";
    pname = "orca-slicer";

    src = fetchFromGitHub {
      owner = "SoftFever";
      repo = "OrcaSlicer";
      rev = "v${finalAttrs.version}";
      sha256 = "sha256-h+cHWhrp894KEbb3ic2N4fNTn13WlOSYoMsaof0RvRI=";
    };

    buildInputs = previousAttrs.buildInputs ++ [ opencv2 ];

    # Download and apply the patch
    patches = [
      (fetchpatch {
        url = "https://raw.githubusercontent.com/prusa3d/PrusaSlicer/refs/heads/master/src/libslic3r/MeshBoolean.cpp";
        sha256 = "sha256-Ya3+OlvDsFgN+51Xzf+GsZUKWQms7BGhdsnfyYYlp3Q=";
      })
    ];

    preFixup = ''
      gappsWrapperArgs+=(
        --set WEBKIT_DISABLE_COMPOSITING_MODE 1
      )
    '';

    postInstall = ''
      mv $out/LICENSE.txt $out/share/OrcaSlicer/LICENSE.txt
    '';

    meta = with lib; {
      description = "G-code generator for 3D printers (Bambu, Prusa, Voron, VzBot, RatRig, Creality, etc.)";
      homepage = "https://github.com/SoftFever/OrcaSlicer";
      license = licenses.agpl3Only;
      maintainers = with maintainers; [ zhaofengli ovlach pinpox ];
      mainProgram = "orca-slicer";
      platforms = platforms.linux;
    };
  }
)

Metadata

jonboh commented 2 days ago

I'm not sure the tag build failure would be appropiate as the build of the current version (2.1.1) in nixpkgs builds ok. You can check this PR https://github.com/NixOS/nixpkgs/pull/352156 for the change needed to build orca-slicer 2.2.0 ;)

foxos21 commented 2 days ago

@jonboh But without the patch it shows another error i have seen this error before but i never resolved it.

Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file src/libslic3r/MeshBoolean.cpp.rej
error: builder for '/nix/store/g03kpmn4x91phh28dl7q1g6pj7b44l7l-orca-slicer-2.2.0.drv' failed with exit code 1;
       last 10 log lines:
       > Running phase: patchPhase
       > applying patch /nix/store/7jq52w8wjqykpiycbvhy1qkfw9rfr339-0001-not-for-upstream-CMakeLists-Link-against-webkit2gtk-.patch
       > patching file src/CMakeLists.txt
       > Hunk #1 succeeded at 188 with fuzz 1 (offset 13 lines).
       > applying patch /nix/store/v6c7kmf13nfrjgqyyr2j8m4xz9jf9wnf-meshboolean-const.patch
       > patching file src/libslic3r/MeshBoolean.cpp
       > Reversed (or previously applied) patch detected!  Assume -R? [n]
       > Apply anyway? [n]
       > Skipping patch.
       > 1 out of 1 hunk ignored -- saving rejects to file src/libslic3r/MeshBoolean.cpp.rej
       For full logs, run 'nix-store -l /nix/store/g03kpmn4x91phh28dl7q1g6pj7b44l7l-orca-slicer-2.2.0.drv'.
jonboh commented 2 days ago

Look the patches applied in the PR:

    patches = [
      # Fix for webkitgtk linking
      ./0001-not-for-upstream-CMakeLists-Link-against-webkit2gtk-.patch

      ./dont-link-opencv-world.patch
    ];

the patches are the ones in https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/misc/bambu-studio

I'm able to build and run 2.2.0 in my fork with that.