1{
2 buildPythonPackage,
3 fetchFromGitHub,
4 pillow,
5 scipy,
6 numpy,
7 pytestCheckHook,
8 imread,
9 lib,
10 stdenv,
11}:
12
13buildPythonPackage rec {
14 pname = "mahotas";
15 version = "1.4.18";
16 format = "setuptools";
17
18 src = fetchFromGitHub {
19 owner = "luispedro";
20 repo = "mahotas";
21 tag = "v${version}";
22 hash = "sha256-NZOas2fL01QZhi6ebIkW0/jfviwiUl+AqjC7XmC4xH4=";
23 };
24
25 propagatedBuildInputs = [
26 imread
27 numpy
28 pillow
29 scipy
30 ];
31
32 nativeCheckInputs = [ pytestCheckHook ];
33
34 # mahotas/_morph.cpp:864:10: error: no member named 'random_shuffle' in namespace 'std'
35 env = lib.optionalAttrs stdenv.cc.isClang { NIX_CFLAGS_COMPILE = "-std=c++14"; };
36
37 # tests must be run in the build directory
38 preCheck = ''
39 cd build/lib*
40 '';
41
42 # re-enable as soon as https://github.com/luispedro/mahotas/issues/97 is fixed
43 disabledTests = [
44 "test_colors"
45 "test_ellipse_axes"
46 "test_normalize"
47 "test_haralick3d"
48 ];
49
50 pythonImportsCheck = [ "mahotas" ];
51
52 disabled = stdenv.hostPlatform.isi686; # Failing tests
53
54 meta = with lib; {
55 broken = (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64);
56 description = "Computer vision package based on numpy";
57 homepage = "https://mahotas.readthedocs.io/";
58 maintainers = with maintainers; [ luispedro ];
59 license = licenses.mit;
60 platforms = platforms.unix;
61 };
62}