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 name = "${pname}-${version}";
20
21 src = fetchPypi {
22 inherit pname version;
23 sha256 = "28e0454c9d16d69c5d5034918d96320d8f9f1377b4fdaf4944eec2f938c74704";
24 };
25
26 checkInputs = [ pytest pytest_xdist memory_profiler psutil ];
27
28 buildInputs = [ imagemagick ];
29
30 patches = [
31 ./libraries.patch
32 ];
33
34 inherit magick_wand_library imagemagick_library;
35
36 postPatch = ''
37 substituteAllInPlace wand/api.py
38 '';
39
40 # No tests
41 doCheck = false;
42 meta = {
43 description = "Ctypes-based simple MagickWand API binding for Python";
44 homepage = http://wand-py.org/;
45 license = with lib.licenses; [ mit ];
46 };
47
48 passthru = {
49 inherit imagemagick;
50 };
51}