anchor.diff:      addOpenGLRunpath $out/bin/mpv
     '';
   
  -  meta = with lib; {
  -    homepage = "https://mpv.io";
  -    description = "General-purpose media player, fork of MPlayer and mplayer2";
  -    longDescription = ''
  -      mpv is a free and open-source general-purpose video player, based on the
  -      MPlayer and mplayer2 projects, with great improvements above both.
  -    '';
  -    license = licenses.gpl2Plus;
  -    maintainers = with maintainers; [ AndersonTorres fpletz globin ma27 tadeokondrak ];
  -    platforms = platforms.darwin ++ platforms.linux;
  -  };
  -
     passthru = {
       inherit
       # The wrapper consults luaEnv and lua.version
  
positive.code:   postPatch = ''
      patchShebangs ./TOOLS/
    '';
    NIX_LDFLAGS = lib.optionalString x11Support "-lX11 -lXext "
                + lib.optionalString stdenv.isDarwin "-framework CoreFoundation";
  
    wafConfigureFlags = [
      "--enable-libmpv-shared"
  
negative.code: , nv-codec-headers
  , lua
  , libuchardet
  , libiconv
  , CoreFoundation, Cocoa, CoreAudio, MediaPlayer
  
  , waylandSupport ? stdenv.isLinux
    , wayland
    , wayland-protocols
    , libxkbcommon
  
  , x11Support ? stdenv.isLinux
    , libGLU, libGL
    , libX11
    , libXext
    , libXxf86vm
    , libXrandr
  
  , cddaSupport ? false
    , libcdio
    , libcdio-paranoia
  
  , vulkanSupport ? stdenv.isLinux
    , libplacebo
    , shaderc
    , vulkan-headers
    , vulkan-loader
  
  , drmSupport ? stdenv.isLinux
    , libdrm
    , mesa
  
  , alsaSupport        ? stdenv.isLinux, alsa-lib
  , archiveSupport     ? true,           libarchive
  , bluraySupport      ? true,           libbluray
  , bs2bSupport        ? true,           libbs2b
  , cacaSupport        ? true,           libcaca
  , cmsSupport         ? true,           lcms2
  , dvdnavSupport      ? stdenv.isLinux, libdvdnav
  , jackaudioSupport   ? false,          libjack2
  , libpngSupport      ? true,           libpng
  , openalSupport      ? true,           openalSoft
  , pulseSupport       ? config.pulseaudio or stdenv.isLinux, libpulseaudio
  , rubberbandSupport  ? stdenv.isLinux, rubberband
  , screenSaverSupport ? true,           libXScrnSaver
  , sdl2Support        ? true,           SDL2
  , sixelSupport       ? false,          libsixel
  , speexSupport       ? true,           speex
  , swiftSupport       ? false,          swift
  , theoraSupport      ? true,           libtheora
  , vaapiSupport       ? stdenv.isLinux, libva
  , vapoursynthSupport ? false,          vapoursynth
  , vdpauSupport       ? true,           libvdpau
  , xineramaSupport    ? stdenv.isLinux, libXinerama
  , xvSupport          ? stdenv.isLinux, libXv
  , zimgSupport        ? true,           zimg
  }:
  
  with lib;
  
  let
    luaEnv = lua.withPackages (ps: with ps; [ luasocket ]);
  