This commit is contained in:
Nicole 2026-04-27 21:32:54 +02:00
parent c5ae574b0f
commit 98049fdccb
3 changed files with 57 additions and 95 deletions

View file

@ -535,11 +535,11 @@
"xwayland-satellite-unstable": "xwayland-satellite-unstable"
},
"locked": {
"lastModified": 1777130270,
"narHash": "sha256-AgOIR3O+hLkTe/spgYjp0knc37iy/A5DqGRY+8DP3LE=",
"lastModified": 1777310079,
"narHash": "sha256-lU18YGu/Tuin9X0jsf+cOuyfvrV6Boqf7GvkaJsLAhI=",
"owner": "sodiboo",
"repo": "niri-flake",
"rev": "e43ef13f23c2c7ae5b10e842745cb345faff4f40",
"rev": "8a05e4abd646e387f0af54f50ee4b6d62eda8d79",
"type": "github"
},
"original": {
@ -568,11 +568,11 @@
"niri-unstable": {
"flake": false,
"locked": {
"lastModified": 1777115961,
"narHash": "sha256-ehSMsSpE+0k8r+2Vseu8kangsYxToZv3vinynsDp9zs=",
"lastModified": 1777305786,
"narHash": "sha256-ktXwpDZ71HBRJNw5opB741CfzB2r0F5IcNQGDNwvTKk=",
"owner": "YaLTeR",
"repo": "niri",
"rev": "8ed0da44d974c32c6877d2f4630c314da0717ecb",
"rev": "26100096e843e72004fc29224286e216891be182",
"type": "github"
},
"original": {
@ -583,11 +583,11 @@
},
"nix-flatpak": {
"locked": {
"lastModified": 1776625032,
"narHash": "sha256-edvwHiFhgOiwywt6/Iwe+sSn6ybhU3WZGnIoiGcKjfQ=",
"lastModified": 1777229239,
"narHash": "sha256-OwSaWqlBdKn8QIa7BrPtJmlrr46U7AuwMc/toDKuMZw=",
"owner": "gmodena",
"repo": "nix-flatpak",
"rev": "479e19f1decb390aa5b75cae13ddf87d763c74cc",
"rev": "3f1d78b63b6af353c0685b8a7411c04d980426e4",
"type": "github"
},
"original": {
@ -644,11 +644,11 @@
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1776734388,
"narHash": "sha256-vl3dkhlE5gzsItuHoEMVe+DlonsK+0836LIRDnm6MXQ=",
"lastModified": 1777077449,
"narHash": "sha256-AIiMJiqvGrN4HyLEbKAoCSRRYn0rnlW5VbKNIMIYqm4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "10e7ad5bbcb421fe07e3a4ad53a634b0cd57ffac",
"rev": "a4bf06618f0b5ee50f14ed8f0da77d34ecc19160",
"type": "github"
},
"original": {
@ -756,11 +756,11 @@
},
"nixpkgs_6": {
"locked": {
"lastModified": 1776734388,
"narHash": "sha256-vl3dkhlE5gzsItuHoEMVe+DlonsK+0836LIRDnm6MXQ=",
"lastModified": 1777077449,
"narHash": "sha256-AIiMJiqvGrN4HyLEbKAoCSRRYn0rnlW5VbKNIMIYqm4=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "10e7ad5bbcb421fe07e3a4ad53a634b0cd57ffac",
"rev": "a4bf06618f0b5ee50f14ed8f0da77d34ecc19160",
"type": "github"
},
"original": {

View file

@ -1,11 +1,10 @@
{
lib,
stdenv,
fetchurl,
autoPatchelfHook,
dpkg,
buildFHSEnv,
writeShellScript,
dpkg,
stdenv,
gtk3,
glib,
libGL,
@ -48,6 +47,8 @@
sqlite,
curl,
vulkan-loader,
libsoup_3,
gst_all_1,
}:
let
@ -60,74 +61,32 @@ let
hash = "sha256-oB/oY8xO/o+UOXR4K/yy0dAIrjB3ztBl9j24k9ceH5I=";
};
nativeBuildInputs = [
autoPatchelfHook
dpkg
];
buildInputs = [
gtk3
glib
libGL
mesa
cairo
pango
gdk-pixbuf
atk
dbus
libx11
libxext
libxrender
libxtst
libxi
libxfixes
libxcb
libxcomposite
libxcursor
libxdamage
libxrandr
libxscrnsaver
alsa-lib
udev
nspr
nss
expat
cups
at-spi2-atk
at-spi2-core
libdrm
wayland
libxkbcommon
webkitgtk_4_1
openssl
zlib
libpng
libjpeg
freetype
fontconfig
sqlite
curl
];
dontBuild = true;
nativeBuildInputs = [ dpkg ];
# The default unpack phase doesn't handle .deb files;
# unpack manually with dpkg-deb.
unpackPhase = ''
dpkg-deb -x $src unpacked
'';
# Prebuilt binary; there is nothing to compile.
dontBuild = true;
installPhase = ''
runHook preInstall
install -Dm755 unpacked/usr/bin/AnycubicSlicerNext $out/lib/anycubic-slicer-next/AnycubicSlicerNext
find unpacked -name '*.so' -o -name '*.so.*' | while read -r f; do
install -Dm755 "$f" $out/lib/anycubic-slicer-next/$(basename "$f")
done
install -Dm755 unpacked/usr/bin/AnycubicSlicerNext \
$out/bin/AnycubicSlicerNext
mkdir -p $out/share
cp -r unpacked/usr/share/AnycubicSlicerNext $out/share/AnycubicSlicerNext
# Extract icon - just take the first png/svg found (avoids case statement issues)
# Install bundled shared libraries so the FHS env can expose them
# under /usr/lib where the binary's hardcoded RPATHs expect them.
find unpacked -name '*.so' -o -name '*.so.*' | while read -r f; do
install -Dm755 "$f" $out/lib/$(basename "$f")
done
iconFile=$(find unpacked -type f \( -name "*.png" -o -name "*.svg" \) -print -quit 2>/dev/null)
if [ -n "$iconFile" ]; then
mkdir -p $out/share/icons/hicolor/256x256/apps
@ -140,7 +99,7 @@ let
meta = {
description = "G-code slicer for Anycubic 3D printers (unwrapped binary)";
homepage = "https://wiki.anycubic.com/en/software-and-app/anycubic-slicer-next-linux";
license = lib.licenses.unfree;
license = lib.licenses.agpl3Only;
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
platforms = [ "x86_64-linux" ];
maintainers = with lib.maintainers; [ ];
@ -190,6 +149,10 @@ let
sqlite
curl
vulkan-loader
libsoup_3
gst_all_1.gstreamer
gst_all_1.gst-plugins-base
gst_all_1.gst-plugins-good
];
launcherScript = writeShellScript "anycubic-slicer-next-launcher" ''
@ -197,28 +160,29 @@ let
export LD_LIBRARY_PATH=/run/opengl-driver/lib:$LD_LIBRARY_PATH
fi
# Workaround for blank 3D preview on NVIDIA + Wayland
# Uses Zink (OpenGL-on-Vulkan) to avoid NVIDIA's GBM/EGL issues
if [ "''${XDG_SESSION_TYPE:-}" = "wayland" ] && [ -f /run/opengl-driver/share/glvnd/egl_vendor.d/10_nvidia.json ]; then
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
# NVIDIA + Wayland causes a silent crash on launch due to GBM/EGL issues.
# Fall back to XWayland by forcing X11 backends.
if [ "''${XDG_SESSION_TYPE:-}" = "wayland" ] \
&& [ -f /run/opengl-driver/share/glvnd/egl_vendor.d/10_nvidia.json ]; then
unset WAYLAND_DISPLAY
export GDK_BACKEND=x11
export QT_QPA_PLATFORM=xcb
fi
exec /lib/anycubic-slicer-next/AnycubicSlicerNext "$@"
exec ${unwrapped}/bin/AnycubicSlicerNext "$@"
'';
in
buildFHSEnv {
name = "anycubic-slicer-next";
# buildFHSEnv provides a standard FHS filesystem layout at runtime,
# which this Ubuntu-built binary requires to resolve its hardcoded
# library and resource paths.
targetPkgs = _: runtimeLibs ++ [ unwrapped ];
extraBwrapArgs = [
"--chdir" "/tmp"
"--ro-bind"
"${unwrapped}/share/AnycubicSlicerNext"
"/usr/share/AnycubicSlicerNext"
@ -251,7 +215,7 @@ buildFHSEnv {
description = "G-code slicer for Anycubic 3D printers, based on OrcaSlicer";
homepage = "https://wiki.anycubic.com/en/software-and-app/anycubic-slicer-next-linux";
changelog = "https://wiki.anycubic.com/en/software-and-app/anycubic-slicer-next-linux";
license = lib.licenses.unfree;
license = lib.licenses.agpl3Only;
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
platforms = [ "x86_64-linux" ];
mainProgram = "anycubic-slicer-next";

View file

@ -229,8 +229,6 @@ in
"org.gimp.GIMP"
"com.anydesk.Anydesk"
"com.github.iwalton3.jellyfin-media-player"
"com.sweethome3d.Sweethome3d"
"org.freecad.FreeCAD"
];
#programs.firefox = {