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

View file

@ -1,11 +1,10 @@
{ {
lib, lib,
stdenv,
fetchurl, fetchurl,
autoPatchelfHook,
dpkg,
buildFHSEnv, buildFHSEnv,
writeShellScript, writeShellScript,
dpkg,
stdenv,
gtk3, gtk3,
glib, glib,
libGL, libGL,
@ -48,6 +47,8 @@
sqlite, sqlite,
curl, curl,
vulkan-loader, vulkan-loader,
libsoup_3,
gst_all_1,
}: }:
let let
@ -60,74 +61,32 @@ let
hash = "sha256-oB/oY8xO/o+UOXR4K/yy0dAIrjB3ztBl9j24k9ceH5I="; hash = "sha256-oB/oY8xO/o+UOXR4K/yy0dAIrjB3ztBl9j24k9ceH5I=";
}; };
nativeBuildInputs = [ nativeBuildInputs = [ dpkg ];
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;
# The default unpack phase doesn't handle .deb files;
# unpack manually with dpkg-deb.
unpackPhase = '' unpackPhase = ''
dpkg-deb -x $src unpacked dpkg-deb -x $src unpacked
''; '';
# Prebuilt binary; there is nothing to compile.
dontBuild = true;
installPhase = '' installPhase = ''
runHook preInstall runHook preInstall
install -Dm755 unpacked/usr/bin/AnycubicSlicerNext $out/lib/anycubic-slicer-next/AnycubicSlicerNext install -Dm755 unpacked/usr/bin/AnycubicSlicerNext \
$out/bin/AnycubicSlicerNext
find unpacked -name '*.so' -o -name '*.so.*' | while read -r f; do
install -Dm755 "$f" $out/lib/anycubic-slicer-next/$(basename "$f")
done
mkdir -p $out/share mkdir -p $out/share
cp -r unpacked/usr/share/AnycubicSlicerNext $out/share/AnycubicSlicerNext 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) iconFile=$(find unpacked -type f \( -name "*.png" -o -name "*.svg" \) -print -quit 2>/dev/null)
if [ -n "$iconFile" ]; then if [ -n "$iconFile" ]; then
mkdir -p $out/share/icons/hicolor/256x256/apps mkdir -p $out/share/icons/hicolor/256x256/apps
@ -140,7 +99,7 @@ let
meta = { meta = {
description = "G-code slicer for Anycubic 3D printers (unwrapped binary)"; description = "G-code slicer for Anycubic 3D printers (unwrapped binary)";
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 = lib.licenses.unfree; license = lib.licenses.agpl3Only;
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
platforms = [ "x86_64-linux" ]; platforms = [ "x86_64-linux" ];
maintainers = with lib.maintainers; [ ]; maintainers = with lib.maintainers; [ ];
@ -190,6 +149,10 @@ let
sqlite sqlite
curl curl
vulkan-loader 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" '' launcherScript = writeShellScript "anycubic-slicer-next-launcher" ''
@ -197,28 +160,29 @@ let
export LD_LIBRARY_PATH=/run/opengl-driver/lib:$LD_LIBRARY_PATH export LD_LIBRARY_PATH=/run/opengl-driver/lib:$LD_LIBRARY_PATH
fi fi
# Workaround for blank 3D preview on NVIDIA + Wayland # NVIDIA + Wayland causes a silent crash on launch due to GBM/EGL issues.
# Uses Zink (OpenGL-on-Vulkan) to avoid NVIDIA's 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 if [ "''${XDG_SESSION_TYPE:-}" = "wayland" ] \
export __GLX_VENDOR_LIBRARY_NAME=mesa && [ -f /run/opengl-driver/share/glvnd/egl_vendor.d/10_nvidia.json ]; then
export MESA_LOADER_DRIVER_OVERRIDE=zink unset WAYLAND_DISPLAY
export GALLIUM_DRIVER=zink export GDK_BACKEND=x11
export WEBKIT_DISABLE_DMABUF_RENDERER=1 export QT_QPA_PLATFORM=xcb
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
fi fi
exec /lib/anycubic-slicer-next/AnycubicSlicerNext "$@" exec ${unwrapped}/bin/AnycubicSlicerNext "$@"
''; '';
in in
buildFHSEnv { buildFHSEnv {
name = "anycubic-slicer-next"; 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 ]; targetPkgs = _: runtimeLibs ++ [ unwrapped ];
extraBwrapArgs = [ extraBwrapArgs = [
"--chdir" "/tmp"
"--ro-bind" "--ro-bind"
"${unwrapped}/share/AnycubicSlicerNext" "${unwrapped}/share/AnycubicSlicerNext"
"/usr/share/AnycubicSlicerNext" "/usr/share/AnycubicSlicerNext"
@ -227,14 +191,14 @@ buildFHSEnv {
runScript = "${launcherScript}"; runScript = "${launcherScript}";
extraInstallCommands = '' extraInstallCommands = ''
mkdir -p $out/share/applications $out/share/icons/hicolor/256x256/apps mkdir -p $out/share/applications $out/share/icons/hicolor/256x256/apps
if [ -f ${unwrapped}/share/icons/hicolor/256x256/apps/anycubic-slicer-next.png ]; then if [ -f ${unwrapped}/share/icons/hicolor/256x256/apps/anycubic-slicer-next.png ]; then
cp ${unwrapped}/share/icons/hicolor/256x256/apps/anycubic-slicer-next.png \ cp ${unwrapped}/share/icons/hicolor/256x256/apps/anycubic-slicer-next.png \
$out/share/icons/hicolor/256x256/apps/ $out/share/icons/hicolor/256x256/apps/
fi fi
cat > $out/share/applications/anycubic-slicer-next.desktop << EOF cat > $out/share/applications/anycubic-slicer-next.desktop << EOF
[Desktop Entry] [Desktop Entry]
Name=Anycubic Slicer Next Name=Anycubic Slicer Next
Comment=G-code slicer for Anycubic 3D printers Comment=G-code slicer for Anycubic 3D printers
@ -251,7 +215,7 @@ buildFHSEnv {
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";
changelog = "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 ]; sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
platforms = [ "x86_64-linux" ]; platforms = [ "x86_64-linux" ];
mainProgram = "anycubic-slicer-next"; mainProgram = "anycubic-slicer-next";

View file

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