summary refs log tree commit diff
path: root/pkgs/applications/misc/zathura
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/misc/zathura')
-rw-r--r--pkgs/applications/misc/zathura/builder.sh11
-rw-r--r--pkgs/applications/misc/zathura/core/default.nix29
-rw-r--r--pkgs/applications/misc/zathura/default.nix64
-rw-r--r--pkgs/applications/misc/zathura/djvu/default.nix28
-rw-r--r--pkgs/applications/misc/zathura/djvu/gtkflags.patch23
-rw-r--r--pkgs/applications/misc/zathura/pdf-poppler/default.nix25
-rw-r--r--pkgs/applications/misc/zathura/ps/default.nix28
-rw-r--r--pkgs/applications/misc/zathura/ps/gtkflags.patch25
8 files changed, 208 insertions, 25 deletions
diff --git a/pkgs/applications/misc/zathura/builder.sh b/pkgs/applications/misc/zathura/builder.sh
new file mode 100644
index 000000000000..9ca45b2cc992
--- /dev/null
+++ b/pkgs/applications/misc/zathura/builder.sh
@@ -0,0 +1,11 @@
+source $stdenv/setup
+
+mkdir -pv $out/bin/
+
+cat > $out/bin/zathura <<EOF
+#!/bin/sh
+exec $zathura --plugins-dir=$plugins_path "\$@"
+EOF
+
+chmod 755 $out/bin/zathura
+
diff --git a/pkgs/applications/misc/zathura/core/default.nix b/pkgs/applications/misc/zathura/core/default.nix
new file mode 100644
index 000000000000..0c58965fc19f
--- /dev/null
+++ b/pkgs/applications/misc/zathura/core/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchurl, pkgconfig, gtk, girara, gettext }:
+
+stdenv.mkDerivation rec {
+
+  version = "0.1.2";
+
+  name = "zathura-core-${version}";
+
+  src = fetchurl {
+    url = "http://pwmt.org/projects/zathura/download/zathura-${version}.tar.gz";
+    sha256 = "a496c25071e54f675b65ee5eab02fd002c04c2d7d5cf4aa8a1cb517cc13beaef";
+  };
+
+  buildInputs = [ pkgconfig gtk girara gettext ];
+
+  makeFlags = "PREFIX=$(out)";
+
+  meta = {
+    homepage = http://pwmt.org/projects/zathura/;
+    description = "A core component for zathura PDF viewer";
+    license = "free";
+    platforms = stdenv.lib.platforms.linux;
+
+    # Set lower priority in order to provide user with a wrapper script called
+    # 'zathura' instead of real zathura executable. The wrapper will build
+    # plugin path argument before executing the original.
+    priority = 1;
+  };
+}
diff --git a/pkgs/applications/misc/zathura/default.nix b/pkgs/applications/misc/zathura/default.nix
index 2e58a028a30f..b5ba4f9ada75 100644
--- a/pkgs/applications/misc/zathura/default.nix
+++ b/pkgs/applications/misc/zathura/default.nix
@@ -1,27 +1,41 @@
-{ stdenv, fetchurl, pkgconfig, gtk, poppler }:
-
-stdenv.mkDerivation rec {
-  name = "zathura-0.0.8.4";
-  
-  src = fetchurl {
-    url = "http://pwmt.org/download/${name}.tar.gz";
-    sha256 = "03iq6n7bpgrkq3l8b2ab3flcfxrqpxc1f3ycn31xr2b6bjwi72qn";
-  };
-  
-  buildInputs = [ pkgconfig gtk poppler ];
-
-  makeFlags = "PREFIX=$(out)";
-  
-  meta = {
-    homepage = https://pwmt.org/zathura/;
-    description = "A highly customizable and functional PDF viewer";
-    longDescription = ''
-      Zathura is a highly customizable and functional PDF viewer based on the
-      poppler rendering library and the gtk+ toolkit. The idea behind zathura
-      is an application that provides a minimalistic and space saving interface
-      as well as an easy usage that mainly focuses on keyboard interaction.
-    '';
-    license = "free";
-    platforms = stdenv.lib.platforms.linux;
+{ callPackage, pkgs }:
+
+rec {
+  inherit (pkgs) stdenv;
+
+  zathura_core = callPackage ./core { };
+
+  zathura_pdf_poppler = callPackage ./pdf-poppler { };
+
+  zathura_djvu = callPackage ./djvu { };
+
+  zathura_ps = callPackage ./ps { };
+
+  zathuraWrapper = stdenv.mkDerivation rec {
+
+    name = "zathura-0.1.2";
+
+    plugins_path = stdenv.lib.makeSearchPath "lib" [
+      zathura_pdf_poppler
+      zathura_djvu
+      zathura_ps
+    ];
+
+    zathura = "${zathura_core}/bin/zathura";
+
+    builder = ./builder.sh;
+
+    meta = {
+      homepage = http://pwmt.org/projects/zathura/;
+      description = "A highly customizable and functional PDF viewer";
+      longDescription = ''
+        Zathura is a highly customizable and functional PDF viewer based on the
+        poppler rendering library and the gtk+ toolkit. The idea behind zathura
+        is an application that provides a minimalistic and space saving interface
+        as well as an easy usage that mainly focuses on keyboard interaction.
+      '';
+      license = "free";
+    };
   };
 }
+
diff --git a/pkgs/applications/misc/zathura/djvu/default.nix b/pkgs/applications/misc/zathura/djvu/default.nix
new file mode 100644
index 000000000000..c4656e732364
--- /dev/null
+++ b/pkgs/applications/misc/zathura/djvu/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchurl, pkgconfig, gtk, zathura_core, girara, djvulibre, gettext }:
+
+stdenv.mkDerivation rec {
+  name = "zathura-djvu-0.1.1";
+
+  src = fetchurl {
+    url = "http://pwmt.org/projects/zathura/plugins/download/${name}.tar.gz";
+    sha256 = "04adad7bf1bb392eae4b7b856fe7d40a137f8185ac274289df922758ae827172";
+  };
+
+  buildInputs = [ pkgconfig djvulibre gettext zathura_core gtk girara ];
+
+  patches = [ ./gtkflags.patch ];
+
+  makeFlags = "PREFIX=$(out) PLUGINDIR=$(out)/lib";
+
+  meta = {
+    homepage = http://pwmt.org/projects/zathura/;
+    description = "A zathura DJVU plugin";
+    longDescription = ''
+	  The zathura-djvu plugin adds DjVu support to zathura by using the
+	  djvulibre library.
+    '';
+    license = "free";
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
+
diff --git a/pkgs/applications/misc/zathura/djvu/gtkflags.patch b/pkgs/applications/misc/zathura/djvu/gtkflags.patch
new file mode 100644
index 000000000000..2a2fe298a7b9
--- /dev/null
+++ b/pkgs/applications/misc/zathura/djvu/gtkflags.patch
@@ -0,0 +1,23 @@
+--- a/config.mk	2012-05-14 01:13:09.009740082 +0400
++++ b/config.mk	2012-05-14 01:13:50.400525700 +0400
+@@ -11,6 +11,9 @@
+ LIBDIR ?= ${PREFIX}/lib
+ 
+ # libs
++GTK_INC ?= $(shell pkg-config --cflags gtk+-2.0)
++GTK_LIB ?= $(shell pkg-config --libs gtk+-2.0)
++
+ CAIRO_INC ?= $(shell pkg-config --cflags cairo)
+ CAIRO_LIB ?= $(shell pkg-config --libs cairo)
+ 
+@@ -29,8 +32,8 @@
+ PLUGINDIR = ${LIBDIR}/zathura
+ endif
+ 
+-INCS = ${GIRARA_INC} ${GLIB_INC} ${DJVU_INC} ${ZATHURA_INC}
+-LIBS = ${GIRARA_LIB} ${GLIB_LIB} ${DJVU_LIB}
++INCS = ${GIRARA_INC} ${GLIB_INC} ${DJVU_INC} ${ZATHURA_INC} ${GTK_INC}
++LIBS = ${GIRARA_LIB} ${GLIB_LIB} ${DJVU_LIB} ${GTK_LIB}
+ 
+ # flags
+ CFLAGS += -std=c99 -fPIC -pedantic -Wall -Wno-format-zero-length $(INCS)
diff --git a/pkgs/applications/misc/zathura/pdf-poppler/default.nix b/pkgs/applications/misc/zathura/pdf-poppler/default.nix
new file mode 100644
index 000000000000..17e00b4e6220
--- /dev/null
+++ b/pkgs/applications/misc/zathura/pdf-poppler/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchurl, pkgconfig, zathura_core, girara, poppler, gettext }:
+
+stdenv.mkDerivation rec {
+  name = "zathura-pdf-poppler-0.1.1";
+
+  src = fetchurl {
+    url = "http://pwmt.org/projects/zathura/plugins/download/${name}.tar.gz";
+    sha256 = "bec5fee721fcaee9f4b53d3882908b19efa82815393aa8c3619ff948b909d4a7";
+  };
+
+  buildInputs = [ pkgconfig poppler gettext zathura_core girara ];
+
+  makeFlags = "PREFIX=$(out) PLUGINDIR=$(out)/lib";
+
+  meta = {
+    homepage = http://pwmt.org/projects/zathura/;
+    description = "A zathura PDF plugin";
+    longDescription = ''
+      The zathura-pdf-poppler plugin adds PDF support to zathura by 
+      using the poppler rendering engine.
+    '';
+    license = "free";
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/misc/zathura/ps/default.nix b/pkgs/applications/misc/zathura/ps/default.nix
new file mode 100644
index 000000000000..ae9aeee7715e
--- /dev/null
+++ b/pkgs/applications/misc/zathura/ps/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchurl, pkgconfig, gtk, zathura_core, girara, libspectre, gettext }:
+
+stdenv.mkDerivation rec {
+  name = "zathura-ps-0.1.0";
+
+  src = fetchurl {
+    url = "http://pwmt.org/projects/zathura/plugins/download/${name}.tar.gz";
+    sha256 = "1669fd11e436636cdedb2cde206b562f4f9c666cea9773f6f2014e765fd62789";
+  };
+
+  buildInputs = [ pkgconfig libspectre gettext zathura_core gtk girara ];
+
+  patches = [ ./gtkflags.patch ];
+
+  makeFlags = "PREFIX=$(out) PLUGINDIR=$(out)/lib";
+
+  meta = {
+    homepage = http://pwmt.org/projects/zathura/;
+    description = "A zathura PS plugin";
+    longDescription = ''
+      The zathura-ps plugin adds PS support to zathura by using the
+      libspectre library.
+      '';
+    license = "free";
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
+
diff --git a/pkgs/applications/misc/zathura/ps/gtkflags.patch b/pkgs/applications/misc/zathura/ps/gtkflags.patch
new file mode 100644
index 000000000000..7c944a12f0ef
--- /dev/null
+++ b/pkgs/applications/misc/zathura/ps/gtkflags.patch
@@ -0,0 +1,25 @@
+diff --git a/config.mk b/config.mk.new
+index c3a7b37..0cbce67 100644
+--- a/config.mk
++++ b/config.mk
+@@ -10,6 +10,9 @@ ZATHURA_VERSION_CHECK ?= $(shell pkg-config --atleast-version=$(ZATHURA_MIN_VERS
+ PREFIX ?= /usr
+ 
+ # libs
++GTK_INC ?= $(shell pkg-config --cflags gtk+-2.0)
++GTK_LIB ?= $(shell pkg-config --libs gtk+-2.0)
++
+ CAIRO_INC ?= $(shell pkg-config --cflags cairo)
+ CAIRO_LIB ?= $(shell pkg-config --libs cairo)
+ 
+@@ -26,8 +29,8 @@ ZATHURA_INC ?= $(shell pkg-config --cflags zathura)
+ PLUGINDIR ?= $(shell pkg-config --variable=plugindir zathura)
+ PLUGINDIR ?= ${PREFIX}/lib/zathura
+ 
+-INCS = ${GLIB_INC} ${SPECTRE_INC} ${GIRARA_INC} ${ZATHURA_INC}
+-LIBS = ${GLIB_LIB} ${SPECTRE_LIB} ${GIRARA_LIB}
++INCS = ${GLIB_INC} ${SPECTRE_INC} ${GIRARA_INC} ${ZATHURA_INC} ${GTK_INC}
++LIBS = ${GLIB_LIB} ${SPECTRE_LIB} ${GIRARA_LIB} ${GTK_LIB}
+ 
+ # flags
+ CFLAGS += -std=c99 -fPIC -pedantic -Wall -Wno-format-zero-length $(INCS)