nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at 22.05 71 lines 1.7 kB view raw
1{ buildPythonPackage 2, fetchFromGitHub 3, fetchpatch 4, pillow 5, scipy 6, numpy 7, pytestCheckHook 8, imread 9, freeimage 10, lib 11, stdenv 12}: 13 14buildPythonPackage rec { 15 pname = "mahotas"; 16 version = "1.4.12"; 17 18 src = fetchFromGitHub { 19 owner = "luispedro"; 20 repo = "mahotas"; 21 rev = "v${version}"; 22 sha256 = "1n19yha1cqyx7hnlici1wkl7n68dh0vbpsyydfhign2c0w9jvg42"; 23 }; 24 25 patches = [ 26 (fetchpatch { 27 name = "fix-freeimage-tests.patch"; 28 url = "https://github.com/luispedro/mahotas/commit/08cc4aa0cbd5dbd4c37580d52b822810c03b2c69.patch"; 29 sha256 = "0389sz7fyl8h42phw8sn4pxl4wc3brcrj9d05yga21gzil9bfi23"; 30 excludes = [ "ChangeLog" ]; 31 }) 32 ]; 33 34 propagatedBuildInputs = [ numpy imread pillow scipy freeimage ]; 35 checkInputs = [ pytestCheckHook ]; 36 37 postPatch = '' 38 substituteInPlace mahotas/io/freeimage.py \ 39 --replace "ctypes.util.find_library('freeimage')" 'True' \ 40 --replace 'ctypes.CDLL(libname)' 'np.ctypeslib.load_library("libfreeimage", "${freeimage}/lib")' 41 ''; 42 43 # tests must be run in the build directory 44 preCheck = '' 45 cd build/lib* 46 ''; 47 48 # re-enable as soon as https://github.com/luispedro/mahotas/issues/97 is fixed 49 disabledTests = [ 50 "test_colors" 51 "test_ellipse_axes" 52 "test_normalize" 53 "test_haralick3d" 54 ]; 55 56 pythonImportsCheck = [ 57 "mahotas" 58 "mahotas.freeimage" 59 ]; 60 61 disabled = stdenv.isi686; # Failing tests 62 63 meta = with lib; { 64 broken = (stdenv.isLinux && stdenv.isAarch64); 65 description = "Computer vision package based on numpy"; 66 homepage = "https://mahotas.readthedocs.io/"; 67 maintainers = with maintainers; [ luispedro ]; 68 license = licenses.mit; 69 platforms = platforms.unix; 70 }; 71}