From d331f58b900710164e1681a9d32fa7d75662935e Mon Sep 17 00:00:00 2001 From: aszlig Date: Mon, 19 Dec 2016 22:00:53 +0100 Subject: [PATCH] python/paperwork-backend: init at 1.0.6 While not explicitly checked by setup.py or by the "chkdeps" command from the project I have added pyinsane2 and pyocr to the list of dependencies as well, because they're referenced in the source. Tested by building against Python 3.3, 3.4, 3.5 and 3.6. The build against Python 3.6 failed because pycairo doesn't build, so it's a non-issue at least for paperwork-backend. Signed-off-by: aszlig --- pkgs/top-level/python-packages.nix | 37 +++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index a58f0f75541..3dcf58e606c 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8436,7 +8436,42 @@ in { license = licenses.mit; }; }; - + + paperwork-backend = buildPythonPackage rec { + name = "paperwork-backend-${version}"; + version = "1.0.6"; + + src = pkgs.fetchFromGitHub { + owner = "jflesch"; + repo = "paperwork-backend"; + rev = version; + sha256 = "11jbhv9xcpimp9iq2b1hlpljzij73s86rb5lpgzhslqc7zmm5bxn"; + }; + + # Python 2.x is not supported. + disabled = !isPy3k && !isPyPy; + + # Make sure that chkdeps exits with status 1 if a dependency is not found. + postPatch = '' + sed -i -e '/print.*Missing dependencies/,/^ *$/ { + /^ *$/ a \ sys.exit(1) + }' scripts/paperwork-shell + ''; + + preCheck = "\"$out/bin/paperwork-shell\" chkdeps paperwork_backend"; + + propagatedBuildInputs = with self; [ + pyenchant simplebayes pillow pycountry whoosh termcolor + python-Levenshtein pyinsane2 pygobject3 pyocr pkgs.poppler_gi + ]; + + meta = { + description = "Backend part of Paperwork (Python API, no UI)"; + homepage = "https://github.com/jflesch/paperwork-backend"; + license = licenses.gpl3Plus; + }; + }; + pathtools = buildPythonPackage rec { name = "pathtools-${version}"; version = "0.1.2";