<commit_before>{ lib
, stdenv
, fetchFromGitHub
, coreutils
, scrot
, imagemagick
, gawk
, i3lock-color
, getopt
, fontconfig
}:

stdenv.mkDerivation rec {
  rev = "7accfb2aa2f918d1a3ab975b860df1693d20a81a";
  pname = "i3lock-fancy";
  version = "unstable-2018-11-25_rev${builtins.substring 0 7 rev}";
  src = fetchFromGitHub {
    owner = "meskarune";
    repo = "i3lock-fancy";
    inherit rev;
    sha256 = "00lqsvz1knb8iqy8lnkn3sf4c2c4nzb0smky63qf48m8za5aw9b1";
  };
  patchPhase = ''
    sed -i -e "s|mktemp|${coreutils}/bin/mktemp|" i3lock-fancy
    sed -i -e "s|'rm -f |'${coreutils}/bin/rm -f |" i3lock-fancy
    sed -i -e "s|scrot -z |${scrot}/bin/scrot -z |" i3lock-fancy
    sed -i -e "s|convert |${imagemagick.out}/bin/convert |" i3lock-fancy
    sed -i -e "s|awk -F|${gawk}/bin/awk -F|" i3lock-fancy
    sed -i -e "s| awk | ${gawk}/bin/awk |" i3lock-fancy
    sed -i -e "s|i3lock -i |${i3lock-color}/bin/i3lock-color -i |" i3lock-fancy
    sed -i -e 's|icon="/usr/share/i3lock-fancy/icons/lockdark.png"|icon="'$out'/share/i3lock-fancy/icons/lockdark.png"|' i3lock-fancy
    sed -i -e 's|icon="/usr/share/i3lock-fancy/icons/lock.png"|icon="'$out'/share/i3lock-fancy/icons/lock.png"|' i3lock-fancy
    sed -i -e "s|getopt |${getopt}/bin/getopt |" i3lock-fancy
    sed -i -e "s|fc-match |${fontconfig.bin}/bin/fc-match |" i3lock-fancy
    sed -i -e "s|shot=(import -window root)|shot=(${scrot}/bin/scrot -z -o)|" i3lock-fancy
    rm Makefile
  '';
  installPhase = ''
    mkdir -p $out/bin $out/share/i3lock-fancy/icons
    cp i3lock-fancy $out/bin/i3lock-fancy
    cp icons/lock*.png $out/share/i3lock-fancy/icons
  '';
  meta = with lib; {
    description = "i3lock is a bash script that takes a screenshot of the desktop, blurs the background and adds a lock icon and text";
    homepage = "https://github.com/meskarune/i3lock-fancy";
    maintainers = with maintainers; [ ];
    license = licenses.mit;
    platforms = platforms.linux;
  };
}
<commit_msg>i3/lock-fancy: switch ot pname+version, cleanup postPatch<commit_after>{ lib
, stdenv
, fetchFromGitHub
, coreutils
, scrot
, imagemagick
, gawk
, i3lock-color
, getopt
, fontconfig
}:

stdenv.mkDerivation rec {
  pname = "i3lock-fancy";
  version = "unstable-2018-11-25";

  src = fetchFromGitHub {
    owner = "meskarune";
    repo = "i3lock-fancy";
    rev = "7accfb2aa2f918d1a3ab975b860df1693d20a81a";
    sha256 = "00lqsvz1knb8iqy8lnkn3sf4c2c4nzb0smky63qf48m8za5aw9b1";
  };

  postPatch = ''
    sed -i i3lock-fancy \
      -e "s|mktemp|${coreutils}/bin/mktemp|" \
      -e "s|'rm -f |'${coreutils}/bin/rm -f |" \
      -e "s|scrot -z |${scrot}/bin/scrot -z |" \
      -e "s|convert |${imagemagick.out}/bin/convert |" \
      -e "s|awk -F|${gawk}/bin/awk -F|" \
      -e "s| awk | ${gawk}/bin/awk |" \
      -e "s|i3lock -i |${i3lock-color}/bin/i3lock-color -i |" \
      -e 's|icon="/usr/share/i3lock-fancy/icons/lockdark.png"|icon="'$out'/share/i3lock-fancy/icons/lockdark.png"|' \
      -e 's|icon="/usr/share/i3lock-fancy/icons/lock.png"|icon="'$out'/share/i3lock-fancy/icons/lock.png"|' \
      -e "s|getopt |${getopt}/bin/getopt |" \
      -e "s|fc-match |${fontconfig.bin}/bin/fc-match |" \
      -e "s|shot=(import -window root)|shot=(${scrot}/bin/scrot -z -o)|"
    rm Makefile
  '';

  installPhase = ''
    mkdir -p $out/bin $out/share/i3lock-fancy/icons
    cp i3lock-fancy $out/bin/i3lock-fancy
    cp icons/lock*.png $out/share/i3lock-fancy/icons
  '';

  meta = with lib; {
    description = "i3lock is a bash script that takes a screenshot of the desktop, blurs the background and adds a lock icon and text";
    homepage = "https://github.com/meskarune/i3lock-fancy";
    maintainers = with maintainers; [ ];
    license = licenses.mit;
    platforms = platforms.linux;
  };
}

{'fraction_non_alphanumeric': 0.17617405147253914, 'fraction_numerical': 0.03979835500132661, 'mean_word_length': 3.0933767643865364, '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': '5995080', 'n_tokens_mistral': 1671, 'n_tokens_neox': 1602, 'n_words': 289}