about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorRahul Gopinath <rahul@gopinath.org>2016-06-29 10:38:10 -0700
committerRahul Gopinath <rahul@gopinath.org>2016-07-03 14:06:57 -0700
commiteef98f3e5123016f90c50d1f2c98f9cf619a4177 (patch)
treec0ef6457f27eafed3f7a0e35a582421f55994930 /pkgs
parent323eb0649929d1580ba1f8cc5812dba33f9e354b (diff)
zgv: init at 5.9
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/applications/graphics/zgv/default.nix39
-rw-r--r--pkgs/applications/graphics/zgv/switch.patch14
-rw-r--r--pkgs/top-level/all-packages.nix7
3 files changed, 60 insertions, 0 deletions
diff --git a/pkgs/applications/graphics/zgv/default.nix b/pkgs/applications/graphics/zgv/default.nix
new file mode 100644
index 0000000000000..46d3e117d0e76
--- /dev/null
+++ b/pkgs/applications/graphics/zgv/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchurl, fetchpatch, pkgconfig, SDL, SDL_image, libjpeg, libpng, libtiff }:
+
+stdenv.mkDerivation rec {
+  name = "zgv-${version}";
+  version = "5.9";
+  src = fetchurl {
+    url = "http://www.svgalib.org/rus/zgv/${name}.tar.gz";
+    sha256 = "1fk4i9x0cpnpn3llam0zy2pkmhlr2hy3iaxhxg07v9sizd4dircj";
+  };
+
+  buildInputs = [ SDL SDL_image pkgconfig libjpeg libpng libtiff ];
+
+  makeFlags = [
+    "BACKEND=SDL"
+  ];
+
+  patches = [
+    (fetchpatch {
+    url = https://foss.aueb.gr/mirrors/linux/gentoo/media-gfx/zgv/files/zgv-5.9-libpng15.patch;
+    sha256 = "1blw9n04c28bnwcmcn64si4f5zpg42s8yn345js88fyzi9zm19xw";
+    })
+    ./switch.patch
+  ];
+
+  patchFlags = "-p0";
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp src/zgv $out/bin
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = http://www.svgalib.org/rus/zgv/;
+    description = "Picture viewer with a thumbnail-based selector";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.vrthra ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/applications/graphics/zgv/switch.patch b/pkgs/applications/graphics/zgv/switch.patch
new file mode 100644
index 0000000000000..0b5ad092d72d7
--- /dev/null
+++ b/pkgs/applications/graphics/zgv/switch.patch
@@ -0,0 +1,14 @@
+GCC complains
+
+diff -ur src/zgv_io.c src/zgv_io.c
+--- src/zgv_io.c	2005-01-20 15:07:46.000000000 -0800
++++ src/zgv_io.c	2016-06-29 10:19:40.169897611 -0700
+@@ -645,7 +645,7 @@
+         case SDLK_INSERT:	return(RK_INSERT);
+         case SDLK_DELETE:	return(RK_DELETE);
+         case SDLK_RETURN:	return(RK_ENTER);
+-        default:
++        default: ;
+           /* stop complaints */
+         }
+ 
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 98da5f419933e..783988abd5f58 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -15062,6 +15062,13 @@ in
 
   zgrviewer = callPackage ../applications/graphics/zgrviewer {};
 
+  zgv = callPackage ../applications/graphics/zgv {
+   # Enable the below line for terminal display. Note
+   # that it requires sixel graphics compatible terminals like mlterm
+   # or xterm -ti 340
+   SDL = SDL_sixel;
+  };
+
   zim = callPackage ../applications/office/zim {
     pygtk = pyGtkGlade;
   };