[Nix-dev] pypoppler: new package

Anonymous Remailer (austria) mixmaster at remailer.privacy.at
Mon Sep 8 04:32:30 CEST 2014


pypoppler: new package
---

diff --git a/pkgs/development/python-modules/pypoppler-more-tweaking.patch b/pkgs/development/python-modules/pypoppler-more-tweaking.patch
new file mode 100644
index 0000000..d7e9cba
--- /dev/null
+++ b/pkgs/development/python-modules/pypoppler-more-tweaking.patch
@@ -0,0 +1,62 @@
+diff -Naur a/poppler.defs b/poppler.defs
+--- a/poppler.defs	2009-09-27 18:07:59.000000000 +0900
++++ b/poppler.defs	2014-08-28 15:32:29.019363070 +0900
+@@ -1646,58 +1646,6 @@
+   (return-type "GType")
+ )
+ 
+-(define-method render_to_pixbuf
+-  (of-object "PopplerPage")
+-  (c-name "poppler_page_render_to_pixbuf")
+-  (return-type "none")
+-  (parameters
+-    '("int" "src_x")
+-    '("int" "src_y")
+-    '("int" "src_width")
+-    '("int" "src_height")
+-    '("double" "scale")
+-    '("int" "rotation")
+-    '("GdkPixbuf*" "pixbuf")
+-  )
+-)
+-
+-(define-method render_to_pixbuf_for_printing
+-  (of-object "PopplerPage")
+-  (c-name "poppler_page_render_to_pixbuf_for_printing")
+-  (return-type "none")
+-  (parameters
+-    '("int" "src_x")
+-    '("int" "src_y")
+-    '("int" "src_width")
+-    '("int" "src_height")
+-    '("double" "scale")
+-    '("int" "rotation")
+-    '("GdkPixbuf*" "pixbuf")
+-  )
+-)
+-
+-(define-method get_thumbnail_pixbuf
+-  (of-object "PopplerPage")
+-  (c-name "poppler_page_get_thumbnail_pixbuf")
+-  (return-type "GdkPixbuf*")
+-)
+-
+-(define-method render_selection_to_pixbuf
+-  (of-object "PopplerPage")
+-  (c-name "poppler_page_render_selection_to_pixbuf")
+-  (return-type "none")
+-  (parameters
+-    '("gdouble" "scale")
+-    '("int" "rotation")
+-    '("GdkPixbuf*" "pixbuf")
+-    '("PopplerRectangle*" "selection")
+-    '("PopplerRectangle*" "old_selection")
+-    '("PopplerSelectionStyle" "style")
+-    '("GdkColor*" "glyph_color")
+-    '("GdkColor*" "background_color")
+-  )
+-)
+-
+ (define-method render
+   (of-object "PopplerPage")
+   (c-name "poppler_page_render")
diff --git a/pkgs/development/python-modules/pypoppler-tweak.patch b/pkgs/development/python-modules/pypoppler-tweak.patch
new file mode 100644
index 0000000..bee8113
--- /dev/null
+++ b/pkgs/development/python-modules/pypoppler-tweak.patch
@@ -0,0 +1,57 @@
+diff -Naur a/configure b/configure
+--- a/configure	2009-09-27 06:07:56.000000000 +0900
++++ b/configure	2014-08-27 21:18:13.163125058 +0900
+@@ -13507,12 +13507,11 @@
+ 
+ 
+ 
+-
+ { $as_echo "$as_me:$LINENO: checking for pygtk codegen" >&5
+ $as_echo_n "checking for pygtk codegen... " >&6; }
+-CODEGENDIR=`pkg-config --variable=codegendir pygtk-2.0`
+-if test -f $CODEGENDIR/codegen.py; then
+-	CODEGEN=$CODEGENDIR/codegen.py
++PYGTK_DIR=`pkg-config --variable=prefix pygtk-2.0`
++if test -f $PYGTK_DIR/bin/pygtk-codegen-2.0; then
++	CODEGEN=$PYGTK_DIR/bin/pygtk-codegen-2.0
+ 	{ $as_echo "$as_me:$LINENO: result: yes" >&5
+ $as_echo "yes" >&6; }
+ else
+diff -Naur a/Makefile.am b/Makefile.am
+--- a/Makefile.am	2009-09-27 03:31:23.000000000 +0900
++++ b/Makefile.am	2014-08-27 21:18:07.482095531 +0900
+@@ -19,7 +19,7 @@
+ 
+ .defs.c:
+ 	(cd $(srcdir)\
+-	&& $(PYTHON) $(CODEGEN) \
++	&& $(CODEGEN) \
+ 		--override $*.override \
+ 		--register @PYGTK_DATADIR@/pygtk/2.0/defs/gdk-types.defs \
+ 		--register @PYGTK_DATADIR@/pygtk/2.0/defs/pango-types.defs \
+diff -Naur a/Makefile.in b/Makefile.in
+--- a/Makefile.in	2009-09-27 06:07:55.000000000 +0900
++++ b/Makefile.in	2014-08-27 21:18:08.057098519 +0900
+@@ -881,7 +881,7 @@
+ 
+ .defs.c:
+ 	(cd $(srcdir)\
+-	&& $(PYTHON) $(CODEGEN) \
++	&& $(CODEGEN) \
+ 		--override $*.override \
+ 		--register @PYGTK_DATADIR@/pygtk/2.0/defs/gdk-types.defs \
+ 		--register @PYGTK_DATADIR@/pygtk/2.0/defs/pango-types.defs \
+diff -Naur a/poppler.defs b/poppler.defs
+--- a/poppler.defs	2009-09-27 18:07:59.000000000 +0900
++++ b/poppler.defs	2014-08-27 21:26:53.623859641 +0900
+@@ -1796,10 +1796,6 @@
+   (of-object "PopplerPage")
+   (c-name "poppler_page_get_text")
+   (return-type "char*")
+-  (parameters
+-    '("PopplerSelectionStyle" "style")
+-    '("PopplerRectangle*" "rect")
+-  )
+ )
+ 
+ (define-method get_selection_region
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index d1ad28a..834396b 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -6754,6 +6754,32 @@ rec {
         };
       };
 
+  pypoppler = pkgs.stdenv.mkDerivation (rec {
+    name = "pypoppler-0.12.1";
+
+    src = fetchurl {
+      url = "https://launchpad.net/poppler-python/trunk/development/+download/" +
+            "${name}.tar.gz";
+      sha256 = "322f183d24798a056f3005d1ab8e3ac27d8cfbbf0982725b323bbfec1bab5355";
+    };
+
+    patches = [
+      ../development/python-modules/pypoppler-tweak.patch
+      ../development/python-modules/pypoppler-more-tweaking.patch
+    ];
+
+    buildInputs = [ python pkgs.pkgconfig ];
+
+    propagatedBuildInputs = [
+      pygtk pkgs.atk pkgs.poppler.poppler_glib
+    ];
+
+    meta = {
+      description = "Python bindings for the Poppler PDF rendering library";
+      homepage = https://launchpad.net/poppler-python;
+      license = pkgs.stdenv.lib.licenses.gpl2;
+    };
+  });
 
   pyquery = buildPythonPackage rec {
     name = "pyquery-1.2.4";
@@ -10653,6 +10679,4 @@ rec {
     };
   };
 
-
-
 }); in pythonPackages



More information about the nix-dev mailing list