<commit_before>{ stdenv, fetchFromGitHub
, yosys, symbiyosys, python3
}:

let
  python = python3.withPackages (p: with p; [ flask ]);
in
stdenv.mkDerivation {
  pname = "mcy";
  version = "2020.03.16";

  src = fetchFromGitHub {
    owner  = "YosysHQ";
    repo   = "mcy";
    rev    = "562c02375067428bb657f57faa5131ee1ab44051";
    sha256 = "0q77v2hxnmv61zx5bl4lrqiavgvsiyb5qxdp9hnihimj1m30bc5h";
  };

  buildInputs = [ python ];
  patchPhase = ''
    substituteInPlace mcy.py \
      --replace yosys '${yosys}/bin/yosys' \
      --replace 'os.execvp("mcy-dash"' "os.execvp(\"$out/bin/mcy-dash\""
    substituteInPlace mcy-dash.py \
      --replace 'app.run(debug=True)' 'app.run(host="0.0.0.0",debug=True)'
  '';

  # the build needs a bit of work...
  buildPhase = "true";
  installPhase = ''
    mkdir -p $out/bin $out/share/mcy/dash<commit_msg>mcy: 2020.03.16 -> 2020.03.21<commit_after>{ stdenv, fetchFromGitHub
, yosys, symbiyosys, python3
}:

let
  python = python3.withPackages (p: with p; [ flask ]);
in
stdenv.mkDerivation {
  pname = "mcy";
  version = "2020.03.21";

  src = fetchFromGitHub {
    owner  = "YosysHQ";
    repo   = "mcy";
    rev    = "bac92b8aad9bf24714fda70d3750bb50d6d96177";
    sha256 = "<KEY>";
  };

  buildInputs = [ python ];
  patchPhase = ''
    substituteInPlace mcy.py \
      --replace yosys '${yosys}/bin/yosys' \
      --replace 'os.execvp("mcy-dash"' "os.execvp(\"$out/bin/mcy-dash\""
    substituteInPlace mcy-dash.py \
      --replace 'app.run(debug=True)' 'app.run(host="0.0.0.0",debug=True)'
  '';

  # the build needs a bit of work...
  buildPhase = "true";
  installPhase = ''
    mkdir -p $out/bin $out/share/mcy/dash
{'fraction_non_alphanumeric': 0.16816277678037103, 'fraction_numerical': 0.06941950927588271, 'mean_word_length': 3.0289156626506024, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '1208166', 'n_tokens_mistral': 771, 'n_tokens_neox': 699, 'n_words': 119}