<commit_before>{ lib, buildPythonPackage, fetchPypi, keystone }:

buildPythonPackage rec {
  pname = "keystone-engine";
  version = "0.9.2";

  src = fetchPypi {
   inherit pname version;
   sha256 = "1xahdr6bh3dw5swrc2r8kqa8ljhqlb7k2kxv5mrw5rhcmcnzcyig";
  };

  preConfigure = ''
    substituteInPlace setup.py --replace \
      "libkeystone" "${keystone}/lib/libkeystone"
  '';

  # No tests
  doCheck = false;

  pythonImportsCheck = [ "keystone" ];

  meta = with lib; {
    description = "Lightweight multi-platform, multi-architecture assembler framework";
    homepage = "https://www.keystone-engine.org";
    maintainers = with maintainers; [ dump_stack ];
    license = licenses.gpl2Only;
  };
}
<commit_msg>python3Packages.keystone-engine: fix build for non-x86 linux<commit_after>{ lib, stdenv, buildPythonPackage, fetchPypi, keystone }:

buildPythonPackage rec {
  pname = "keystone-engine";
  version = "0.9.2";

  src = fetchPypi {
   inherit pname version;
   sha256 = "1xahdr6bh3dw5swrc2r8kqa8ljhqlb7k2kxv5mrw5rhcmcnzcyig";
  };

  setupPyBuildFlags = lib.optionals stdenv.isLinux [ "--plat-name" "linux" ];

  preConfigure = ''
    substituteInPlace setup.py --replace \
      "libkeystone" "${keystone}/lib/libkeystone"
  '';

  # No tests
  doCheck = false;

  pythonImportsCheck = [ "keystone" ];

  meta = with lib; {
    description = "Lightweight multi-platform, multi-architecture assembler framework";
    homepage = "https://www.keystone-engine.org";
    maintainers = with maintainers; [ dump_stack ];
    license = licenses.gpl2Only;
  };
}

{'fraction_non_alphanumeric': 0.12484076433121019, 'fraction_numerical': 0.024840764331210193, 'mean_word_length': 3.7896341463414633, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '6886997', 'n_tokens_mistral': 597, 'n_tokens_neox': 555, 'n_words': 105}