<commit_before>{ buildEnv, avidemux_unwrapped, makeWrapper
# GTK version is broken upstream, see https://bugzilla.redhat.com/show_bug.cgi?id=1244340
, withUi ? "qt4"
}:

let ui = builtins.getAttr "avidemux_${withUi}" avidemux_unwrapped; in

assert ui.isUi;

buildEnv {
  name = "avidemux-${withUi}-" + ui.version;

  paths = [ ui avidemux_unwrapped.avidemux_common avidemux_unwrapped.avidemux_settings ];

  ignoreCollisions = true;

  buildInputs = [ makeWrapper ];

  postBuild = ''
    # TODO: This could be avoided if buildEnv could be forced to create all directories
    if [ -L $out/bin ]; then
      rm $out/bin
      mkdir $out/bin
      for i in ${ui}/bin/*; do
        ln -s $i $out/bin
      done
    fi
    for i in $out/bin/*; do
      wrapProgram $i --set ADM_ROOT_DIR $out
    done
  '';

  meta = ui.meta;<commit_msg>avidemux: use symlinkJoin<commit_after>{ symlinkJoin, avidemux_unwrapped, makeWrapper
# GTK version is broken upstream, see https://bugzilla.redhat.com/show_bug.cgi?id=1244340
, withUi ? "qt4"
}:

let ui = builtins.getAttr "avidemux_${withUi}" avidemux_unwrapped; in

assert ui.isUi;

symlinkJoin {
  name = "avidemux-${withUi}-${ui.version}";

  paths = [ ui avidemux_unwrapped.avidemux_common avidemux_unwrapped.avidemux_settings ];

  buildInputs = [ makeWrapper ];

  postBuild = ''
    for i in $out/bin/*; do
      wrapProgram $i --set ADM_ROOT_DIR $out
    done
  '';

  meta = ui.meta;
{'fraction_non_alphanumeric': 0.12193412754029433, 'fraction_numerical': 0.011212333566923615, 'mean_word_length': 3.4485981308411215, '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': '3390799', 'n_tokens_mistral': 552, 'n_tokens_neox': 522, 'n_words': 125}