summary refs log tree commit diff
path: root/pkgs/development/python-modules/Wand/default.nix
blob: bc0472bc0053315030f657b83cb6fae44e7f838b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{ stdenv
, lib
, buildPythonPackage
, fetchPypi
, imagemagick
, pytest
, psutil
, memory_profiler
, pytest_xdist
}:

let
  soext = stdenv.hostPlatform.extensions.sharedLibrary;
  magick_wand_library = "${imagemagick}/lib/libMagickWand-6.Q16${soext}";
  imagemagick_library = "${imagemagick}/lib/libMagickCore-6.Q16${soext}";
in buildPythonPackage rec {
  pname = "Wand";
  version = "0.4.4";
  name = "${pname}-${version}";

  src = fetchPypi {
    inherit pname version;
    sha256 = "28e0454c9d16d69c5d5034918d96320d8f9f1377b4fdaf4944eec2f938c74704";
  };

  checkInputs = [ pytest pytest_xdist memory_profiler psutil ];

  buildInputs = [ imagemagick ];

  patches = [
    ./libraries.patch
  ];

  inherit magick_wand_library imagemagick_library;

  postPatch = ''
    substituteAllInPlace wand/api.py
  '';

  # No tests
  doCheck = false;
  meta = {
    description = "Ctypes-based simple MagickWand API binding for Python";
    homepage = http://wand-py.org/;
    license = with lib.licenses; [ mit ];
  };

  passthru = {
    inherit imagemagick;
  };
}