<commit_before>{ stdenv, fetchurl, xlibsWrapper, zlib, libjpeg, imake, gccmakedep, libXmu
, libXaw, libXpm, libXp , perl, xauth, fontDirectories, openssh }:

stdenv.mkDerivation {
  name = "tightvnc-1.3.10";

  src = fetchurl {
    url = mirror://sourceforge/vnc-tight/tightvnc-1.3.10_unixsrc.tar.bz2;
    sha256 = "f48c70fea08d03744ae18df6b1499976362f16934eda3275cead87baad585c0d";
  };

  # for the builder script
  inherit xauth fontDirectories perl;
  gcc = stdenv.cc.cc;

  hardeningDisable = [ "format" ];

  buildInputs = [ xlibsWrapper zlib libjpeg imake gccmakedep libXmu libXaw
                  libXpm libXp xauth openssh ];

  patchPhase = ''
    fontPath=
    for i in $fontDirectories; do
      for j in $(find $i -name fonts.dir); do
        addToSearchPathWithCustomDelimiter "," fontPath $(dirname $j)
      done
    done

    sed -i "s@/usr/bin/ssh@${openssh}/bin/ssh@g" vncviewer/vncviewer.h
  '';

  buildPhase = ''
    xmkmf
    make World
    sed -e 's@/usr/bin/perl@${perl}/bin/perl@' \
        -e 's@unix/:7100@'$fontPath'@' \
        -i vncserver

    cd Xvnc
    sed -e 's@.* CppCmd .*@#define CppCmd		'$gcc'/bin/cpp@' -i config/cf/linux.cf
    sed -e 's@.* CppCmd .*@#define CppCmd		'$gcc'/bin/cpp@' -i config/cf/Imake.tmpl
    sed -i \
        -e 's@"uname","xauth","Xvnc","vncpasswd"@"uname","Xvnc","vncpasswd"@g' \
        -e "s@\<xauth\>@${xauth}/bin/xauth@g" \
        ../vncserver
    ./configure
    make
    cd ..
  '';

  installPhase = ''
    mkdir -p $out/bin
    mkdir -p $out/share/man/man1
    ./vncinstall $out/bin $out/share/man

    # fix HTTP client:
    t=$out/share/tightvnc
    mkdir -p $t
    sed -i "s@/usr/local/vnc/classes@$out/vnc/classes@g" $out/bin/vncserver
    cp -r classes $t
  '';

  meta = {
    license = stdenv.lib.licenses.gpl2Plus;
    homepage = http://vnc-tight.sourceforge.net/;
    description = "Improved version of VNC";

    longDescription = ''
      TightVNC is an improved version of VNC, the great free
      remote-desktop tool. The improvements include bandwidth-friendly
      "tight" encoding, file transfers in the Windows version, enhanced
      GUI, many bugfixes, and more.
    '';

    maintainers = [];
    platforms = stdenv.lib.platforms.unix;
  };
}<commit_msg>tightvnc: use imake setup hook<commit_after>{ stdenv, fetchurl, xlibsWrapper, zlib, libjpeg, imake, gccmakedep, libXmu
, libXaw, libXpm, libXp , perl, xauth, fontDirectories, openssh }:

stdenv.mkDerivation {
  name = "tightvnc-1.3.10";

  src = fetchurl {
    url = mirror://sourceforge/vnc-tight/tightvnc-1.3.10_unixsrc.tar.bz2;
    sha256 = "f48c70fea08d03744ae18df6b1499976362f16934eda3275cead87baad585c0d";
  };

  # for the builder script
  inherit fontDirectories;

  hardeningDisable = [ "format" ];

  buildInputs = [ xlibsWrapper zlib libjpeg imake gccmakedep libXmu libXaw
                  libXpm libXp xauth openssh ];

  postPatch = ''
    fontPath=
    for i in $fontDirectories; do
      for j in $(find $i -name fonts.dir); do
        addToSearchPathWithCustomDelimiter "," fontPath $(dirname $j)
      done
    done

    sed -i "s@/usr/bin/ssh@${openssh}/bin/ssh@g" vncviewer/vncviewer.h

    sed -e 's@/usr/bin/perl@${perl}/bin/perl@' \
        -e 's@unix/:7100@'$fontPath'@' \
        -i vncserver

    sed -e 's@.* CppCmd .*@#define CppCmd		cpp@' -i Xvnc/config/cf/linux.cf
    sed -e 's@.* CppCmd .*@#define CppCmd		cpp@' -i Xvnc/config/cf/Imake.tmpl
    sed -i \
        -e 's@"uname","xauth","Xvnc","vncpasswd"@"uname","Xvnc","vncpasswd"@g' \
        -e "s@\<xauth\>@${xauth}/bin/xauth@g" \
        vncserver
  '';

  preInstall = ''
    mkdir -p $out/bin
    mkdir -p $out/share/man/man1
  '';

  installPhase = ''
    runHook preInstall

    ./vncinstall $out/bin $out/share/man

    runHook postInstall
  '';

  postInstall = ''
    # fix HTTP client:
    mkdir -p $out/share/tightvnc
    cp -r classes $out/share/tightvnc
    substituteInPlace $out/bin/vncserver \
      --replace /usr/local/vnc/classes $out/share/tightvnc/classes
  '';

  meta = {
    license = stdenv.lib.licenses.gpl2Plus;
    homepage = http://vnc-tight.sourceforge.net/;
    description = "Improved version of VNC";

    longDescription = ''
      TightVNC is an improved version of VNC, the great free
      remote-desktop tool. The improvements include bandwidth-friendly
      "tight" encoding, file transfers in the Windows version, enhanced
      GUI, many bugfixes, and more.
    '';

    maintainers = [];
    platforms = stdenv.lib.platforms.unix;
  };
}
{'fraction_non_alphanumeric': 0.14136937735430977, 'fraction_numerical': 0.02526035896299579, 'mean_word_length': 2.7030352748154223, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, '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': '6185683', 'n_tokens_mistral': 1859, 'n_tokens_neox': 1718, 'n_words': 365}