Fixed orca-slicer, added nvidia-wayland fix for anycubic slicer (no more DRI)
This commit is contained in:
parent
0e044f2daa
commit
11009311e9
2 changed files with 52 additions and 4 deletions
|
|
@ -5,6 +5,7 @@
|
||||||
autoPatchelfHook,
|
autoPatchelfHook,
|
||||||
dpkg,
|
dpkg,
|
||||||
buildFHSEnv,
|
buildFHSEnv,
|
||||||
|
writeShellScript,
|
||||||
gtk3,
|
gtk3,
|
||||||
glib,
|
glib,
|
||||||
glibc,
|
glibc,
|
||||||
|
|
@ -47,6 +48,8 @@
|
||||||
fontconfig,
|
fontconfig,
|
||||||
sqlite,
|
sqlite,
|
||||||
curl,
|
curl,
|
||||||
|
vulkan-loader,
|
||||||
|
vulkan-tools,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
@ -55,7 +58,7 @@ let
|
||||||
version = "1.3.7171-20250928";
|
version = "1.3.7171-20250928";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "https://cdn-universe-slicer.anycubic.com/prod/dists/noble/main/binary-amd64/AnycubicSlicerNext-1.3.7171_20250928_162543-Ubuntu_24_04_2_LTS.deb";
|
url = "https://cdn-universe-slicer.anycubic.com/prod/dists/noble/main/binary-amd64/AnycubicSlicerNext-1.3.7171_20250928_162543-Ubuntu_24_04_2_LTS.deb ";
|
||||||
hash = "sha256-oB/oY8xO/o+UOXR4K/yy0dAIrjB3ztBl9j24k9ceH5I=";
|
hash = "sha256-oB/oY8xO/o+UOXR4K/yy0dAIrjB3ztBl9j24k9ceH5I=";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -98,17 +101,37 @@ let
|
||||||
alsa-lib udev nspr nss expat cups at-spi2-atk at-spi2-core
|
alsa-lib udev nspr nss expat cups at-spi2-atk at-spi2-core
|
||||||
libdrm wayland libxkbcommon webkitgtk_4_1 openssl zlib libpng
|
libdrm wayland libxkbcommon webkitgtk_4_1 openssl zlib libpng
|
||||||
libjpeg freetype fontconfig sqlite curl
|
libjpeg freetype fontconfig sqlite curl
|
||||||
|
vulkan-loader
|
||||||
];
|
];
|
||||||
|
|
||||||
|
launcherScript = writeShellScript "anycubic-slicer-next-launcher" ''
|
||||||
|
if [ -d /run/opengl-driver/lib ]; then
|
||||||
|
export LD_LIBRARY_PATH=/run/opengl-driver/lib:$LD_LIBRARY_PATH
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Workaround for blank 3D preview on Nvidia+Wayland
|
||||||
|
export __GLX_VENDOR_LIBRARY_NAME=mesa
|
||||||
|
export MESA_LOADER_DRIVER_OVERRIDE=zink
|
||||||
|
export GALLIUM_DRIVER=zink
|
||||||
|
export WEBKIT_DISABLE_DMABUF_RENDERER=1
|
||||||
|
|
||||||
|
if [ -f /run/opengl-driver/share/glvnd/egl_vendor.d/50_mesa.json ]; then
|
||||||
|
export __EGL_VENDOR_LIBRARY_FILENAMES=/run/opengl-driver/share/glvnd/egl_vendor.d/50_mesa.json
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec /lib/anycubic-slicer-next/AnycubicSlicerNext "$@"
|
||||||
|
'';
|
||||||
|
|
||||||
in buildFHSEnv {
|
in buildFHSEnv {
|
||||||
name = "AnycubicSlicerNext";
|
name = "AnycubicSlicerNext";
|
||||||
|
|
||||||
targetPkgs = _: runtimeLibs ++ [ unwrapped ];
|
targetPkgs = _: runtimeLibs ++ [ unwrapped ];
|
||||||
|
|
||||||
extraBwrapArgs = [
|
extraBwrapArgs = [
|
||||||
"--ro-bind" "${unwrapped}/share/AnycubicSlicerNext" "/usr/share/AnycubicSlicerNext"
|
"--ro-bind" "${unwrapped}/share/AnycubicSlicerNext" "/usr/share/AnycubicSlicerNext"
|
||||||
];
|
];
|
||||||
|
|
||||||
runScript = "/lib/anycubic-slicer-next/AnycubicSlicerNext";
|
runScript = "${launcherScript}";
|
||||||
|
|
||||||
extraInstallCommands = ''
|
extraInstallCommands = ''
|
||||||
mkdir -p $out/share/applications
|
mkdir -p $out/share/applications
|
||||||
|
|
@ -127,7 +150,7 @@ EOF
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "G-code slicer for Anycubic 3D printers, based on OrcaSlicer";
|
description = "G-code slicer for Anycubic 3D printers, based on OrcaSlicer";
|
||||||
homepage = "https://wiki.anycubic.com/en/software-and-app/anycubic-slicer-next-linux";
|
homepage = "https://wiki.anycubic.com/en/software-and-app/anycubic-slicer-next-linux ";
|
||||||
license = licenses.agpl3Only;
|
license = licenses.agpl3Only;
|
||||||
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
||||||
platforms = [ "x86_64-linux" ];
|
platforms = [ "x86_64-linux" ];
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,31 @@
|
||||||
|
|
||||||
{config, pkgs, pkgs-unstable, lib, inputs, ... }:
|
{config, pkgs, pkgs-unstable, lib, inputs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
orca-slicer-fixed = pkgs.symlinkJoin {
|
||||||
|
name = "orca-slicer";
|
||||||
|
paths = [ pkgs.orca-slicer ];
|
||||||
|
buildInputs = [ pkgs.makeWrapper ];
|
||||||
|
postBuild = ''
|
||||||
|
# Wrap the binary
|
||||||
|
wrapProgram $out/bin/orca-slicer \
|
||||||
|
--set __GLX_VENDOR_LIBRARY_NAME mesa \
|
||||||
|
--set __EGL_VENDOR_LIBRARY_FILENAMES "${pkgs.mesa}/share/glvnd/egl_vendor.d/50_mesa.json" \
|
||||||
|
--set MESA_LOADER_DRIVER_OVERRIDE zink \
|
||||||
|
--set GALLIUM_DRIVER zink \
|
||||||
|
--set WEBKIT_DISABLE_DMABUF_RENDERER 1
|
||||||
|
|
||||||
|
# Fix the desktop entry to point to the wrapped binary
|
||||||
|
if [ -f $out/share/applications/orca-slicer.desktop ]; then
|
||||||
|
substituteInPlace $out/share/applications/orca-slicer.desktop \
|
||||||
|
--replace "Exec=orca-slicer" "Exec=$out/bin/orca-slicer"
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
# RISKY, REMOVE ASAP ###
|
# RISKY, REMOVE ASAP ###
|
||||||
|
|
@ -179,7 +204,7 @@
|
||||||
winetricks
|
winetricks
|
||||||
|
|
||||||
# CAD&3D #
|
# CAD&3D #
|
||||||
orca-slicer
|
orca-slicer-fixed
|
||||||
#freecad
|
#freecad
|
||||||
(callPackage ./pkgs/anycubic-slicer-next/default.nix {})
|
(callPackage ./pkgs/anycubic-slicer-next/default.nix {})
|
||||||
];
|
];
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue