anchor.diff:      (mkFlag libxcb-shapeExtlib "2.5" "libxcb-shape")
       (mkFlag (lzma != null) "2.4" "lzma")
       #(mkFlag nvenc        "2.6" "nvenc")
  -    (mkFlag (openal != null) "0.9" "openal")
  +    (mkFlag (disDarwinFix (openal != null)) "0.9" "openal")
       #(mkFlag opencl       "2.2" "opencl")
  -    #(mkFlag (opencore-amr != null) "0.5" "libopencore-amrnb")
  -    #(mkFlag (opencore-amr != null) "0.5" "libopencore-amrwb")
  -    (mkFlag (opencv != null) "1.1" "libopencv") # Actual min. version 0.7
  +    #(mkFlag (opencore-amr != null && version3Licensing) "0.5" "libopencore-amrnb")
  +    #(mkFlag (opencv != null) "1.1" "libopencv") # Actual min. version 0.7
       (mkFlag openglExtlib "2.2" "opengl")
       #(mkFlag (openh264 != null) "2.6" "openh264")
  -    (mkFlag (openjpeg_1 != null) "0.5" "libopenjpeg")
  -    (mkFlag opensslExtlib "0.9" "openssl")
  -    (mkFlag (pulseaudio != null) "0.9" "libpulse")
  +    (mkFlag (disDarwinFix (openjpeg_1 != null)) "0.5" "libopenjpeg")
  +    (mkFlag (opensslExtlib && gplLicensing) "0.9" "openssl")
  +    (mkFlag (disDarwinFix (pulseaudio != null)) "0.9" "libpulse")
       #(mkFlag quvi         "2.0" "libquvi")
  -    (mkFlag (rtmpdump != null) "0.6" "librtmp")
  +    (mkFlag (disDarwinFix (rtmpdump != null)) "0.6" "librtmp")
       #(mkFlag (schroedinger != null) "0.5" "libschroedinger")
       #(mkFlag (shine != null) "2.0" "libshine")
  -    (mkFlag sambaExtlib "2.3" "libsmbclient")
  +    (mkFlag (disDarwinFix (sambaExtlib && gplLicensing && version3Licensing)) "2.3" "libsmbclient")
       (mkFlag (SDL != null) "2.5" "sdl") # Only configurable since 2.5, auto detected before then
       (mkFlag (soxr != null) "1.2" "libsoxr")
       (mkFlag (speex != null) "0.5" "libspeex")
       #(mkFlag (twolame != null) "1.0" "libtwolame")
  -    #(mkFlag (utvideo != null) "0.9" "libutvideo")
  -    (mkFlag (v4l_utils != null) "0.9" "libv4l2")
  -    (mkFlag (vid-stab != null) "2.2" "libvidstab") # Actual min. version 2.0
  -    #(mkFlag (vo-aacenc != null) "0.6" "libvo-aacenc")
  -    #(mkFlag (vo-amrwbenc) "0.7" "libvo-amrwbenc")
  -    (mkFlag (wavpack != null) "2.0" "libwavpack")
  -    (mkFlag (x11grabExtlib) "0.5" "x11grab")
  -    (mkFlag (x264 != null) "0.5" "libx264")
  -    (mkFlag (x265 != null) "2.2" "libx265")
  -    (mkFlag (xavs != null) "0.7" "libxavs")
  -    (mkFlag (xvidcore != null) "0.5" "libxvid")
  +    #(mkFlag (utvideo != null && gplLicensing) "0.9" "libutvideo")
  +    (mkFlag (if !isLinux then false else v4l_utils != null && isLinux) "0.9" "libv4l2")
  +    (mkFlag (disDarwinFix (vid-stab != null && gplLicensing)) "2.2" "libvidstab") # Actual min. version 2.0
  +    #(mkFlag (vo-aacenc != null && version3Licensing) "0.6" "libvo-aacenc")
  +    #(mkFlag (vo-amrwbenc != null && version3Licensing) "0.7" "libvo-amrwbenc")
  +    (mkFlag (disDarwinFix (wavpack != null)) "2.0" "libwavpack")
  +    (mkFlag (x11grabExtlib && gplLicensing) "0.5" "x11grab")
  +    (mkFlag (x264 != null && gplLicensing) "0.5" "libx264")
  +    (mkFlag (disDarwinFix (x265 != null && gplLicensing)) "2.2" "libx265")
  +    (mkFlag (disDarwinFix (xavs != null && gplLicensing)) "0.7" "libxavs")
  +    (mkFlag (xvidcore != null && gplLicensing) "0.5" "libxvid")
       (mkFlag (zeromq4 != null) "2.0" "libzmq")
       (mkFlag (zlib != null) "0.5" "zlib")
  -    #(mkFlag (zvbi != null) "2.1" "libzvbi")
  +    #(mkFlag (zvbi != null && gplLicensing) "2.1" "libzvbi")
       /*
        * Developer flags
        */
  
positive.code:   nativeBuildInputs = [ perl pkgconfig texinfo yasm ];
  
    buildInputs = [
      alsaLib bzip2 celt faad2 fdk_aac fontconfig freetype frei0r fribidi
      game-music-emu gnutls gsm jack2 ladspaH lame libass libbluray libbs2b
      libcaca libdc1394 libmodplug libogg libopus libraw1394 libssh libtheora
      libva libvdpau libvpx libvorbis libwebp libX11 libxcb libXext libXfixes
      libXv lzma mesa openal opencv openjpeg_1 openssl pulseaudio rtmpdump
      samba SDL soxr speex v4l_utils vid-stab wavpack x264 x265 xavs xvidcore
      zeromq4 zlib
    ] ++ optional faacExtlib faac;
  
    # Build qt-faststart executable
    buildPhase = optional (qt-faststartProgram && (reqMin "0.9")) ''make tools/qt-faststart'';
  
negative.code:     #(mkFlag decklinkExtlib "2.2" "decklink")
      (mkFlag faacExtlib "0.5" "libfaac")
      (depFlag faad2Extlib "0.5" "0.6" "libfaad")
      (mkFlag (fdk-aacExtlib && gplLicensing) "1.0" "libfdk-aac")
      #(mkFlag (flite != null) "1.0" "libflite")
      (if reqMin "1.0" then # Force disable until a solution is found
        "--disable-libflite"
       else null)
      (mkFlag (fontconfig != null) "1.0" "fontconfig")
      (mkFlag (freetype != null) "0.7" "libfreetype")
      (mkFlag (disDarwinFix (frei0r != null && gplLicensing)) "0.7" "frei0r")
      (mkFlag (fribidi != null) "2.3" "libfribidi")
      (mkFlag (disDarwinFix (game-music-emu != null)) "2.2" "libgme")
      (mkFlag (gnutls != null) "0.9" "gnutls")
      (verFix (mkFlag (disDarwinFix (gsm != null)) "0.5" "libgsm") "0.5" "--disable-libgsm")
      #(mkFlag (ilbc != null) "1.0" "libilbc")
      (mkFlag (ladspaH !=null) "2.1" "ladspa")
      (mkFlag (lame != null) "0.5" "libmp3lame")
  