<commit_before>{ fetchurl, stdenv, perl, makeWrapper
, iproute, acpi, sysstat, xset, playerctl
, cmus, openvpn, lm_sensors, alsaUtils
, scripts ? [ "bandwidth" "battery" "cpu_usage" "disk" "iface"
              "keyindicator" "load_average" "mediaplayer" "memory"
	            "openvpn" "temperature" "volume" "wifi" ]
}:

with stdenv.lib;

let
  perlscripts = [ "battery" "cpu_usage" "keyindicator"
                  "mediaplayer" "openvpn" "temperature" ];
  contains_any = l1: l2: 0 < length( intersectLists l1 l2 );

in
stdenv.mkDerivation rec {
  name = "i3blocks-${version}";
  version = "1.4";

  src = fetchurl {
    url = "https://github.com/vivien/i3blocks/releases/download/${version}/${name}.tar.gz";
    sha256 = "c64720057e22cc7cac5e8fcd58fd37e75be3a7d5a3cb8995841a7f18d30c0536";
  };

  buildFlags = "SYSCONFDIR=/etc all";
  installFlags = "PREFIX=\${out} VERSION=${version}";

  buildInputs = optional (contains_any scripts perlscripts) perl;
  nativeBuildInputs = [ makeWrapper ];

  postFixup = ''
    wrapProgram $out/libexec/i3blocks/bandwidth \
      --prefix PATH : ${makeBinPath (optional (elem "bandwidth" scripts) iproute)}
    wrapProgram $out/libexec/i3blocks/battery \
      --prefix PATH : ${makeBinPath (optional (elem "battery" scripts) acpi)}
    wrapProgram $out/libexec/i3blocks/cpu_usage \
      --prefix PATH : ${makeBinPath (optional (elem "cpu_usage" scripts) sysstat)}
    wrapProgram $out/libexec/i3blocks/iface \
      --prefix PATH : ${makeBinPath (optional (elem "iface" scripts) iproute)}
    wrapProgram $out/libexec/i3blocks/keyindicator \
      --prefix PATH : ${makeBinPath (optional (elem "keyindicator" scripts) xset)}
    wrapProgram $out/libexec/i3blocks/mediaplayer \
      --prefix PATH : ${makeBinPath (optionals (elem "mediaplayer" scripts) [playerctl cmus])}
    wrapProgram $out/libexec/i3blocks/openvpn \
      --prefix PATH : ${makeBinPath (optional (elem "openvpn" scripts) openvpn)}
    wrapProgram $out/libexec/i3blocks/temperature \
      --prefix PATH : ${makeBinPath (optional (elem "temperature" scripts) lm_sensors)}
    wrapProgram $out/libexec/i3blocks/volume \
      --prefix PATH : ${makeBinPath (optional (elem "volume" scripts) alsaUtils)}
  '';

  meta = {
    description = "A flexible scheduler for your i3bar blocks";
    homepage = https://github.com/vivien/i3blocks;
    license = licenses.gpl3;
    platforms = with platforms; freebsd ++ linux;
  };
}<commit_msg>i3blocks: 1.4 -> unstable-2019-05-07 (#59099)<commit_after>{ fetchFromGitHub, stdenv, autoreconfHook }:

with stdenv.lib;

stdenv.mkDerivation rec {
  name = "i3blocks-${version}";
  version = "unstable-2019-02-07";

  src = fetchFromGitHub {
    owner = "vivien";
    repo = "i3blocks";
    rev = "ec050e79ad8489a6f8deb37d4c20ab10729c25c3";
    sha256 = "1fx4230lmqa5rpzph68dwnpcjfaaqv5gfkradcr85hd1z8d1qp1b";
  };

  nativeBuildInputs = [ autoreconfHook ];

  meta = {
    description = "A flexible scheduler for your i3bar blocks";
    homepage = https://github.com/vivien/i3blocks;
    license = licenses.gpl3;
    platforms = with platforms; freebsd ++ linux;
  };
}
{'fraction_non_alphanumeric': 0.13386837881219904, 'fraction_numerical': 0.04301765650080257, 'mean_word_length': 3.808641975308642, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4661815', 'n_tokens_mistral': 1179, 'n_tokens_neox': 1087, 'n_words': 228}