<commit_before>{ stdenv, fetchurl, fetchFromGitHub, fetchpatch, pkgconfig, libiconv
, libintlOrEmpty, expat, zlib, libpng, pixman, fontconfig, freetype, xorg
, gobjectSupport ? true, glib
, xcbSupport ? true # no longer experimental since 1.12
, glSupport ? true, mesa_noglu ? null # mesa is no longer a big dependency
, pdfSupport ? true
, darwin
}:

assert glSupport -> mesa_noglu != null;

let inherit (stdenv.lib) optional optionals; in

stdenv.mkDerivation rec {
  name = "cairo-1.14.8";

  src = fetchurl {
    url = "http://cairographics.org/releases/${name}.tar.xz";
    sha1 = "c6f7b99986f93c9df78653c3e6a3b5043f65145e";
  };

  patches = [
    # from https://bugs.freedesktop.org/show_bug.cgi?id=98165
    (fetchpatch {
      name = "cairo-CVE-2016-9082.patch";
      url = "https://bugs.freedesktop.org/attachment.cgi?id=127421";
      sha256 = "03sfyaclzlglip4pvfjb4zj4dmm8mlphhxl30mb6giinkc74bfri";
    })
  ];

  outputs = [ "out" "dev" "devdoc" ];
  outputBin = "dev"; # very small
<commit_msg>cairo: bugfix 1.14.8 -> 1.14.10<commit_after>{ stdenv, fetchurl, fetchFromGitHub, fetchpatch, pkgconfig, libiconv
, libintlOrEmpty, expat, zlib, libpng, pixman, fontconfig, freetype, xorg
, gobjectSupport ? true, glib
, xcbSupport ? true # no longer experimental since 1.12
, glSupport ? true, mesa_noglu ? null # mesa is no longer a big dependency
, pdfSupport ? true
, darwin
}:

assert glSupport -> mesa_noglu != null;

let inherit (stdenv.lib) optional optionals; in

stdenv.mkDerivation rec {
  name = "cairo-1.14.10";

  src = fetchurl {
    url = "http://cairographics.org/releases/${name}.tar.xz";
    sha256 = "02banr0wxckq62nbhc3mqidfdh2q956i2r7w2hd9bjgjb238g1vy";
  };

  patches = [
    # from https://bugs.freedesktop.org/show_bug.cgi?id=98165
    (fetchpatch {
      name = "cairo-CVE-2016-9082.patch";
      url = "https://bugs.freedesktop.org/attachment.cgi?id=127421";
      sha256 = "03sfyaclzlglip4pvfjb4zj4dmm8mlphhxl30mb6giinkc74bfri";
    })
  ];

  outputs = [ "out" "dev" "devdoc" ];
  outputBin = "dev"; # very small

{'fraction_non_alphanumeric': 0.13310580204778158, 'fraction_numerical': 0.06777181862506095, 'mean_word_length': 3.9565217391304346, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '3510788', 'n_tokens_mistral': 900, 'n_tokens_neox': 811, 'n_words': 157}