18 format = "setuptools";
20 inherit (libgumath) src version meta;
23 # https://github.com/xnd-project/gumath/pull/42
25 name = "remove-np-warnings-call.patch";
26 url = "https://github.com/xnd-project/gumath/commit/83ab3aa3b07d55654b4e6e75e5ec6be8190fca97.patch";
27 hash = "sha256-7lUXNVH5M+Go1iEu0bud03XI8cyGbdLNdLraMZplDaM=";
30 name = "remove-np-1.25-bartlett-test-assertion.patch";
31 url = "https://github.com/xnd-project/gumath/commit/8741e31f2967ded08c96a7f0631e1e38fe813870.patch";
32 hash = "sha256-flltk3RNPHalbcIV0BrkxWuhqqJBrycos7Fyv3P3mWg=";
36 nativeCheckInputs = [ numba ];
38 propagatedBuildInputs = [
44 substituteInPlace setup.py \
45 --replace 'add_include_dirs = [".", "libgumath", "ndtypes/python/ndtypes", "xnd/python/xnd"] + INCLUDES' \
46 'add_include_dirs = [".", "${libndtypes.dev}/include", "${libxnd}/include", "${libgumath}/include"]' \
47 --replace 'add_library_dirs = ["libgumath", "ndtypes/libndtypes", "xnd/libxnd"] + LIBS' \
48 'add_library_dirs = ["${libndtypes}/lib", "${libxnd}/lib", "${libgumath}/lib"]' \
49 --replace 'add_runtime_library_dirs = ["$ORIGIN"]' \
50 'add_runtime_library_dirs = ["${libndtypes}/lib", "${libxnd}/lib", "${libgumath}/lib"]'
53 postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
54 install_name_tool -add_rpath ${libgumath}/lib $out/${python.sitePackages}/gumath/_gumath.*.so
60 # minor precision issues
61 substituteInPlace test_gumath.py --replace 'test_sin' 'dont_test_sin'
63 python test_xndarray.py