From 41c1a621136fb17a17fb033be3c55e92ff56b6ce Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Tue, 27 Feb 2018 17:27:46 +0100 Subject: [PATCH 1/4] mpv: clean up options --- pkgs/applications/video/mpv/default.nix | 29 ++++++++++++++----------- pkgs/top-level/all-packages.nix | 14 ++++++++---- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/pkgs/applications/video/mpv/default.nix b/pkgs/applications/video/mpv/default.nix index 403fc7e4ee1..8bd9f985659 100644 --- a/pkgs/applications/video/mpv/default.nix +++ b/pkgs/applications/video/mpv/default.nix @@ -13,25 +13,25 @@ wayland ? null, libxkbcommon ? null -, rubberbandSupport ? !stdenv.isDarwin, rubberband ? null +, rubberbandSupport ? true, rubberband ? null , xineramaSupport ? true, libXinerama ? null , xvSupport ? true, libXv ? null , sdl2Support ? true, SDL2 ? null -, alsaSupport ? !stdenv.isDarwin, alsaLib ? null +, alsaSupport ? true, alsaLib ? null , screenSaverSupport ? true, libXScrnSaver ? null , vdpauSupport ? true, libvdpau ? null -, dvdreadSupport ? !stdenv.isDarwin, libdvdread ? null -, dvdnavSupport ? dvdreadSupport, libdvdnav ? null +, dvdreadSupport ? true, libdvdread ? null +, dvdnavSupport ? true, libdvdnav ? null , bluraySupport ? true, libbluray ? null , speexSupport ? true, speex ? null , theoraSupport ? true, libtheora ? null -, pulseSupport ? !stdenv.isDarwin, libpulseaudio ? null +, pulseSupport ? true, libpulseaudio ? null , bs2bSupport ? true, libbs2b ? null , cacaSupport ? true, libcaca ? null , libpngSupport ? true, libpng ? null , youtubeSupport ? true, youtube-dl ? null , vaapiSupport ? true, libva ? null -, drmSupport ? !stdenv.isDarwin, libdrm ? null +, drmSupport ? true, libdrm ? null , vapoursynthSupport ? false, vapoursynth ? null , archiveSupport ? false, libarchive ? null , jackaudioSupport ? false, libjack2 ? null @@ -127,14 +127,15 @@ in stdenv.mkDerivation rec { python3 ${waf} configure --prefix=$out $configureFlags ''; - nativeBuildInputs = [ docutils makeWrapper perl pkgconfig python3 which ]; + nativeBuildInputs = [ + docutils makeWrapper perl + pkgconfig python3 which + ]; buildInputs = [ ffmpeg freetype libass libpthreadstubs - lua lua5_sockets libuchardet - ] ++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ - libiconv Cocoa CoreAudio ]) - ++ optional alsaSupport alsaLib + lua luasocket libuchardet + ] ++ optional alsaSupport alsaLib ++ optional xvSupport libXv ++ optional theoraSupport libtheora ++ optional xineramaSupport libXinerama @@ -157,7 +158,10 @@ in stdenv.mkDerivation rec { ++ optional archiveSupport libarchive ++ optionals dvdnavSupport [ libdvdnav libdvdnav.libdvdread ] ++ optionals x11Support [ libX11 libXext mesa libXxf86vm ] - ++ optionals waylandSupport [ wayland libxkbcommon ]; + ++ optionals waylandSupport [ wayland libxkbcommon ] + ++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ + libiconv Cocoa CoreAudio + ]); enableParallelBuilding = true; @@ -199,5 +203,4 @@ in stdenv.mkDerivation rec { ''; }; } -# TODO: investigate caca support # TODO: investigate lua5_sockets bug diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d92d2b46bdb..3dd0dce1470 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16541,11 +16541,17 @@ with pkgs; }; mpv = callPackage ../applications/video/mpv rec { - lua = lua5_1; + lua = lua5_1; lua5_sockets = lua5_1_sockets; - youtube-dl = pythonPackages.youtube-dl; - libva = libva-full; - waylandSupport = stdenv.isLinux; + youtube-dl = pythonPackages.youtube-dl; + libva = libva-full; + waylandSupport = stdenv.isLinux; + alsaSupport = !stdenv.isDarwin; + pulseSupport = !stdenv.isDarwin; + rubberbandSupport = !stdenv.isDarwin; + dvdreadSupport = !stdenv.isDarwin; + dvdnavSupport = !stdenv.isDarwin; + drmSupport = !stdenv.isDarwin; }; mpvScripts = { From ab59f0df8d6f10a6f00dbde641a921bf562398d8 Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Tue, 27 Feb 2018 17:29:05 +0100 Subject: [PATCH 2/4] mpv: add luasocket path --- pkgs/applications/video/mpv/default.nix | 14 +++++++++++--- pkgs/top-level/all-packages.nix | 7 +++---- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/video/mpv/default.nix b/pkgs/applications/video/mpv/default.nix index 8bd9f985659..1616665b75d 100644 --- a/pkgs/applications/video/mpv/default.nix +++ b/pkgs/applications/video/mpv/default.nix @@ -1,7 +1,7 @@ { stdenv, fetchurl, fetchFromGitHub, fetchpatch, makeWrapper , docutils, perl, pkgconfig, python3, which, ffmpeg , freefont_ttf, freetype, libass, libpthreadstubs -, lua, lua5_sockets, libuchardet, libiconv ? null, darwin +, lua, luasocket, libuchardet, libiconv ? null, darwin , x11Support ? true, mesa ? null, @@ -169,7 +169,14 @@ in stdenv.mkDerivation rec { python3 ${waf} build ''; - installPhase = '' + installPhase = + let + getPath = type : "${luasocket}/lib/lua/${lua.luaversion}/?.${type};" + + "${luasocket}/share/lua/${lua.luaversion}/?.${type}"; + luaPath = getPath "lua"; + luaCPath = getPath "so"; + in + '' python3 ${waf} install # Use a standard font @@ -178,6 +185,8 @@ in stdenv.mkDerivation rec { # Ensure youtube-dl is available in $PATH for MPV wrapProgram $out/bin/mpv \ --add-flags "--scripts=${concatStringsSep "," scripts}" \ + --prefix LUA_PATH : "${luaPath}" \ + --prefix LUA_CPATH : "${luaCPath}" \ '' + optionalString youtubeSupport '' --prefix PATH : "${youtube-dl}/bin" \ '' + optionalString vapoursynthSupport '' @@ -203,4 +212,3 @@ in stdenv.mkDerivation rec { ''; }; } -# TODO: investigate lua5_sockets bug diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3dd0dce1470..c14cfb64913 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16541,10 +16541,9 @@ with pkgs; }; mpv = callPackage ../applications/video/mpv rec { - lua = lua5_1; - lua5_sockets = lua5_1_sockets; - youtube-dl = pythonPackages.youtube-dl; - libva = libva-full; + inherit (luaPackages) luasocket; + youtube-dl = pythonPackages.youtube-dl; + libva = libva-full; waylandSupport = stdenv.isLinux; alsaSupport = !stdenv.isDarwin; pulseSupport = !stdenv.isDarwin; From 1ec8eb94ee68e60ac132e690619843bc57e8f13c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 27 Feb 2018 23:58:20 +0000 Subject: [PATCH 3/4] mpv: also disable x11support on darwin --- pkgs/top-level/all-packages.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c14cfb64913..c19902d0a88 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16551,6 +16551,7 @@ with pkgs; dvdreadSupport = !stdenv.isDarwin; dvdnavSupport = !stdenv.isDarwin; drmSupport = !stdenv.isDarwin; + x11Support = !stdenv.isDarwin; }; mpvScripts = { From c269fc884a8dfadc4afcd3e28dd78dbf8e0bb755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Wed, 28 Feb 2018 00:02:58 +0000 Subject: [PATCH 4/4] mpv: also disable xineramaSupport & xvSupport on darwin --- pkgs/top-level/all-packages.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c19902d0a88..b8d50ab68b3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16552,6 +16552,8 @@ with pkgs; dvdnavSupport = !stdenv.isDarwin; drmSupport = !stdenv.isDarwin; x11Support = !stdenv.isDarwin; + xineramaSupport = !stdenv.isDarwin; + xvSupport = !stdenv.isDarwin; }; mpvScripts = {