anchor.diff:      mkdir $out
       cp -R install/usr/* $out
   
  -    for i in $out/bin/*; do
  -      wrapProgram $i \
  -        --set ADM_ROOT_DIR $out \
  -        --prefix LD_LIBRARY_PATH ":" "${libXext}/lib"
  -    done
  +    ${wrapProgram "$out/bin/avidemux3_cli"}
  +
  +    ${stdenv.lib.optionalString withQT ''
  +      ${wrapProgram "$out/bin/avidemux3_qt5"} --prefix QT_PLUGIN_PATH : ${qtbase}/lib/qt-${qtVersion}/plugins
  +      ${wrapProgram "$out/bin/avidemux3_jobs_qt5"} --prefix QT_PLUGIN_PATH : ${qtbase}/lib/qt-${qtVersion}/plugins
  +    ''}
  +
       ln -s "$out/bin/avidemux3_${default}" "$out/bin/avidemux"
   
       fixupPhase
  
positive.code: 
  stdenv.mkDerivation rec {
    name = "avidemux-${version}";
    version = "2.7.0";
  
    src = fetchurl {
      url = "mirror://sourceforge/avidemux/avidemux/${version}/avidemux_${version}.tar.gz";
      sha256 = "1bf4l9qwxq3smc1mx5pybydc742a4qqsk17z50j9550d9iwnn7gy";
    };
  
    patches = [
      ./dynamic_install_dir.patch
      ./bootstrap_logging.patch
      # glibc 2.27 compat
      (fetchpatch {
        url = https://github.com/mean00/avidemux2/commit/afdd9c4b876d77a4974d3fa7d9f25caeffbdf13d.patch;
        sha256 = "0mf8vpfdqybziqsfyvxwcdm3zsmnp64293icinhvfpq9xp5b6vn6";
      })
    ];
  
    nativeBuildInputs = [ yasm cmake pkgconfig ];
  
negative.code:     ++ lib.optionals withQT [ qttools qtbase ]
      ++ lib.optional withVPX libvpx;
  
    buildCommand = let
      qtVersion = "5.${stdenv.lib.versions.minor qtbase.version}";
      wrapProgram = f: "wrapProgram ${f} --set ADM_ROOT_DIR $out --prefix LD_LIBRARY_PATH : ${libXext}/lib";
    in ''
      unpackPhase
      cd "$sourceRoot"
      patchPhase
  