From 718400d5786c4990a927e055a9645019a453d8b7 Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Sun, 4 Jan 2026 13:56:07 +0100 Subject: [PATCH] pyxattr: render available on Darwin pyxattr can function on Darwin as per https://github.com/iustin/pyxattr/blob/main/setup.py#L47. attr is not required to compile the C extension in this scenario. The code is slightly cleaned up as well. This was tested with `doCheck = true;` on Darwin as there's no sandbox there. Change-Id: Ie64bde938936407d77b833bfcbc6a675f7eb2e9d Signed-off-by: Raito Bezarius --- pkgs/development/python-modules/pyxattr/default.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/pyxattr/default.nix b/pkgs/development/python-modules/pyxattr/default.nix index d560e74a3e93..7b5b7969e6f2 100644 --- a/pkgs/development/python-modules/pyxattr/default.nix +++ b/pkgs/development/python-modules/pyxattr/default.nix @@ -1,7 +1,8 @@ { lib, - pkgs, + attr, fetchPypi, + stdenv, buildPythonPackage, }: @@ -18,11 +19,12 @@ buildPythonPackage rec { # IOError: [Errno 95] Operation not supported (expected) doCheck = false; - buildInputs = with pkgs; [ attr ]; + buildInputs = lib.optional (lib.meta.availableOn stdenv.buildPlatform attr) attr; meta = { description = "Python extension module which gives access to the extended attributes for filesystem objects available in some operating systems"; license = lib.licenses.lgpl21Plus; - inherit (pkgs.attr.meta) platforms; + # Darwin doesn't need `attr` for this. + platforms = lib.platforms.linux ++ lib.platforms.darwin; }; }