<commit_before>{ stdenv
, buildPythonPackage
, fetchurl
, lib

, cairo
}:

let
  inherit (lib)
    optionalString;

  version = "1.15.4";
in
buildPythonPackage rec {
  name = "pycairo-${version}";

  src = fetchurl {
    url = "https:/github.com/pygobject/pycairo/releases/download/v${version}/"
      + "pycairo-${version}.tar.gz";
    hashOutput = false;
    sha256 = "ee4c3068c048230e5ce74bb8994a024711129bde1af1d76e3276c7acd81c4357";
  };

  buildInputs = [
    cairo
  ];

  # pkgconfig has a broken prefix
  preFixup = ''
    sed -i "s,prefix=.*,prefix=$out," $out/share/pkgconfig/pycairo.pc
  '';

  passthru = {
    srcVerification = fetchurl {
      failEarly = true;
      sha256Url = map (n: "${n}.sha256") src.urls;
      pgpsigUrls = map (n: "${n}.sig") src.urls;<commit_msg>pycairo: fix python3 filename matching<commit_after>{ stdenv
, buildPythonPackage
, fetchurl
, lib

, cairo
}:

let
  inherit (lib)
    optionalString;

  version = "1.15.4";
in
buildPythonPackage rec {
  name = "pycairo-${version}";

  src = fetchurl {
    url = "https:/github.com/pygobject/pycairo/releases/download/v${version}/"
      + "pycairo-${version}.tar.gz";
    hashOutput = false;
    sha256 = "ee4c3068c048230e5ce74bb8994a024711129bde1af1d76e3276c7acd81c4357";
  };

  buildInputs = [
    cairo
  ];

  # pkgconfig has a broken prefix
  preFixup = ''
    sed -i "s,prefix=.*,prefix=$out," $out/share/pkgconfig/py*cairo.pc
  '';

  passthru = {
    srcVerification = fetchurl {
      failEarly = true;
      sha256Url = map (n: "${n}.sha256") src.urls;
      pgpsigUrls = map (n: "${n}.sig") src.urls;
{'fraction_non_alphanumeric': 0.15106117353308365, 'fraction_numerical': 0.06928838951310862, 'mean_word_length': 3.2519893899204244, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3500614', 'n_tokens_mistral': 702, 'n_tokens_neox': 628, 'n_words': 109}