2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2021-03-09 03:18:52 +00:00
|
|
|
, pythonAtLeast
|
2020-04-24 23:36:52 +00:00
|
|
|
, pythonOlder
|
|
|
|
, fetchPypi
|
|
|
|
, python
|
|
|
|
, buildPythonPackage
|
|
|
|
, numpy
|
|
|
|
, llvmlite
|
2021-02-22 21:28:39 +00:00
|
|
|
, setuptools
|
2020-04-24 23:36:52 +00:00
|
|
|
, libcxx
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "0.54.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "numba";
|
2021-07-21 07:28:18 +00:00
|
|
|
disabled = pythonOlder "3.6" || pythonAtLeast "3.10";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-12-06 16:07:01 +00:00
|
|
|
sha256 = "f9dfc803c864edcc2381219b800abf366793400aea55e26d4d5b7d953e14f43f";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "1.21" "1.22"
|
|
|
|
|
|
|
|
substituteInPlace numba/__init__.py \
|
|
|
|
--replace "(1, 20)" "(1, 21)"
|
|
|
|
'';
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I${lib.getDev libcxx}/include/c++/v1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-22 21:28:39 +00:00
|
|
|
propagatedBuildInputs = [ numpy llvmlite setuptools ];
|
2021-09-18 10:52:07 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# Copy test script into $out and run the test suite.
|
|
|
|
checkPhase = ''
|
|
|
|
${python.interpreter} -m numba.runtests
|
|
|
|
'';
|
2021-09-18 10:52:07 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# ImportError: cannot import name '_typeconv'
|
|
|
|
doCheck = false;
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
pythonImportsCheck = [ "numba" ];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2021-09-18 10:52:07 +00:00
|
|
|
homepage = "https://numba.pydata.org/";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = licenses.bsd2;
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Compiling Python code using LLVM";
|
2021-02-05 17:12:51 +00:00
|
|
|
maintainers = with maintainers; [ fridh ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|