summary refs log tree commit diff
diff options
context:
space:
mode:
authorFrederik Rietdijk <freddyrietdijk@fridh.nl>2016-10-01 11:10:40 +0200
committerGitHub <noreply@github.com>2016-10-01 11:10:40 +0200
commit11d7e936246842f0362935611d73406104d8c6ed (patch)
treeb079d41fd9f04a42b8bec776739ec1f4744e7287
parent253f96435f562772fda070fe807d6d30aee97542 (diff)
parentf0155e8d70f1d78873b491dbbe297ca8fc279727 (diff)
downloadnixpkgs-11d7e936246842f0362935611d73406104d8c6ed.tar
nixpkgs-11d7e936246842f0362935611d73406104d8c6ed.tar.gz
nixpkgs-11d7e936246842f0362935611d73406104d8c6ed.tar.bz2
nixpkgs-11d7e936246842f0362935611d73406104d8c6ed.tar.lz
nixpkgs-11d7e936246842f0362935611d73406104d8c6ed.tar.xz
nixpkgs-11d7e936246842f0362935611d73406104d8c6ed.tar.zst
nixpkgs-11d7e936246842f0362935611d73406104d8c6ed.zip
Merge pull request #19078 from FRidh/pypoppler
pythonPackages.pypoppler: init at 0.12.2
-rw-r--r--pkgs/development/python-modules/pypoppler-0.39.0.patch23
-rw-r--r--pkgs/development/python-modules/pypoppler-poppler.c.patch12
-rw-r--r--pkgs/top-level/python-packages.nix31
3 files changed, 66 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/pypoppler-0.39.0.patch b/pkgs/development/python-modules/pypoppler-0.39.0.patch
new file mode 100644
index 00000000000..b9e02242e00
--- /dev/null
+++ b/pkgs/development/python-modules/pypoppler-0.39.0.patch
@@ -0,0 +1,23 @@
+diff --git a/poppler.defs b/poppler.defs
+index 8b12e03..2b8fc16 100644
+--- a/poppler.defs
++++ b/poppler.defs
+@@ -570,18 +570,6 @@
+   )
+ )
+ 
+-(define-enum Orientation
+-  (in-module "Poppler")
+-  (c-name "PopplerOrientation")
+-  (gtype-id "POPPLER_TYPE_ORIENTATION")
+-  (values
+-    '("portrait" "POPPLER_ORIENTATION_PORTRAIT")
+-    '("landscape" "POPPLER_ORIENTATION_LANDSCAPE")
+-    '("upsidedown" "POPPLER_ORIENTATION_UPSIDEDOWN")
+-    '("seascape" "POPPLER_ORIENTATION_SEASCAPE")
+-  )
+-)
+-
+ (define-enum PageTransitionType
+   (in-module "Poppler")
+   (c-name "PopplerPageTransitionType")
diff --git a/pkgs/development/python-modules/pypoppler-poppler.c.patch b/pkgs/development/python-modules/pypoppler-poppler.c.patch
new file mode 100644
index 00000000000..1104097cd3e
--- /dev/null
+++ b/pkgs/development/python-modules/pypoppler-poppler.c.patch
@@ -0,0 +1,12 @@
+diff --git a/poppler.c b/poppler.c
+index 31b4489..16d0838 100644
+--- a/poppler.c
++++ b/poppler.c
+@@ -4501,7 +4501,6 @@ py_poppler_add_constants(PyObject *module, const gchar *strip_prefix)
+   pyg_enum_add(module, "FormTextType", strip_prefix, POPPLER_TYPE_FORM_TEXT_TYPE);
+   pyg_enum_add(module, "FormChoiceType", strip_prefix, POPPLER_TYPE_FORM_CHOICE_TYPE);
+   pyg_enum_add(module, "Error", strip_prefix, POPPLER_TYPE_ERROR);
+-  pyg_enum_add(module, "Orientation", strip_prefix, POPPLER_TYPE_ORIENTATION);
+   pyg_enum_add(module, "PageTransitionType", strip_prefix, POPPLER_TYPE_PAGE_TRANSITION_TYPE);
+   pyg_enum_add(module, "PageTransitionAlignment", strip_prefix, POPPLER_TYPE_PAGE_TRANSITION_ALIGNMENT);
+   pyg_enum_add(module, "PageTransitionDirection", strip_prefix, POPPLER_TYPE_PAGE_TRANSITION_DIRECTION);
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 0e69b4e5a57..121583f6a04 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -8286,6 +8286,37 @@ in modules // {
     inherit pythonOlder;
   };
 
+  pypoppler = buildPythonPackage rec {
+    name = "pypoppler-${version}";
+    version = "0.12.2";
+
+    src = pkgs.fetchurl {
+      url = "mirror://pypi/p/pypoppler/${name}.tar.gz";
+      sha256 = "47e6ac99e5b114b9abf2d1dd1bca06f22c028d025432512989f659142470810f";
+    };
+
+    NIX_CFLAGS_COMPILE="-I${pkgs.poppler.dev}/include/poppler/";
+    buildInputs = [ pkgs.pkgconfig pkgs.poppler.dev ];
+    propagatedBuildInputs = with self; [ pycairo pygobject2 ];
+
+    patches = [
+      ../development/python-modules/pypoppler-0.39.0.patch
+      ../development/python-modules/pypoppler-poppler.c.patch
+    ];
+
+    # Not supported.
+    disabled = isPy3k;
+
+    # No tests in archive
+    doCheck = false;
+
+    meta = {
+      homepage = https://code.launchpad.net/~mriedesel/poppler-python/main;
+      description = "Python bindings for poppler-glib, unofficial branch including bug fixes, and removal of gtk dependencies";
+      license = licenses.gpl2;
+    };
+  };
+
   python-axolotl = buildPythonPackage rec {
     name = "python-axolotl-${version}";
     version = "0.1.7";