<commit_before># currently needs to be installed into an environment and needs a `kbuildsycoca5` run afterwards for plugin discovery
{
  mkDerivation, fetchFromGitHub, lib, makeWrapper,
  cmake, extra-cmake-modules, pkgconfig,
  libkcddb, kconfig, kconfigwidgets, ki18n, kdelibs4support, kio, solid, kwidgetsaddons, kxmlgui,
  qtbase, phonon, 
  taglib,
  # optional backends
  withCD ? true, cdparanoia,
  withFlac ? true, flac,
  withMidi ? true, fluidsynth, timidity,
  withSpeex ? false, speex,
  withVorbis ? true, vorbis-tools, vorbisgain,
  withMp3 ? true, lame, mp3gain,
  withAac ? true, faad2, aacgain,
  withUnfreeAac ? false, faac,
  withFfmpeg ? true, ffmpeg-full,
  withMplayer ? false, mplayer,
  withSox ? true, sox,
  withOpus ? true, opusTools,
  withTwolame ? false, twolame,
  withApe ? false, mac,
  withWavpack ? false, wavpack
}:

assert withAac -> withFfmpeg || withUnfreeAac;
assert withUnfreeAac -> withAac;

let runtimeDeps = []
    ++ lib.optional withCD cdparanoia
    ++ lib.optional withFlac flac
    ++ lib.optional withSpeex speex
    ++ lib.optional withFfmpeg ffmpeg-full
    ++ lib.optional withMplayer mplayer
    ++ lib.optional withSox sox
    ++ lib.optional withOpus opusTools
    ++ lib.optional withTwolame twolame
    ++ lib.optional withApe mac
    ++ lib.optional withWavpack wavpack
    ++ lib.optional withUnfreeAac faac
    ++ lib.optionals withMidi [ fluidsynth timidity ]
    ++ lib.optionals withVorbis [ vorbis-tools vorbisgain ]
    ++ lib.optionals withMp3 [ lame mp3gain ]
    ++ lib.optionals withAac [  faad2 aacgain ];

in 
mkDerivation rec {
  name = "soundkonverter";
  version = "3.0.1";
  src = fetchFromGitHub {
    owner = "dfaust";
    repo = "soundkonverter";
    rev = "v" + version;
    sha256 = "1g2khdsjmsi4zzynkq8chd11cbdhjzmi37r9jhpal0b730nq9x7l";
  };
  enableParallelBuilding = true;
  nativeBuildInputs = [ cmake extra-cmake-modules pkgconfig kdelibs4support makeWrapper ];
  propagatedBuildInputs = [ libkcddb kconfig kconfigwidgets ki18n kdelibs4support kio solid kwidgetsaddons kxmlgui qtbase phonon];
  buildInputs = [ taglib ] ++ runtimeDeps;
  # encoder plugins go to ${out}/lib so they're found by kbuildsycoca5
  cmakeFlags = [ "-DCMAKE_INSTALL_PREFIX=$out" ]; 
  sourceRoot = "source/src";
  # add runt-time deps to PATH
  postInstall = ''
    wrapProgram $out/bin/soundkonverter --prefix PATH : ${lib.makeBinPath runtimeDeps }
    '';
  meta = {<commit_msg>soundkonverter: add patch for kf5 5.72+<commit_after># currently needs to be installed into an environment and needs a `kbuildsycoca5` run afterwards for plugin discovery
{
  mkDerivation, fetchFromGitHub, fetchpatch, lib, makeWrapper,
  cmake, extra-cmake-modules, pkgconfig,
  libkcddb, kconfig, kconfigwidgets, ki18n, kdelibs4support, kio, solid, kwidgetsaddons, kxmlgui,
  qtbase, phonon, 
  taglib,
  # optional backends
  withCD ? true, cdparanoia,
  withFlac ? true, flac,
  withMidi ? true, fluidsynth, timidity,
  withSpeex ? false, speex,
  withVorbis ? true, vorbis-tools, vorbisgain,
  withMp3 ? true, lame, mp3gain,
  withAac ? true, faad2, aacgain,
  withUnfreeAac ? false, faac,
  withFfmpeg ? true, ffmpeg-full,
  withMplayer ? false, mplayer,
  withSox ? true, sox,
  withOpus ? true, opusTools,
  withTwolame ? false, twolame,
  withApe ? false, mac,
  withWavpack ? false, wavpack
}:

assert withAac -> withFfmpeg || withUnfreeAac;
assert withUnfreeAac -> withAac;

let runtimeDeps = []
    ++ lib.optional withCD cdparanoia
    ++ lib.optional withFlac flac
    ++ lib.optional withSpeex speex
    ++ lib.optional withFfmpeg ffmpeg-full
    ++ lib.optional withMplayer mplayer
    ++ lib.optional withSox sox
    ++ lib.optional withOpus opusTools
    ++ lib.optional withTwolame twolame
    ++ lib.optional withApe mac
    ++ lib.optional withWavpack wavpack
    ++ lib.optional withUnfreeAac faac
    ++ lib.optionals withMidi [ fluidsynth timidity ]
    ++ lib.optionals withVorbis [ vorbis-tools vorbisgain ]
    ++ lib.optionals withMp3 [ lame mp3gain ]
    ++ lib.optionals withAac [  faad2 aacgain ];

in 
mkDerivation rec {
  name = "soundkonverter";
  version = "3.0.1";
  src = fetchFromGitHub {
    owner = "dfaust";
    repo = "soundkonverter";
    rev = "v" + version;
    sha256 = "1g2khdsjmsi4zzynkq8chd11cbdhjzmi37r9jhpal0b730nq9x7l";
  };
  patches = [
    # already merged into master, so it can go during the next release
    (fetchpatch {
      url = "https://patch-diff.githubusercontent.com/raw/dfaust/soundkonverter/pull/87.patch";
      sha256 = "sha256-XIpD4ZMTZVcu+F27OtpRy51H+uQgpd5l22IZ6XsD64w=";
      name = "soundkonverter_taglib.patch";
      stripLen = 1;
    })
  ];
  enableParallelBuilding = true;
  nativeBuildInputs = [ cmake extra-cmake-modules pkgconfig kdelibs4support makeWrapper ];
  propagatedBuildInputs = [ libkcddb kconfig kconfigwidgets ki18n kdelibs4support kio solid kwidgetsaddons kxmlgui qtbase phonon];
  buildInputs = [ taglib ] ++ runtimeDeps;
  # encoder plugins go to ${out}/lib so they're found by kbuildsycoca5
  cmakeFlags = [ "-DCMAKE_INSTALL_PREFIX=$out" ]; 
  sourceRoot = "source/src";
  # add runt-time deps to PATH
  postInstall = ''
    wrapProgram $out/bin/soundkonverter --prefix PATH : ${lib.makeBinPath runtimeDeps }
    '';
  meta = {
{'fraction_non_alphanumeric': 0.09888024293034732, 'fraction_numerical': 0.01821977604858607, 'mean_word_length': 3.911463187325256, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '929258', 'n_tokens_mistral': 1968, 'n_tokens_neox': 1900, 'n_words': 456}