[Nix-dev] pypoppler: new package
Nick Sauce
nick.sauce at monumentmail.com
Sat Sep 13 10:52:54 CEST 2014
pypoppler: new package
---
diff --git \
a/pkgs/development/python-modules/pypoppler-build.patch \
b/pkgs/development/python-modules/pypoppler-build.patch
new file mode 100644
index 0000000..5d41607
--- /dev/null
+++ b/pkgs/development/python-modules/pypoppler-build.patch
@@ -0,0 +1,116 @@
+diff -Naur b/configure a/configure
+--- b/configure 2009-09-27 06:07:56.000000000 +0900
++++ a/configure 2014-09-11 12:48:24.910548221 +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 b/Makefile.am a/Makefile.am
+--- b/Makefile.am 2009-09-27 03:31:23.000000000 +0900
++++ a/Makefile.am 2014-09-11 12:48:24.911548226 +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 b/Makefile.in a/Makefile.in
+--- b/Makefile.in 2009-09-27 06:07:55.000000000 +0900
++++ a/Makefile.in 2014-09-11 12:48:24.911548226 +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 b/poppler.defs a/poppler.defs
+--- b/poppler.defs 2009-09-27 18:07:59.000000000 +0900
++++ a/poppler.defs 2014-09-11 12:48:32.525582270 +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")
+@@ -1796,10 +1744,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 f3efb97..df009a5 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -6832,6 +6832,33 @@ 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-build.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";
@@ -10808,6 +10835,4 @@ rec {
};
};
-
-
}); in pythonPackages
More information about the nix-dev
mailing list