1{ stdenv
2, lib
3, buildPythonPackage
4, fetchPypi
5, imagemagick
6, pytest
7, psutil
8, memory_profiler
9, pytest_xdist
10}:
11
12let
13 soext = stdenv.hostPlatform.extensions.sharedLibrary;
14 magick_wand_library = "${imagemagick}/lib/libMagickWand-6.Q16${soext}";
15 imagemagick_library = "${imagemagick}/lib/libMagickCore-6.Q16${soext}";
16in buildPythonPackage rec {
17 pname = "Wand";
18 version = "0.4.4";
19
20 src = fetchPypi {
21 inherit pname version;
22 sha256 = "28e0454c9d16d69c5d5034918d96320d8f9f1377b4fdaf4944eec2f938c74704";
23 };
24
25 checkInputs = [ pytest pytest_xdist memory_profiler psutil ];
26
27 buildInputs = [ imagemagick ];
28
29 patches = [
30 ./libraries.patch
31 ];
32
33 inherit magick_wand_library imagemagick_library;
34
35 postPatch = ''
36 substituteAllInPlace wand/api.py
37 '';
38
39 # No tests
40 doCheck = false;
41 meta = {
42 description = "Ctypes-based simple MagickWand API binding for Python";
43 homepage = http://wand-py.org/;
44 license = with lib.licenses; [ mit ];
45 };
46
47 passthru = {
48 inherit imagemagick;
49 };
50}