2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchPypi
|
|
|
|
, buildPythonPackage
|
|
|
|
, python
|
|
|
|
, llvm
|
|
|
|
, pythonOlder
|
|
|
|
, isPyPy
|
|
|
|
, enum34
|
2020-06-02 18:00:15 +00:00
|
|
|
, isPy3k
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "llvmlite";
|
2021-03-09 03:18:52 +00:00
|
|
|
version = "0.35.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-06-02 18:00:15 +00:00
|
|
|
disabled = isPyPy || !isPy3k;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-03-09 03:18:52 +00:00
|
|
|
sha256 = "80e51d5aa02ad72da9870e89d21f9b152b0220ca551b4596a6c0614bcde336fc";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ llvm ];
|
2021-02-05 17:12:51 +00:00
|
|
|
propagatedBuildInputs = [ ] ++ lib.optional (pythonOlder "3.4") enum34;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# Disable static linking
|
|
|
|
# https://github.com/numba/llvmlite/issues/93
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace ffi/Makefile.linux --replace "-static-libstdc++" ""
|
|
|
|
|
|
|
|
substituteInPlace llvmlite/tests/test_binding.py --replace "test_linux" "nope"
|
|
|
|
'';
|
|
|
|
# Set directory containing llvm-config binary
|
|
|
|
preConfigure = ''
|
|
|
|
export LLVM_CONFIG=${llvm}/bin/llvm-config
|
|
|
|
'';
|
|
|
|
checkPhase = ''
|
|
|
|
${python.executable} runtests.py
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
__impureHostDeps = lib.optionals stdenv.isDarwin [ "/usr/lib/libm.dylib" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
passthru.llvm = llvm;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A lightweight LLVM python binding for writing JIT compilers";
|
|
|
|
homepage = "http://llvmlite.pydata.org/";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = licenses.bsd2;
|
|
|
|
maintainers = with maintainers; [ fridh ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|