<commit_before>{ stdenv, fetchurl, pkgconfig, zlib, freetype, cairo, lua5, texlive, ghostscript
, libjpeg, qtbase
, makeQtWrapper
}:

stdenv.mkDerivation rec {
  name = "ipe-7.1.10";

  src = fetchurl {
    url = "https://dl.bintray.com/otfried/generic/ipe/7.1/${name}-src.tar.gz";
    sha256 = "0kwk8l2jasb4fdixaca08g661d0sdmx2jkk3ch7pxh0f4xkdxkkz";
  };

  # changes taken from Gentoo portage
  preConfigure = ''
    cd src
    sed -i \
      -e 's/fpic/fPIC/' \
      -e 's/moc-qt4/moc/' \
      config.mak || die
    sed -i -e 's/install -s/install/' common.mak || die
  '';

  IPEPREFIX="$$out";
  URWFONTDIR="${texlive}/texmf-dist/fonts/type1/urw/";
  LUA_PACKAGE = "lua";

  buildInputs = [
    libjpeg pkgconfig zlib qtbase freetype cairo lua5 texlive ghostscript
  ];

  nativeBuildInputs = [ makeQtWrapper ];

  postFixup = ''
    for prog in $out/bin/*; do
      wrapQtProgram "$prog" --prefix PATH : "${texlive}/bin"
    done
  '';

  #TODO: make .desktop entry

  meta = {
    description = "An editor for drawing figures";
    homepage = http://ipe.otfried.org;
    license = stdenv.lib.licenses.gpl3Plus;
    longDescription = ''
      Ipe is an extensible drawing editor for creating figures in PDF and Postscript format.
      It supports making small figures for inclusion into LaTeX-documents
      as well as presentations in PDF.<commit_msg>ipe: build with C++11 for Qt 5.7<commit_after>{ stdenv, fetchurl, pkgconfig, zlib, freetype, cairo, lua5, texlive, ghostscript
, libjpeg, qtbase
, makeQtWrapper
}:

stdenv.mkDerivation rec {
  name = "ipe-7.1.10";

  src = fetchurl {
    url = "https://dl.bintray.com/otfried/generic/ipe/7.1/${name}-src.tar.gz";
    sha256 = "0kwk8l2jasb4fdixaca08g661d0sdmx2jkk3ch7pxh0f4xkdxkkz";
  };

  # changes taken from Gentoo portage
  preConfigure = ''
    cd src
    sed -i \
      -e 's/fpic/fPIC/' \
      -e 's/moc-qt4/moc/' \
      config.mak || die
    sed -i -e 's/install -s/install/' common.mak || die
  '';

  NIX_CFLAGS_COMPILE = [ "-std=c++11" ]; # build with Qt 5.7

  IPEPREFIX="$$out";
  URWFONTDIR="${texlive}/texmf-dist/fonts/type1/urw/";
  LUA_PACKAGE = "lua";

  buildInputs = [
    libjpeg pkgconfig zlib qtbase freetype cairo lua5 texlive ghostscript
  ];

  nativeBuildInputs = [ makeQtWrapper ];

  postFixup = ''
    for prog in $out/bin/*; do
      wrapQtProgram "$prog" --prefix PATH : "${texlive}/bin"
    done
  '';

  #TODO: make .desktop entry

  meta = {
    description = "An editor for drawing figures";
    homepage = http://ipe.otfried.org;
    license = stdenv.lib.licenses.gpl3Plus;
    longDescription = ''
      Ipe is an extensible drawing editor for creating figures in PDF and Postscript format.
      It supports making small figures for inclusion into LaTeX-documents
      as well as presentations in PDF.
{'fraction_non_alphanumeric': 0.12976827094474153, 'fraction_numerical': 0.023529411764705882, 'mean_word_length': 2.9244755244755245, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '6708421', 'n_tokens_mistral': 1079, 'n_tokens_neox': 1024, 'n_words': 249}