From bafc6ff88df03e765a35efd140e03736490ff520 Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Sat, 7 Sep 2024 10:33:25 -0400 Subject: [PATCH] darwin.xattr: replace with xattr from file_cmds file_cmds 352.40.6 added a C-based implementation of xattr, which is the version of xattr used on recent releases of macOS. Align nixpkgs with what macOS is shipping, which has also the benefit of allowing xattr to be cross-compiled (previously precluded due to Python limitations). --- pkgs/os-specific/darwin/xattr/default.nix | 78 ----------------------- pkgs/top-level/darwin-packages.nix | 2 +- 2 files changed, 1 insertion(+), 79 deletions(-) delete mode 100644 pkgs/os-specific/darwin/xattr/default.nix diff --git a/pkgs/os-specific/darwin/xattr/default.nix b/pkgs/os-specific/darwin/xattr/default.nix deleted file mode 100644 index eee87cdbeec7..000000000000 --- a/pkgs/os-specific/darwin/xattr/default.nix +++ /dev/null @@ -1,78 +0,0 @@ -{ lib -, fetchFromGitHub -, buildPythonPackage -, python -, ed -, unifdef -}: - -buildPythonPackage rec { - pname = "xattr"; - version = "61.60.1"; - - src = fetchFromGitHub { - owner = "apple-oss-distributions"; - repo = "python_modules"; - rev = "python_modules-${version}"; - hash = "sha256-kfMGPzNAJsPvvUCSzcR0kgg85U6/NFf/ie1uwg9tfqY="; - }; - - sourceRoot = "${src.name}/Modules/xattr-0.6.4"; - format = "other"; - - nativeBuildInputs = [ - ed - unifdef - python.pkgs.setuptools - ]; - - makeFlags = [ - "OBJROOT=$(PWD)" - "DSTROOT=${placeholder "out"}" - "OSL=${placeholder "doc"}/share/xattr/OpenSourceLicenses" - "OSV=${placeholder "doc"}/share/xattr/OpenSourceVersions" - ]; - - # need to use `out` instead of `bin` since buildPythonPackage ignores the latter - outputs = [ "out" "doc" "python" ]; - - # We need to patch a reference to gnutar in an included Makefile - postUnpack = '' - chmod u+w $sourceRoot/.. - ''; - - postPatch = '' - substituteInPlace ../Makefile.inc --replace gnutar tar - substituteInPlace Makefile --replace "/usr" "" - ''; - - preInstall = '' - # prevent setup.py from trying to download setuptools - sed -i xattr-*/setup.py -e '/ez_setup/d' - - # create our custom target dirs we patch in - mkdir -p "$doc/share/xattr/"OpenSource{Licenses,Versions} - mkdir -p "$python/lib/${python.libPrefix}" - ''; - - # move python package to its own output to reduce clutter - postInstall = '' - mv "$out/lib/python" "$python/${python.sitePackages}" - rmdir "$out/lib" - ''; - - makeWrapperArgs = [ - "--prefix" - "PYTHONPATH" - ":" - "${placeholder "python"}/${python.sitePackages}" - ]; - - meta = with lib; { - description = "Display and manipulate extended attributes"; - license = [ licenses.psfl licenses.mit ]; # see $doc/share/xattr/OpenSourceLicenses - maintainers = [ maintainers.sternenseemann ]; - homepage = "https://opensource.apple.com/source/python_modules/"; - platforms = lib.platforms.darwin; - }; -} diff --git a/pkgs/top-level/darwin-packages.nix b/pkgs/top-level/darwin-packages.nix index 8501e6f2a4f7..e473c313fdb9 100644 --- a/pkgs/top-level/darwin-packages.nix +++ b/pkgs/top-level/darwin-packages.nix @@ -221,7 +221,7 @@ impure-cmds // apple-source-packages // apple-source-headers // stubs // { trash = callPackage ../os-specific/darwin/trash { }; - xattr = pkgs.python3Packages.callPackage ../os-specific/darwin/xattr { }; + inherit (self.file_cmds) xattr; inherit (pkgs.callPackages ../os-specific/darwin/xcode { }) xcode_8_1 xcode_8_2