@@ -19,95 +19,63 @@
1919, nv-codec-headers
2020, lua
2121, libuchardet
22−, libiconv ? null
22+, libiconv
2323, CoreFoundation, Cocoa, CoreAudio, MediaPlayer
2424
2525, waylandSupport ? stdenv.isLinux
26− , wayland ? null
27− , wayland-protocols ? null
28− , libxkbcommon ? null
26+ , wayland
27+ , wayland-protocols
28+ , libxkbcommon
2929
3030, x11Support ? stdenv.isLinux
31− , libGLU, libGL ? null
32− , libX11 ? null
33− , libXext ? null
34− , libXxf86vm ? null
35− , libXrandr ? null
31+ , libGLU, libGL
32+ , libX11
33+ , libXext
34+ , libXxf86vm
35+ , libXrandr
3636
3737, cddaSupport ? false
38− , libcdio ? null
39− , libcdio-paranoia ? null
38+ , libcdio
39+ , libcdio-paranoia
4040
4141, vulkanSupport ? stdenv.isLinux
42− , libplacebo ? null
43− , shaderc ? null
44− , vulkan-headers ? null
45− , vulkan-loader ? null
42+ , libplacebo
43+ , shaderc
44+ , vulkan-headers
45+ , vulkan-loader
4646
4747, drmSupport ? stdenv.isLinux
48− , libdrm ? null
49− , mesa ? null
50−
51−, alsaSupport ? stdenv.isLinux, alsa-lib ? null
52−, archiveSupport ? true, libarchive ? null
53−, bluraySupport ? true, libbluray ? null
54−, bs2bSupport ? true, libbs2b ? null
55−, cacaSupport ? true, libcaca ? null
56−, cmsSupport ? true, lcms2 ? null
57−, dvdnavSupport ? stdenv.isLinux, libdvdnav ? null
58−, jackaudioSupport ? false, libjack2 ? null
59−, libpngSupport ? true, libpng ? null
60−, openalSupport ? true, openalSoft ? null
61−, pulseSupport ? config.pulseaudio or stdenv.isLinux, libpulseaudio ? null
62−, rubberbandSupport ? stdenv.isLinux, rubberband ? null
63−, screenSaverSupport ? true, libXScrnSaver ? null
64−, sdl2Support ? true, SDL2 ? null
65−, sixelSupport ? false, libsixel ? null
66−, speexSupport ? true, speex ? null
67−, swiftSupport ? false, swift ? null
68−, theoraSupport ? true, libtheora ? null
69−, vaapiSupport ? stdenv.isLinux, libva ? null
70−, vapoursynthSupport ? false, vapoursynth ? null
71−, vdpauSupport ? true, libvdpau ? null
72−, xineramaSupport ? stdenv.isLinux, libXinerama ? null
73−, xvSupport ? stdenv.isLinux, libXv ? null
74−, zimgSupport ? true, zimg ? null
48+ , libdrm
49+ , mesa
50+
51+, alsaSupport ? stdenv.isLinux, alsa-lib
52+, archiveSupport ? true, libarchive
53+, bluraySupport ? true, libbluray
54+, bs2bSupport ? true, libbs2b
55+, cacaSupport ? true, libcaca
56+, cmsSupport ? true, lcms2
57+, dvdnavSupport ? stdenv.isLinux, libdvdnav
58+, jackaudioSupport ? false, libjack2
59+, libpngSupport ? true, libpng
60+, openalSupport ? true, openalSoft
61+, pulseSupport ? config.pulseaudio or stdenv.isLinux, libpulseaudio
62+, rubberbandSupport ? stdenv.isLinux, rubberband
63+, screenSaverSupport ? true, libXScrnSaver
64+, sdl2Support ? true, SDL2
65+, sixelSupport ? false, libsixel
66+, speexSupport ? true, speex
67+, swiftSupport ? false, swift
68+, theoraSupport ? true, libtheora
69+, vaapiSupport ? stdenv.isLinux, libva
70+, vapoursynthSupport ? false, vapoursynth
71+, vdpauSupport ? true, libvdpau
72+, xineramaSupport ? stdenv.isLinux, libXinerama
73+, xvSupport ? stdenv.isLinux, libXv
74+, zimgSupport ? true, zimg
7575}:
7676
7777with lib;
7878
79−let
80− available = x: x != null;
81−in
82−assert alsaSupport -> available alsa-lib;
83−assert archiveSupport -> available libarchive;
84−assert bluraySupport -> available libbluray;
85−assert bs2bSupport -> available libbs2b;
86−assert cacaSupport -> available libcaca;
87−assert cddaSupport -> all available [ libcdio libcdio-paranoia ];
88−assert cmsSupport -> available lcms2;
89−assert drmSupport -> all available [ libdrm mesa ];
90−assert dvdnavSupport -> available libdvdnav;
91−assert jackaudioSupport -> available libjack2;
92−assert libpngSupport -> available libpng;
93−assert openalSupport -> available openalSoft;
94−assert pulseSupport -> available libpulseaudio;
95−assert rubberbandSupport -> available rubberband;
96−assert screenSaverSupport -> available libXScrnSaver;
97−assert sdl2Support -> available SDL2;
98−assert sixelSupport -> available libsixel;
99−assert speexSupport -> available speex;
100−assert theoraSupport -> available libtheora;
101−assert vaapiSupport -> available libva;
102−assert vapoursynthSupport -> available vapoursynth;
103−assert vdpauSupport -> available libvdpau;
104−assert vulkanSupport -> all available [ libplacebo shaderc vulkan-headers vulkan-loader ];
105−assert waylandSupport -> all available [ wayland wayland-protocols libxkbcommon ];
106−assert x11Support -> all available [ libGLU libGL libX11 libXext libXxf86vm libXrandr ];
107−assert xineramaSupport -> x11Support && available libXinerama;
108−assert xvSupport -> x11Support && available libXv;
109−assert zimgSupport -> available zimg;
110−
11179let
11280 luaEnv = lua.withPackages (ps: with ps; [ luasocket ]);
11381
@@ -127,8 +95,9 @@ in stdenv.mkDerivation rec {
12795 postPatch = ''
12896 patchShebangs ./TOOLS/
12997 '';
98+
13099 NIX_LDFLAGS = lib.optionalString x11Support "-lX11 -lXext "
131− + lib.optionalString stdenv.isDarwin "-framework CoreFoundation";
100+ + lib.optionalString stdenv.isDarwin "-framework CoreFoundation";
132101
133102 wafConfigureFlags = [
134103 "--enable-libmpv-shared"
@@ -227,18 +196,6 @@ in stdenv.mkDerivation rec {
227196 addOpenGLRunpath $out/bin/mpv
228197 '';
229198
230− meta = with lib; {
231− homepage = "https://mpv.io";
232− description = "General-purpose media player, fork of MPlayer and mplayer2";
233− longDescription = ''
234− mpv is a free and open-source general-purpose video player, based on the
235− MPlayer and mplayer2 projects, with great improvements above both.
236− '';
237− license = licenses.gpl2Plus;
238− maintainers = with maintainers; [ AndersonTorres fpletz globin ma27 tadeokondrak ];
239− platforms = platforms.darwin ++ platforms.linux;
240− };
241−
242199 passthru = {
243200 inherit
244201 # The wrapper consults luaEnv and lua.version
@@ -252,4 +209,16 @@ in stdenv.mkDerivation rec {
252209 vapoursynth
253210 ;
254211 };
212+
213+ meta = with lib; {
214+ homepage = "https://mpv.io";
215+ description = "General-purpose media player, fork of MPlayer and mplayer2";
216+ longDescription = ''
217+ mpv is a free and open-source general-purpose video player, based on the
218+ MPlayer and mplayer2 projects, with great improvements above both.
219+ '';
220+ license = licenses.gpl2Plus;
221+ maintainers = with maintainers; [ AndersonTorres fpletz globin ma27 tadeokondrak ];
222+ platforms = platforms.darwin ++ platforms.linux;
223+ };
255224}