summary refs log tree commit diff
path: root/pkgs/applications/video/mpv/default.nix
diff options
context:
space:
mode:
authorSandro Jäckel <sandro.jaeckel@gmail.com>2021-11-11 15:08:25 +0100
committerSandro Jäckel <sandro.jaeckel@gmail.com>2021-11-11 17:24:38 +0100
commit867421210a911bf7efd1588d5b035865d08c7256 (patch)
treec20a4106bf09a59f659fa3f492336be05b4b2234 /pkgs/applications/video/mpv/default.nix
parentb7d071664dadfe8dd3db28e1f808923fda779b19 (diff)
downloadnixpkgs-867421210a911bf7efd1588d5b035865d08c7256.tar
nixpkgs-867421210a911bf7efd1588d5b035865d08c7256.tar.gz
nixpkgs-867421210a911bf7efd1588d5b035865d08c7256.tar.bz2
nixpkgs-867421210a911bf7efd1588d5b035865d08c7256.tar.lz
nixpkgs-867421210a911bf7efd1588d5b035865d08c7256.tar.xz
nixpkgs-867421210a911bf7efd1588d5b035865d08c7256.tar.zst
nixpkgs-867421210a911bf7efd1588d5b035865d08c7256.zip
mpv: remove ? null from inputs, put meta last
Diffstat (limited to 'pkgs/applications/video/mpv/default.nix')
-rw-r--r--pkgs/applications/video/mpv/default.nix143
1 files changed, 56 insertions, 87 deletions
diff --git a/pkgs/applications/video/mpv/default.nix b/pkgs/applications/video/mpv/default.nix
index 97e707a587e..3183ca9bbe9 100644
--- a/pkgs/applications/video/mpv/default.nix
+++ b/pkgs/applications/video/mpv/default.nix
@@ -19,96 +19,64 @@
 , nv-codec-headers
 , lua
 , libuchardet
-, libiconv ? null
+, libiconv
 , CoreFoundation, Cocoa, CoreAudio, MediaPlayer
 
 , waylandSupport ? stdenv.isLinux
-  , wayland           ? null
-  , wayland-protocols ? null
-  , libxkbcommon      ? null
+  , wayland
+  , wayland-protocols
+  , libxkbcommon
 
 , x11Support ? stdenv.isLinux
-  , libGLU, libGL ? null
-  , libX11          ? null
-  , libXext         ? null
-  , libXxf86vm      ? null
-  , libXrandr       ? null
+  , libGLU, libGL
+  , libX11
+  , libXext
+  , libXxf86vm
+  , libXrandr
 
 , cddaSupport ? false
-  , libcdio          ? null
-  , libcdio-paranoia ? null
+  , libcdio
+  , libcdio-paranoia
 
 , vulkanSupport ? stdenv.isLinux
-  , libplacebo     ? null
-  , shaderc        ? null
-  , vulkan-headers ? null
-  , vulkan-loader  ? null
+  , libplacebo
+  , shaderc
+  , vulkan-headers
+  , vulkan-loader
 
 , drmSupport ? stdenv.isLinux
-  , libdrm ? null
-  , mesa   ? null
-
-, alsaSupport        ? stdenv.isLinux, alsa-lib      ? null
-, archiveSupport     ? true,           libarchive    ? null
-, bluraySupport      ? true,           libbluray     ? null
-, bs2bSupport        ? true,           libbs2b       ? null
-, cacaSupport        ? true,           libcaca       ? null
-, cmsSupport         ? true,           lcms2         ? null
-, dvdnavSupport      ? stdenv.isLinux, libdvdnav     ? null
-, jackaudioSupport   ? false,          libjack2      ? null
-, libpngSupport      ? true,           libpng        ? null
-, openalSupport      ? true,           openalSoft    ? null
-, pulseSupport       ? config.pulseaudio or stdenv.isLinux, libpulseaudio ? null
-, rubberbandSupport  ? stdenv.isLinux, rubberband    ? null
-, screenSaverSupport ? true,           libXScrnSaver ? null
-, sdl2Support        ? true,           SDL2          ? null
-, sixelSupport       ? false,          libsixel      ? null
-, speexSupport       ? true,           speex         ? null
-, swiftSupport       ? false,          swift         ? null
-, theoraSupport      ? true,           libtheora     ? null
-, vaapiSupport       ? stdenv.isLinux, libva         ? null
-, vapoursynthSupport ? false,          vapoursynth   ? null
-, vdpauSupport       ? true,           libvdpau      ? null
-, xineramaSupport    ? stdenv.isLinux, libXinerama   ? null
-, xvSupport          ? stdenv.isLinux, libXv         ? null
-, zimgSupport        ? true,           zimg          ? null
+  , 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
-  available = x: x != null;
-in
-assert alsaSupport        -> available alsa-lib;
-assert archiveSupport     -> available libarchive;
-assert bluraySupport      -> available libbluray;
-assert bs2bSupport        -> available libbs2b;
-assert cacaSupport        -> available libcaca;
-assert cddaSupport        -> all available [ libcdio libcdio-paranoia ];
-assert cmsSupport         -> available lcms2;
-assert drmSupport         -> all available [ libdrm mesa ];
-assert dvdnavSupport      -> available libdvdnav;
-assert jackaudioSupport   -> available libjack2;
-assert libpngSupport      -> available libpng;
-assert openalSupport      -> available openalSoft;
-assert pulseSupport       -> available libpulseaudio;
-assert rubberbandSupport  -> available rubberband;
-assert screenSaverSupport -> available libXScrnSaver;
-assert sdl2Support        -> available SDL2;
-assert sixelSupport       -> available libsixel;
-assert speexSupport       -> available speex;
-assert theoraSupport      -> available libtheora;
-assert vaapiSupport       -> available libva;
-assert vapoursynthSupport -> available vapoursynth;
-assert vdpauSupport       -> available libvdpau;
-assert vulkanSupport      -> all available [ libplacebo shaderc vulkan-headers vulkan-loader ];
-assert waylandSupport     -> all available [ wayland wayland-protocols libxkbcommon ];
-assert x11Support         -> all available [ libGLU libGL libX11 libXext libXxf86vm libXrandr ];
-assert xineramaSupport    -> x11Support && available libXinerama;
-assert xvSupport          -> x11Support && available libXv;
-assert zimgSupport        -> available zimg;
-
-let
   luaEnv = lua.withPackages (ps: with ps; [ luasocket ]);
 
 in stdenv.mkDerivation rec {
@@ -127,8 +95,9 @@ in stdenv.mkDerivation rec {
   postPatch = ''
     patchShebangs ./TOOLS/
   '';
+
   NIX_LDFLAGS = lib.optionalString x11Support "-lX11 -lXext "
-              + lib.optionalString stdenv.isDarwin "-framework CoreFoundation";
+    + lib.optionalString stdenv.isDarwin "-framework CoreFoundation";
 
   wafConfigureFlags = [
     "--enable-libmpv-shared"
@@ -227,18 +196,6 @@ in stdenv.mkDerivation rec {
     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
@@ -252,4 +209,16 @@ in stdenv.mkDerivation rec {
     vapoursynth
     ;
   };
+
+  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;
+  };
 }