<commit_before>{ stdenv, lib, fetchFromGitHub, cmake }:

stdenv.mkDerivation rec {
  pname = "pe-parse";
  version = "2.0.0";

  src = fetchFromGitHub {
    owner = "trailofbits";
    repo = "pe-parse";
    rev = "v${version}";
    hash = "sha256-HwWlMRhpB/sa/JRyAZF7LZzkXCCyuxB+gtDAfHt7e6k=";
  };

  nativeBuildInputs = [ cmake ];

  # See https://github.com/trailofbits/pe-parse/issues/169
  NIX_CFLAGS_COMPILE = "-Wno-sign-conversion";

  doInstallCheck = true;
  installCheckPhase = ''
    $out/bin/dump-pe ../tests/assets/example.exe
  '';

  meta = with lib; {
    description = "A principled, lightweight parser for Windows portable executable files";
    homepage = "https://github.com/trailofbits/pe-parse";
    license = licenses.mit;
    maintainers = with maintainers; [ arturcygan ];
    mainProgram = "dump-pe";
    platforms = platforms.unix;
  };
}
<commit_msg>pe-parse: drop `no-sign-conversion` compile flag<commit_after>{ stdenv, lib, fetchFromGitHub, cmake, fetchpatch }:

stdenv.mkDerivation rec {
  pname = "pe-parse";
  version = "2.0.0";

  src = fetchFromGitHub {
    owner = "trailofbits";
    repo = "pe-parse";
    rev = "v${version}";
    hash = "sha256-HwWlMRhpB/sa/JRyAZF7LZzkXCCyuxB+gtDAfHt7e6k=";
  };

  patches = [
    (fetchpatch {
      url = "https://github.com/trailofbits/pe-parse/commit/eecdb3d36eb44e306398a2e66e85490f9bdcc74c.patch";
      hash = "sha256-pd6D/JMctiQqJxnJU9Nm/GDVf4/CaIGeXx1UfdcCupo=";
    })
  ];

  nativeBuildInputs = [ cmake ];

  doInstallCheck = true;
  installCheckPhase = ''
    $out/bin/dump-pe ../tests/assets/example.exe
  '';

  meta = with lib; {
    description = "A principled, lightweight parser for Windows portable executable files";
    homepage = "https://github.com/trailofbits/pe-parse";
    license = licenses.mit;
    maintainers = with maintainers; [ arturcygan ];
    mainProgram = "dump-pe";
    platforms = platforms.unix;
  };
}

{'fraction_non_alphanumeric': 0.14442127215849843, 'fraction_numerical': 0.026068821689259645, 'mean_word_length': 3.3812785388127855, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, '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': '1880233', 'n_tokens_mistral': 780, 'n_tokens_neox': 735, 'n_words': 121}