about summary refs log tree commit diff
path: root/pkgs/applications/video/mpv/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/video/mpv/default.nix')
-rw-r--r--pkgs/applications/video/mpv/default.nix26
1 files changed, 5 insertions, 21 deletions
diff --git a/pkgs/applications/video/mpv/default.nix b/pkgs/applications/video/mpv/default.nix
index 6a8c3df0f35b..f7ac5ef58cdf 100644
--- a/pkgs/applications/video/mpv/default.nix
+++ b/pkgs/applications/video/mpv/default.nix
@@ -1,5 +1,5 @@
 { config, stdenv, fetchurl, fetchFromGitHub, makeWrapper
-, addOpenGLRunpath, docutils, perl, pkgconfig, python3, which
+, addOpenGLRunpath, docutils, perl, pkgconfig, python3, wafHook, which
 , ffmpeg_4, freefont_ttf, freetype, libass, libpthreadstubs, mujs
 , nv-codec-headers, lua, libuchardet, libiconv ? null, darwin
 
@@ -93,14 +93,6 @@ assert youtubeSupport     -> available youtube-dl;
 assert zimgSupport        -> available zimg;
 
 let
-  # Purity: Waf is normally downloaded by bootstrap.py, but
-  # for purity reasons this behavior should be avoided.
-  wafVersion = "2.0.9";
-  waf = fetchurl {
-    urls = [ "https://waf.io/waf-${wafVersion}"
-             "http://www.freehackers.org/~tnagy/release/waf-${wafVersion}" ];
-    sha256 = "0j7sbn3w6bgslvwwh5v9527w3gi2sd08kskrgxamx693y0b0i3ia";
-  };
   luaEnv = lua.withPackages (ps: with ps; [ luasocket ]);
 
 in stdenv.mkDerivation rec {
@@ -121,7 +113,7 @@ in stdenv.mkDerivation rec {
   NIX_LDFLAGS = optionalString x11Support "-lX11 -lXext "
               + optionalString stdenv.isDarwin "-framework CoreFoundation";
 
-  configureFlags = [
+  wafConfigureFlags = [
     "--enable-libmpv-shared"
     "--enable-manpage-build"
     "--disable-libmpv-static"
@@ -140,12 +132,8 @@ in stdenv.mkDerivation rec {
     (enableFeature stdenv.isLinux  "dvbin")
   ];
 
-  configurePhase = ''
-    python3 ${waf} configure --prefix=$out $configureFlags
-  '';
-
   nativeBuildInputs = [
-    addOpenGLRunpath docutils makeWrapper perl pkgconfig python3 which
+    addOpenGLRunpath docutils makeWrapper perl pkgconfig python3 wafHook which
   ];
 
   buildInputs = [
@@ -189,9 +177,7 @@ in stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  buildPhase = ''
-    python3 ${waf} build
-  '' + optionalString stdenv.isDarwin ''
+  postBuild = optionalString stdenv.isDarwin ''
     python3 TOOLS/osxbundle.py -s build/mpv
   '';
 
@@ -204,9 +190,7 @@ in stdenv.mkDerivation rec {
       --prefix PYTHONPATH : "${vapoursynth}/lib/${python3.libPrefix}/site-packages:$PYTHONPATH"
   '';
 
-  installPhase = ''
-    python3 ${waf} install
-
+  postInstall = ''
     # Use a standard font
     mkdir -p $out/share/mpv
     ln -s ${freefont_ttf}/share/fonts/truetype/FreeSans.ttf $out/share/mpv/subfont.ttf