diff options
author | Chris Ostrouchov <chris.ostrouchov@gmail.com> | 2018-10-26 09:55:39 -0400 |
---|---|---|
committer | Frederik Rietdijk <fridh@fridh.nl> | 2018-10-27 09:07:20 +0200 |
commit | 96c277b340449cbf79f9bc7281a6449430926b79 (patch) | |
tree | 251bcbaa79a2fc1ffaadf6b994330b8a27063e76 /pkgs/development/python-modules/pyinsane2 | |
parent | 73d1178084dbb4edea52e2e814e70f6335554bbd (diff) | |
download | nixpkgs-96c277b340449cbf79f9bc7281a6449430926b79.tar nixpkgs-96c277b340449cbf79f9bc7281a6449430926b79.tar.gz nixpkgs-96c277b340449cbf79f9bc7281a6449430926b79.tar.bz2 nixpkgs-96c277b340449cbf79f9bc7281a6449430926b79.tar.lz nixpkgs-96c277b340449cbf79f9bc7281a6449430926b79.tar.xz nixpkgs-96c277b340449cbf79f9bc7281a6449430926b79.tar.zst nixpkgs-96c277b340449cbf79f9bc7281a6449430926b79.zip |
pythonPackages.pyinsane2: refactor move to python-modules
Diffstat (limited to 'pkgs/development/python-modules/pyinsane2')
-rw-r--r-- | pkgs/development/python-modules/pyinsane2/default.nix | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/pyinsane2/default.nix b/pkgs/development/python-modules/pyinsane2/default.nix new file mode 100644 index 00000000000..cf44538b746 --- /dev/null +++ b/pkgs/development/python-modules/pyinsane2/default.nix @@ -0,0 +1,45 @@ +{ stdenv +, buildPythonPackage +, fetchPypi +, nose +, pillow +, pkgs +}: + +buildPythonPackage rec { + pname = "pyinsane2"; + version = "2.0.10"; + + src = fetchPypi { + inherit pname version; + sha256 = "00d1wqb3w9bn1rxb2dwmdqbar2lr96izq855l5vzprc17dkgip3j"; + }; + + # This is needed by setup.py regardless of whether tests are enabled. + buildInputs = [ nose ]; + propagatedBuildInputs = [ pillow ]; + + postPatch = '' + # pyinsane2 forks itself, so we need to re-inject the PYTHONPATH. + sed -i -e '/os.putenv.*PYINSANE_DAEMON/ { + a \ os.putenv("PYTHONPATH", ":".join(sys.path)) + }' pyinsane2/sane/abstract_proc.py + + sed -i -e 's,"libsane.so.1","${pkgs.sane-backends}/lib/libsane.so",' \ + pyinsane2/sane/rawapi.py + ''; + + # Tests require a scanner to be physically connected, so let's just do a + # quick check whether initialization works. + checkPhase = '' + python -c 'import pyinsane2; pyinsane2.init()' + ''; + + meta = with stdenv.lib; { + homepage = "https://github.com/jflesch/pyinsane"; + description = "Access and use image scanners"; + license = licenses.gpl3Plus; + platforms = platforms.linux; + }; + +} |