summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorJoachim Fasting <joachifm@users.noreply.github.com>2016-06-17 03:58:06 +0200
committerGitHub <noreply@github.com>2016-06-17 03:58:06 +0200
commit552c2e5b089cb1c331452f1d2cc0eda006a801d6 (patch)
tree4ff693db77e919b4da9e595a0dd237e61933a304 /pkgs
parent16bbfe893b25565971ab8a372d30be2f84206583 (diff)
parente19c5ce2e72c1930df663c7c7320691de8c35b6b (diff)
downloadnixlib-552c2e5b089cb1c331452f1d2cc0eda006a801d6.tar
nixlib-552c2e5b089cb1c331452f1d2cc0eda006a801d6.tar.gz
nixlib-552c2e5b089cb1c331452f1d2cc0eda006a801d6.tar.bz2
nixlib-552c2e5b089cb1c331452f1d2cc0eda006a801d6.tar.lz
nixlib-552c2e5b089cb1c331452f1d2cc0eda006a801d6.tar.xz
nixlib-552c2e5b089cb1c331452f1d2cc0eda006a801d6.tar.zst
nixlib-552c2e5b089cb1c331452f1d2cc0eda006a801d6.zip
Merge pull request #16205 from vrthra/green
SDL_sixel: Init at 1.2-nightly
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/applications/misc/green-pdfviewer/default.nix37
-rw-r--r--pkgs/applications/misc/green-pdfviewer/gdk-libs.patch55
-rw-r--r--pkgs/development/libraries/SDL_sixel/default.nix25
-rw-r--r--pkgs/top-level/all-packages.nix6
4 files changed, 123 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 000000000000..03d333e59e67
--- /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 000000000000..cfcab32aac99
--- /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 $@
++
diff --git a/pkgs/development/libraries/SDL_sixel/default.nix b/pkgs/development/libraries/SDL_sixel/default.nix
new file mode 100644
index 000000000000..5b8e887c2eee
--- /dev/null
+++ b/pkgs/development/libraries/SDL_sixel/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchFromGitHub, pkgconfig, libsixel }:
+
+stdenv.mkDerivation rec {
+  name    = "SDL_sixel-${version}";
+  version = "1.2-nightly";
+
+  src = fetchFromGitHub {
+    owner = "saitoha";
+    repo = "SDL1.2-SIXEL";
+    rev = "ab3fccac6e34260a617be511bd8c2b2beae41952";
+    sha256 = "0gm2vngdac17lzw9azkhzazmfq3byjddms14gqjk18vnynfqp5wp";
+  };
+
+  configureFlags = [ "--enable-video-sixel" ];
+
+  buildInputs = [ pkgconfig libsixel ];
+
+  meta = with stdenv.lib; {
+    description = "A cross-platform multimedia library, that supports sixel graphics on consoles";
+    homepage    = https://github.com/saitoha/SDL1.2-SIXEL;
+    maintainers = with maintainers; [ vrthra ];
+    platforms   = platforms.linux;
+    license     = licenses.lgpl21;
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 7e20a8cae894..bf5d6273b08d 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -475,6 +475,10 @@ in
 
   grc = callPackage ../tools/misc/grc { };
 
+  green-pdfviewer = callPackage ../applications/misc/green-pdfviewer {
+   SDL = SDL_sixel;
+  };
+
   lastpass-cli = callPackage ../tools/security/lastpass-cli { };
 
   pass = callPackage ../tools/security/pass { };
@@ -8991,6 +8995,8 @@ in
     inherit (darwin.apple_sdk.frameworks) OpenGL CoreAudio CoreServices AudioUnit Kernel Cocoa;
   };
 
+  SDL_sixel = callPackage ../development/libraries/SDL_sixel { };
+
   SDL_gfx = callPackage ../development/libraries/SDL_gfx { };
 
   SDL_image = callPackage ../development/libraries/SDL_image { };