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