<commit_before>{ stdenv, fetchurl, pkgconfig, libpng, libjpeg, expat, libXaw
, yacc, libtool, fontconfig, pango, gd, xorg, gts, libdevil, gettext, cairo
, flex
}:

stdenv.mkDerivation rec {
  version = "2.38.0";
  name = "graphviz-${version}";

  src = fetchurl {
    url = "http://www.graphviz.org/pub/graphviz/ARCHIVE/${name}.tar.gz";
    sha256 = "17l5czpvv5ilmg17frg0w4qwf89jzh2aglm9fgx0l0aakn6j7al1";
  };

  patches =
    [ ./0001-vimdot-lookup-vim-in-PATH.patch
    
      # NOTE: Once this patch is removed, flex can probably be removed from
      # buildInputs.
      ./cve-2014-9157.patch
    ];

  buildInputs =
    [ pkgconfig libpng libjpeg expat yacc libtool fontconfig gd gts libdevil flex
    ] ++ stdenv.lib.optionals (xorg != null) [ xorg.xlibsWrapper xorg.libXrender pango libXaw ]
    ++ stdenv.lib.optional (stdenv.system == "x86_64-darwin") gettext;

  CPPFLAGS = stdenv.lib.optionalString (xorg != null && stdenv.system == "x86_64-darwin")
    "-I${cairo}/include/cairo";<commit_msg>graphviz: build with pango even without xorg<commit_after>{ stdenv, fetchurl, pkgconfig, libpng, libjpeg, expat, libXaw
, yacc, libtool, fontconfig, pango, gd, xorg, gts, libdevil, gettext, cairo
, flex
}:

stdenv.mkDerivation rec {
  version = "2.38.0";
  name = "graphviz-${version}";

  src = fetchurl {
    url = "http://www.graphviz.org/pub/graphviz/ARCHIVE/${name}.tar.gz";
    sha256 = "17l5czpvv5ilmg17frg0w4qwf89jzh2aglm9fgx0l0aakn6j7al1";
  };

  patches =
    [ ./0001-vimdot-lookup-vim-in-PATH.patch
    
      # NOTE: Once this patch is removed, flex can probably be removed from
      # buildInputs.
      ./cve-2014-9157.patch
    ];

  buildInputs =
    [ pkgconfig libpng libjpeg expat yacc libtool fontconfig gd gts libdevil flex pango
    ] ++ stdenv.lib.optionals (xorg != null) [ xorg.xlibsWrapper xorg.libXrender libXaw ]
    ++ stdenv.lib.optional (stdenv.system == "x86_64-darwin") gettext;

  CPPFLAGS = stdenv.lib.optionalString (xorg != null && stdenv.system == "x86_64-darwin")
    "-I${cairo}/include/cairo";
{'fraction_non_alphanumeric': 0.13656387665198239, 'fraction_numerical': 0.043073910915320604, 'mean_word_length': 3.532150776053215, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '5437652', 'n_tokens_mistral': 858, 'n_tokens_neox': 801, 'n_words': 159}