<commit_before>{ lib
, stdenv
, fetchurl
, bison
, flex
, which
, alsa-lib
, libsndfile
, qt4
, qscintilla
, libpulseaudio
, libjack2
, audioBackend ? "pulse" # "pulse", "alsa", or "jack"
}:

stdenv.mkDerivation rec {
  pname = "miniaudicle";
  version = "1.3.5.2";

  src = fetchurl {
    url = "https://audicle.cs.princeton.edu/mini/release/files/miniAudicle-${version}.tgz";
    hash = "sha256-dakDz69uHbKZFj8z67CubmRXEQ5X6GuYqlCXXvLzqSI=";
  };

  sourceRoot = "miniAudicle-${version}/src";

  postPatch = ''
    substituteInPlace miniAudicle.pro \
      --replace "/usr/local" $out
  '';

  nativeBuildInputs = [
    bison
    flex
    which
  ];

  buildInputs = [
    alsa-lib
    libsndfile
    qt4
    qscintilla
  ] ++ lib.optional (audioBackend == "pulse") libpulseaudio<commit_msg>miniaudicle: specify use of qscintilla-qt4<commit_after>{ lib
, stdenv
, fetchurl
, bison
, flex
, which
, alsa-lib
, libsndfile
, qt4
, qscintilla-qt4
, libpulseaudio
, libjack2
, audioBackend ? "pulse" # "pulse", "alsa", or "jack"
}:

stdenv.mkDerivation rec {
  pname = "miniaudicle";
  version = "1.3.5.2";

  src = fetchurl {
    url = "https://audicle.cs.princeton.edu/mini/release/files/miniAudicle-${version}.tgz";
    hash = "sha256-dakDz69uHbKZFj8z67CubmRXEQ5X6GuYqlCXXvLzqSI=";
  };

  sourceRoot = "miniAudicle-${version}/src";

  postPatch = ''
    substituteInPlace miniAudicle.pro \
      --replace "/usr/local" $out
  '';

  nativeBuildInputs = [
    bison
    flex
    which
  ];

  buildInputs = [
    alsa-lib
    libsndfile
    qt4
    qscintilla-qt4
  ] ++ lib.optional (audioBackend == "pulse") libpulseaudio
{'fraction_non_alphanumeric': 0.14294516327788045, 'fraction_numerical': 0.02279728897104128, 'mean_word_length': 3.2291666666666665, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '4661813', 'n_tokens_mistral': 685, 'n_tokens_neox': 648, 'n_words': 107}