summary refs log tree commit diff
path: root/pkgs/applications/misc/green-pdfviewer
diff options
context:
space:
mode:
authorRahul Gopinath <rahul@gopinath.org>2016-06-12 18:27:02 -0700
committerRahul Gopinath <rahul@gopinath.org>2016-06-12 20:27:45 -0700
commite19c5ce2e72c1930df663c7c7320691de8c35b6b (patch)
treefae1581ee95ea6b48cea6e5c244b97f651b4e504 /pkgs/applications/misc/green-pdfviewer
parentea8fb0aee53e121bb844201f6032c8d33b70dc16 (diff)
downloadnixpkgs-e19c5ce2e72c1930df663c7c7320691de8c35b6b.tar
nixpkgs-e19c5ce2e72c1930df663c7c7320691de8c35b6b.tar.gz
nixpkgs-e19c5ce2e72c1930df663c7c7320691de8c35b6b.tar.bz2
nixpkgs-e19c5ce2e72c1930df663c7c7320691de8c35b6b.tar.lz
nixpkgs-e19c5ce2e72c1930df663c7c7320691de8c35b6b.tar.xz
nixpkgs-e19c5ce2e72c1930df663c7c7320691de8c35b6b.tar.zst
nixpkgs-e19c5ce2e72c1930df663c7c7320691de8c35b6b.zip
green-pdf-viewer: init at nightly-2014-04-22
Green pdf viewer uses SDL and libpoppler to render pdf.
Diffstat (limited to 'pkgs/applications/misc/green-pdfviewer')
-rw-r--r--pkgs/applications/misc/green-pdfviewer/default.nix37
-rw-r--r--pkgs/applications/misc/green-pdfviewer/gdk-libs.patch55
2 files changed, 92 insertions, 0 deletions
diff --git a/pkgs/applications/misc/green-pdfviewer/default.nix b/pkgs/applications/misc/green-pdfviewer/default.nix
new file mode 100644
index 00000000000..03d333e59e6
--- /dev/null
+++ b/pkgs/applications/misc/green-pdfviewer/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, fetchFromGitHub, poppler, pkgconfig, gdk_pixbuf, SDL, gtk }:
+
+stdenv.mkDerivation rec {
+  name = "green-pdfviewer-${version}";
+  version = "nightly-2014-04-22";
+
+  src = fetchFromGitHub {
+    owner = "schandinat";
+    repo = "green";
+    rev = "0b516aec17915d9742d8e505d2ed383a3bdcea61";
+    sha256 = "0d0lv33flhgsxhc77kfp2avdz5gvml04r8l1j95yjz2rr096lzlj";
+  };
+
+  buildInputs = [ poppler pkgconfig gdk_pixbuf SDL gtk ];
+
+  patches = [
+    ./gdk-libs.patch
+  ];
+
+  buildPhase = ''
+    make PREFIX=$out
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin $out/share/man1
+    make install PREFIX=$out MANDIR=$out/share
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/schandinat/green/;
+    description = "Viewer for PDF files, uses SDL and libpoppler";
+
+    platforms = platforms.unix;
+    license  = licenses.gpl3;
+    maintainers = [ maintainers.vrthra ];
+  };
+}
diff --git a/pkgs/applications/misc/green-pdfviewer/gdk-libs.patch b/pkgs/applications/misc/green-pdfviewer/gdk-libs.patch
new file mode 100644
index 00000000000..cfcab32aac9
--- /dev/null
+++ b/pkgs/applications/misc/green-pdfviewer/gdk-libs.patch
@@ -0,0 +1,55 @@
+Common subdirectories: green.old/debian and green.new/debian
+diff -u green.old/green.h green.new/green.h
+--- green.old/green.h	2016-06-12 18:11:56.779434416 -0700
++++ green.new/green.h	2016-06-12 18:14:38.830557379 -0700
+@@ -19,7 +19,14 @@
+ 
+ 
+ #include <stdbool.h>
+-#include "glib/poppler.h"
++#include "poppler.h"
++#include "gdk-pixbuf/gdk-pixbuf.h"
++#include "gdk-pixbuf/gdk-pixbuf-core.h"
++#include "gdk-pixbuf/gdk-pixbuf-features.h"
++#include "gdk-pixbuf/gdk-pixbuf-enum-types.h"
++ 
++ #define GREEN_FULLSCREEN	0x0001
++ 
+ 
+ 
+ #define GREEN_FULLSCREEN	0x0001
+diff -u green.old/Makefile green.new/Makefile
+--- green.old/Makefile	2016-06-12 18:11:56.779434416 -0700
++++ green.new/Makefile	2016-06-12 18:13:09.591974048 -0700
+@@ -17,6 +17,12 @@
+ SDL_CFLAGS	:=	$$(sdl-config --cflags)
+ SDL_LIBS	:=	$$(sdl-config --libs)
+ 
++GDKPIXBUF_CFLAGS	:=	$$(pkg-config gdk-pixbuf-2.0 --cflags)
++GDKPIXBUF_LIBS	:=	$$(pkg-config gdk-pixbuf-2.0 --libs)
++
++GTK_CFLAGS	:=	$$(pkg-config gtk+-2.0 --cflags)
++GTK_LIBS	:=	$$(pkg-config gtk+-2.0 --libs)
++
+ 
+ all: green
+ 
+@@ -28,13 +34,14 @@
+ 	$(INSTALL) green.1 $(MANDIR)/man1/
+ 
+ green: main.o green.o sdl.o
+-	$(CC) $^ $(POPPLER_LIBS) $(SDL_LIBS) -o $@
++	$(CC) $^ $(POPPLER_LIBS) $(SDL_LIBS) $(GDKPIXBUF_LIBS) $(GTK_LIBS) -o $@
+ 
+ main.o: main.c green.h
+-	$(CC) $(CONFIG) $(CFLAGS) -c $< $(POPPLER_CFLAGS) -o $@
++	$(CC) $(CONFIG) $(CFLAGS) $(GDKPIXBUF_CFLAGS) -c $< $(POPPLER_CFLAGS) -o $@
+ 
+ green.o: green.c green.h
+-	$(CC) $(CFLAGS) -c $< $(POPPLER_CFLAGS) -o $@
++	$(CC) $(CFLAGS) -c $< $(POPPLER_CFLAGS)  $(GDKPIXBUF_CFLAGS) -o $@
+ 
+ sdl.o: sdl.c green.h
+-	$(CC) $(CFLAGS) -c $< $(POPPLER_CFLAGS) $(SDL_CFLAGS) -o $@
++	$(CC) $(CFLAGS) -c $< $(POPPLER_CFLAGS) $(SDL_CFLAGS) $(GDKPIXBUF_CFLAGS) $(GTK_CFLAGS) -o $@
++