From 5878ffa55b31317e8284cad8d5bae0f240d406bd Mon Sep 17 00:00:00 2001
From: Petr Rockai <me@mornfall.net>
Date: Tue, 28 Jan 2014 21:45:52 +0100
Subject: [PATCH] quvi: Update to current upstream (0.9.4).

---
 pkgs/applications/video/quvi/library.nix | 10 +++++-----
 pkgs/applications/video/quvi/scripts.nix |  6 +++---
 pkgs/applications/video/quvi/tool.nix    | 17 ++++++++++-------
 3 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/pkgs/applications/video/quvi/library.nix b/pkgs/applications/video/quvi/library.nix
index 49207ad0661..0fdd78fe106 100644
--- a/pkgs/applications/video/quvi/library.nix
+++ b/pkgs/applications/video/quvi/library.nix
@@ -1,15 +1,15 @@
-{stdenv, fetchurl, pkgconfig, lua5, curl, quvi_scripts}:
+{stdenv, fetchurl, pkgconfig, lua5, curl, quvi_scripts, libproxy, libgcrypt}:
 
 stdenv.mkDerivation rec {
   name = "libquvi-${version}";
-  version="0.4.0";
+  version="0.9.4";
 
   src = fetchurl {
-    url = "mirror://sourceforge/quvi/libquvi-${version}.tar.gz";
-    sha256 = "15cm9j8dssn2zhplqvlw49piwfw511lia6b635byiwfniqf6dnwp";
+    url = "mirror://sourceforge/quvi/libquvi-${version}.tar.xz";
+    sha256 = "1cl1kbgxl1jnx2nwx4z90l0lap09lnnj1fg7hxsxk3m6aj4y4grd";
   };
 
-  buildInputs = [ pkgconfig lua5 curl quvi_scripts ];
+  buildInputs = [ pkgconfig lua5 curl quvi_scripts libproxy libgcrypt ];
 
   meta = { 
     description = "Web video downloader";
diff --git a/pkgs/applications/video/quvi/scripts.nix b/pkgs/applications/video/quvi/scripts.nix
index cc82158ae82..68b61fc453d 100644
--- a/pkgs/applications/video/quvi/scripts.nix
+++ b/pkgs/applications/video/quvi/scripts.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "quvi-scripts-${version}";
-  version="0.4.0";
+  version="0.9.20131130";
 
   src = fetchurl {
-    url = "mirror://sourceforge/quvi/libquvi-scripts-${version}.tar.gz";
-    sha256 = "14p1sn7id4n35isaw3i3h8vsgfqlym09fih9k5xfqwsg6n7xdvq5";
+    url = "mirror://sourceforge/quvi/libquvi-scripts-${version}.tar.xz";
+    sha256 = "1qvp6z5k1qgcys7vf7jd6fm0g07xixmciwj14ypn1kqhmjgizwhp";
   };
 
   buildInputs = [ pkgconfig ];
diff --git a/pkgs/applications/video/quvi/tool.nix b/pkgs/applications/video/quvi/tool.nix
index f8b6aad4310..89e24cff4de 100644
--- a/pkgs/applications/video/quvi/tool.nix
+++ b/pkgs/applications/video/quvi/tool.nix
@@ -1,22 +1,25 @@
-{stdenv, fetchurl, pkgconfig, lua5, curl, quvi_scripts, libquvi}:
+{stdenv, fetchurl, pkgconfig, lua5, curl, quvi_scripts, libquvi, lua5_sockets, glib, makeWrapper}:
 
 stdenv.mkDerivation rec {
   name = "quvi-${version}";
-  version="0.4.0";
+  version="0.9.4";
 
   src = fetchurl {
-    url = "mirror://sourceforge/quvi/quvi-${version}.tar.gz";
-    sha256 = "0qzyj55py4z7pg97794jjycq8nvrlr02072rgjzg8jgknw49hgfv";
+    url = "mirror://sourceforge/quvi/quvi-${version}.tar.xz";
+    sha256 = "047rrwnnp72624z2px5nzn5wxi5fyckkddh2pj8j5xs6kdim429m";
   };
 
-  buildInputs = [ pkgconfig lua5 curl quvi_scripts libquvi ];
+  buildInputs = [ pkgconfig lua5 curl quvi_scripts libquvi glib makeWrapper ];
+  postInstall = ''
+      wrapProgram $out/bin/quvi --set LUA_PATH "${lua5_sockets}/share/lua/${lua5.luaversion}/?.lua"
+  '';
 
-  meta = { 
+  meta = {
     description = "Web video downloader";
     homepage = http://quvi.sf.net;
     license = "LGPLv2.1+";
     platforms = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.mornfall ]; 
+    maintainers = [ stdenv.lib.maintainers.mornfall ];
   };
 }