2021-01-24 00:29:22 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2021-03-02 01:50:41 +00:00
|
|
|
, pythonAtLeast
|
2020-02-13 07:13:50 +00:00
|
|
|
, pythonOlder
|
2017-12-30 11:25:04 +00:00
|
|
|
, fetchPypi
|
2016-11-14 11:20:13 +00:00
|
|
|
, python
|
|
|
|
, buildPythonPackage
|
|
|
|
, numpy
|
|
|
|
, llvmlite
|
2021-02-07 16:30:53 +00:00
|
|
|
, setuptools
|
2016-11-14 11:20:13 +00:00
|
|
|
, libcxx
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2022-01-22 16:31:34 +00:00
|
|
|
version = "0.55.0";
|
2017-05-27 09:25:35 +00:00
|
|
|
pname = "numba";
|
2021-07-02 11:28:38 +00:00
|
|
|
disabled = pythonOlder "3.6" || pythonAtLeast "3.10";
|
2016-11-14 11:20:13 +00:00
|
|
|
|
2017-12-30 11:25:04 +00:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-01-22 16:31:34 +00:00
|
|
|
sha256 = "sha256-siHr2ZdmKh3Ld+TwkUDgIvv+dXetB4H8LgIUE126bL0=";
|
2016-11-14 11:20:13 +00:00
|
|
|
};
|
|
|
|
|
2021-08-26 19:32:39 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "1.21" "1.22"
|
|
|
|
|
|
|
|
substituteInPlace numba/__init__.py \
|
|
|
|
--replace "(1, 20)" "(1, 21)"
|
|
|
|
'';
|
|
|
|
|
llvmPackages: Multuple outputs for everythting
Also begin to start work on cross compilation, though that will have to
be finished later.
The patches are based on the first version of
https://reviews.llvm.org/D99484. It's very annoying to do the
back-porting but the review has uncovered nothing super major so I'm
fine sticking with what I've got.
Beyond making the outputs work, I also strove to re-sync the packages,
as they have been drifting pointlessly apart for some time.
----
Other misc notes, highly incomplete
- lvm-config-native and llvm-config are put in `dev` because they are
tools just for build time.
- Clang no longer has an lld dep. That was introduced in
db29857eb391ed002046090851a44c452b80bdbd, but if clang needs help
finding lld when it is used we should just pass it flags / put in the
resource dir. Providing it at build time increases critical path
length for no good reason.
----
A note on `nativeCC`:
`stdenv` takes tools from the previous stage, so:
1. `pkgsBuildBuild`: `(?1, x, x)`
2. `pkgsBuildBuild.stdenv.cc`: `(?0, ?1, x)`
while:
1. `pkgsBuildBuild`: `(?1, x, x)`
2. `pkgsBuildBuild.targetPackages`: `(x, x, ?2)`
3. `pkgsBuildBuild.targetPackages.stdenv.cc`: `(?1, x, x)`
2020-10-15 08:23:57 +00:00
|
|
|
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I${lib.getDev libcxx}/include/c++/v1";
|
2016-11-14 11:20:13 +00:00
|
|
|
|
2021-02-08 19:44:21 +00:00
|
|
|
propagatedBuildInputs = [ numpy llvmlite setuptools ];
|
2021-08-26 19:32:39 +00:00
|
|
|
|
2016-11-14 11:20:13 +00:00
|
|
|
# Copy test script into $out and run the test suite.
|
|
|
|
checkPhase = ''
|
2017-12-30 11:25:04 +00:00
|
|
|
${python.interpreter} -m numba.runtests
|
2016-11-14 11:20:13 +00:00
|
|
|
'';
|
2021-08-26 19:32:39 +00:00
|
|
|
|
2016-11-14 11:20:13 +00:00
|
|
|
# ImportError: cannot import name '_typeconv'
|
|
|
|
doCheck = false;
|
|
|
|
|
2021-08-26 19:32:39 +00:00
|
|
|
pythonImportsCheck = [ "numba" ];
|
|
|
|
|
2021-01-24 00:29:22 +00:00
|
|
|
meta = with lib; {
|
2021-08-26 19:32:39 +00:00
|
|
|
homepage = "https://numba.pydata.org/";
|
2021-01-24 00:29:22 +00:00
|
|
|
license = licenses.bsd2;
|
2016-11-14 11:20:13 +00:00
|
|
|
description = "Compiling Python code using LLVM";
|
2021-01-24 00:29:22 +00:00
|
|
|
maintainers = with maintainers; [ fridh ];
|
2016-11-14 11:20:13 +00:00
|
|
|
};
|
2017-02-13 10:00:12 +00:00
|
|
|
}
|