<commit_before>{ stdenv, fetchurl, fetchpatch, pkgconfig, perl, perlXMLParser, libXft
, libpng, zlib, popt, boehmgc, libxml2, libxslt, glib, gtkmm2
, glibmm, libsigcxx, lcms, boost, gettext, makeWrapper, intltool
, gsl, python2, poppler, imagemagick, libwpg, librevenge
, libvisio, libcdr, libexif, automake114x, potrace, cmake
}:

let
  python2Env = python2.withPackages(ps: with ps; [ numpy lxml ]);
in

stdenv.mkDerivation rec {
  name = "inkscape-0.92.1";

  src = fetchurl {
    url = "https://media.inkscape.org/dl/resources/file/${name}.tar_XlpI7qT.bz2";
    sha256 = "01chr3vh728dkg7l7lilwgmh5nrp784khdhjgpqjbq9dh2zhax15";
  };

  unpackPhase = ''
    cp $src ${name}.tar.bz2
    tar xvjf ${name}.tar.bz2 > /dev/null
    cd ${name}
  '';

  postPatch = ''
    patchShebangs share/extensions
    patchShebangs fix-roff-punct
  '';

  # Python is used at run-time to execute scripts, e.g., those from
  # the "Effects" menu.
  propagatedBuildInputs = [ python2Env ];

  buildInputs = [
    pkgconfig perl perlXMLParser libXft libpng zlib popt boehmgc
    libxml2 libxslt glib gtkmm2 glibmm libsigcxx lcms boost gettext
    makeWrapper intltool gsl poppler imagemagick libwpg librevenge
    libvisio libcdr libexif automake114x potrace cmake
  ];

  enableParallelBuilding = true;<commit_msg>inkscape: patch python interpreter for extension code<commit_after>{ stdenv, fetchurl, fetchpatch, pkgconfig, perl, perlXMLParser, libXft
, libpng, zlib, popt, boehmgc, libxml2, libxslt, glib, gtkmm2
, glibmm, libsigcxx, lcms, boost, gettext, makeWrapper, intltool
, gsl, python2, poppler, imagemagick, libwpg, librevenge
, libvisio, libcdr, libexif, automake114x, potrace, cmake
}:

let
  python2Env = python2.withPackages(ps: with ps; [ numpy lxml ]);
in

stdenv.mkDerivation rec {
  name = "inkscape-0.92.1";

  src = fetchurl {
    url = "https://media.inkscape.org/dl/resources/file/${name}.tar_XlpI7qT.bz2";
    sha256 = "01chr3vh728dkg7l7lilwgmh5nrp784khdhjgpqjbq9dh2zhax15";
  };

  unpackPhase = ''
    cp $src ${name}.tar.bz2
    tar xvjf ${name}.tar.bz2 > /dev/null
    cd ${name}
  '';

  postPatch = ''
    patchShebangs share/extensions
    patchShebangs fix-roff-punct

    # Python is used at run-time to execute scripts, e.g., those from
    # the "Effects" menu.
    substituteInPlace src/extension/implementation/script.cpp \
      --replace '"python-interpreter", "python"' '"python-interpreter", "${python2Env}/bin/python"'
  '';

  buildInputs = [
    pkgconfig perl perlXMLParser libXft libpng zlib popt boehmgc
    libxml2 libxslt glib gtkmm2 glibmm libsigcxx lcms boost gettext
    makeWrapper intltool gsl poppler imagemagick libwpg librevenge
    libvisio libcdr libexif automake114x potrace cmake python2Env
  ];

  enableParallelBuilding = true;
{'fraction_non_alphanumeric': 0.10645976181883797, 'fraction_numerical': 0.029953085528690002, 'mean_word_length': 4.095588235294118, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, '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': '2759460', 'n_tokens_mistral': 1117, 'n_tokens_neox': 1064, 'n_words': 245}