1{ buildPythonPackage, fetchFromGitHub, pillow, scipy, numpy, pytestCheckHook, imread, freeimage, lib, stdenv }:
2
3buildPythonPackage rec {
4 pname = "mahotas";
5 version = "1.4.11";
6
7 src = fetchFromGitHub {
8 owner = "luispedro";
9 repo = "mahotas";
10 rev = "v${version}";
11 sha256 = "029gvy1fb855pvxvy8zwj44k4s7qpqi0161bg5wldfiprrysn1kw";
12 };
13
14 propagatedBuildInputs = [ numpy imread pillow scipy freeimage ];
15 checkInputs = [ pytestCheckHook ];
16
17 postPatch = ''
18 substituteInPlace mahotas/io/freeimage.py --replace "/opt/local/lib" "${freeimage}/lib"
19 '';
20
21 # tests must be run in the build directory
22 preCheck = ''
23 cd build/lib*
24 '';
25
26 # re-enable as soon as https://github.com/luispedro/mahotas/issues/97 is fixed
27 disabledTests = [
28 "test_colors"
29 "test_ellipse_axes"
30 "test_normalize"
31 "test_haralick3d"
32 ];
33
34 disabled = stdenv.isi686; # Failing tests
35
36 meta = with lib; {
37 description = "Computer vision package based on numpy";
38 homepage = "https://mahotas.readthedocs.io/";
39 maintainers = with maintainers; [ luispedro ];
40 license = licenses.mit;
41 platforms = platforms.unix;
42 };
43}