2015-05-29 17:03:18 +01:00
|
|
|
{
|
|
|
|
# Python package expression
|
|
|
|
python,
|
|
|
|
# Name of package (e.g. numpy or scipy)
|
|
|
|
pkgName,
|
2015-06-04 23:17:40 +01:00
|
|
|
# OpenBLAS math library
|
|
|
|
openblas
|
2015-05-29 17:03:18 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
{
|
2015-06-04 23:17:40 +01:00
|
|
|
# Re-export openblas here so that it can be sure that the same one will be used
|
2015-06-02 16:58:17 +01:00
|
|
|
# in the propagatedBuildInputs.
|
2015-06-04 23:17:40 +01:00
|
|
|
inherit openblas;
|
2015-05-29 17:03:18 +01:00
|
|
|
|
|
|
|
# First "install" the package, then import what was installed, and call the
|
|
|
|
# .test() function, which will run the test suite.
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
2015-11-19 11:38:36 +00:00
|
|
|
pushd dist
|
|
|
|
${python.interpreter} -c 'import ${pkgName}; ${pkgName}.test("fast", verbose=10)'
|
|
|
|
popd
|
2015-05-29 17:03:18 +01:00
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
2015-06-02 16:58:17 +01:00
|
|
|
# Creates a site.cfg telling the setup script where to find depended-on
|
2015-05-29 17:03:18 +01:00
|
|
|
# math libraries.
|
|
|
|
preBuild = ''
|
|
|
|
echo "Creating site.cfg file..."
|
|
|
|
cat << EOF > site.cfg
|
2015-06-04 23:17:40 +01:00
|
|
|
[openblas]
|
|
|
|
include_dirs = ${openblas}/include
|
|
|
|
library_dirs = ${openblas}/lib
|
2015-05-29 17:03:18 +01:00
|
|
|
EOF
|
|
|
|
'';
|
|
|
|
}
|