@@ -1,4 +1,6 @@
1−{ buildPythonPackage
1+{ stdenv
2+, buildPythonPackage
3+, python
24, numba
35, ndtypes
46, xnd
@@ -25,4 +27,20 @@ buildPythonPackage {
2527 --replace 'add_runtime_library_dirs = ["$ORIGIN"]' \
2628 'add_runtime_library_dirs = ["${libndtypes}/lib", "${libxnd}/lib", "${libgumath}/lib"]'
2729 '';
30+
31+ postInstall = stdenv.lib.optionalString stdenv.isDarwin ''
32+ install_name_tool -add_rpath ${libgumath}/lib $out/${python.sitePackages}/gumath/_gumath.*.so
33+ '';
34+
35+ checkPhase = ''
36+ pushd python
37+ mv gumath _gumath
38+ # minor precision issues
39+ substituteInPlace test_gumath.py --replace 'test_sin' 'dont_test_sin'
40+ python test_gumath.py
41+ python test_xndarray.py
42+ popd
43+ '';
44+
2845}
46+