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