<commit_before>{ lib
, stdenv
, fetchzip
, buildPythonPackage
, python
, ed
, unifdef
}:

buildPythonPackage rec {
  pname = "xattr";
  version = "61.60.1";

  src = fetchzip rec {
    url = "https://opensource.apple.com/tarballs/python_modules/python_modules-${version}.tar.gz";
    sha256 = "19kydl7w4vpdi7zmfd5z9vjkq24jfk2cv4j0pppw69j06czhdwwi";
  };

  sourceRoot = "${src.name}/Modules/xattr-0.6.4";
  format = "other";

  nativeBuildInputs = [
    ed
    unifdef
  ];

  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" ""<commit_msg>darwin.xattr: add setuptools<commit_after>{ lib
, stdenv
, fetchzip
, buildPythonPackage
, python
, ed
, unifdef
}:

buildPythonPackage rec {
  pname = "xattr";
  version = "61.60.1";

  src = fetchzip rec {
    url = "https://opensource.apple.com/tarballs/python_modules/python_modules-${version}.tar.gz";
    sha256 = "19kydl7w4vpdi7zmfd5z9vjkq24jfk2cv4j0pppw69j06czhdwwi";
  };

  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" ""
{'fraction_non_alphanumeric': 0.14365152919369786, 'fraction_numerical': 0.025023169601482854, 'mean_word_length': 3.5644820295983086, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5438697', 'n_tokens_mistral': 818, 'n_tokens_neox': 781, 'n_words': 159}