mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-21 12:59:04 +02:00
Making ocropus-hocr run (matplotlib + gdk backend)
I added the gtk backend to matplotlib; if these added dependencies are too much, we can make this optional.
This commit is contained in:
parent
d58370db24
commit
caa9007e84
|
@ -44,6 +44,8 @@ pythonPackages.buildPythonPackage rec {
|
||||||
sha256 = "1s0v0gd6psfjp6lghwl2dj49h18mgf2n2z8hqzw8430nzhglnlvr";
|
sha256 = "1s0v0gd6psfjp6lghwl2dj49h18mgf2n2z8hqzw8430nzhglnlvr";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
patches = [ ./display.patch ];
|
||||||
|
|
||||||
propagatedBuildInputs = with pythonPackages; [ curl numpy scipy pillow
|
propagatedBuildInputs = with pythonPackages; [ curl numpy scipy pillow
|
||||||
matplotlib beautifulsoup4 pygtk ];
|
matplotlib beautifulsoup4 pygtk ];
|
||||||
|
|
||||||
|
@ -51,6 +53,9 @@ pythonPackages.buildPythonPackage rec {
|
||||||
|
|
||||||
preConfigure = with stdenv.lib; ''
|
preConfigure = with stdenv.lib; ''
|
||||||
${concatStrings (map (x: "ln -s ${x.src} models/${x.name};") models)}
|
${concatStrings (map (x: "ln -s ${x.src} models/${x.name};") models)}
|
||||||
|
|
||||||
|
sed -i 's|/usr/local|'$out'|' ocrolib/common.py
|
||||||
|
sed -i 's|/usr/local|'$out'|' ocrolib/default.py
|
||||||
${pythonPackages.python}/bin/${pythonPackages.python.executable} setup.py download_models
|
${pythonPackages.python}/bin/${pythonPackages.python.executable} setup.py download_models
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
17
pkgs/applications/misc/ocropus/display.patch
Normal file
17
pkgs/applications/misc/ocropus/display.patch
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
http://code.google.com/p/ocropus/issues/detail?id=365
|
||||||
|
|
||||||
|
diff --git a/setup.py b/setup.py
|
||||||
|
index c6ade25..a2ad6bf 100644
|
||||||
|
--- a/setup.py
|
||||||
|
+++ b/setup.py
|
||||||
|
@@ -8,7 +8,10 @@ assert sys.version_info[0]==2 and sys.version_info[1]>=7,\
|
||||||
|
from distutils.core import setup, Extension, Command
|
||||||
|
from distutils.command.install_data import install_data
|
||||||
|
|
||||||
|
+import matplotlib
|
||||||
|
+matplotlib.use('Agg')
|
||||||
|
from ocrolib import default
|
||||||
|
+
|
||||||
|
modeldir = "models/"
|
||||||
|
modelfiles = default.installable
|
||||||
|
modelprefix = "http://iupr1.cs.uni-kl.de/~tmb/ocropus-models/"
|
|
@ -3963,7 +3963,8 @@ rec {
|
||||||
(if stdenv.isDarwin then [ pkgs.clangStdenv ] else [ pkgs.stdenv ]);
|
(if stdenv.isDarwin then [ pkgs.clangStdenv ] else [ pkgs.stdenv ]);
|
||||||
|
|
||||||
propagatedBuildInputs =
|
propagatedBuildInputs =
|
||||||
[ dateutil nose numpy pyparsing tornado pkgs.freetype pkgs.libpng pkgs.pkgconfig ];
|
[ dateutil nose numpy pyparsing tornado pkgs.freetype pkgs.libpng pkgs.pkgconfig
|
||||||
|
pygtk ];
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "python plotting library, making publication quality plots";
|
description = "python plotting library, making publication quality plots";
|
||||||
|
|
Loading…
Reference in a new issue