2021-01-24 00:29:22 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2017-12-30 11:24:23 +00:00
|
|
|
, fetchPypi
|
2016-11-14 11:18:54 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, python
|
|
|
|
, llvm
|
|
|
|
, pythonOlder
|
|
|
|
, isPyPy
|
|
|
|
, enum34
|
2020-05-10 08:29:46 +01:00
|
|
|
, isPy3k
|
2016-11-14 11:18:54 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "llvmlite";
|
2020-08-16 18:31:06 +01:00
|
|
|
version = "0.34.0";
|
2016-11-14 11:18:54 +00:00
|
|
|
|
2020-05-10 08:29:46 +01:00
|
|
|
disabled = isPyPy || !isPy3k;
|
2016-11-14 11:18:54 +00:00
|
|
|
|
2017-12-30 11:24:23 +00:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-08-16 18:31:06 +01:00
|
|
|
sha256 = "f03ee0d19bca8f2fe922bb424a909d05c28411983b0c2bc58b020032a0d11f63";
|
2016-11-14 11:18:54 +00:00
|
|
|
};
|
|
|
|
|
2019-01-05 10:54:27 +00:00
|
|
|
nativeBuildInputs = [ llvm ];
|
2021-01-24 00:29:22 +00:00
|
|
|
propagatedBuildInputs = [ ] ++ lib.optional (pythonOlder "3.4") enum34;
|
2016-11-14 11:18:54 +00:00
|
|
|
|
|
|
|
# Disable static linking
|
|
|
|
# https://github.com/numba/llvmlite/issues/93
|
2017-12-30 11:24:23 +00:00
|
|
|
postPatch = ''
|
2016-11-14 11:18:54 +00:00
|
|
|
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-01-24 00:29:22 +00:00
|
|
|
__impureHostDeps = lib.optionals stdenv.isDarwin [ "/usr/lib/libm.dylib" ];
|
2016-11-14 11:18:54 +00:00
|
|
|
|
|
|
|
passthru.llvm = llvm;
|
|
|
|
|
2021-01-24 00:29:22 +00:00
|
|
|
meta = with lib; {
|
2016-11-14 11:18:54 +00:00
|
|
|
description = "A lightweight LLVM python binding for writing JIT compilers";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://llvmlite.pydata.org/";
|
2021-01-24 00:29:22 +00:00
|
|
|
license = licenses.bsd2;
|
|
|
|
maintainers = with maintainers; [ fridh ];
|
2016-11-14 11:18:54 +00:00
|
|
|
};
|
2017-02-13 09:59:59 +00:00
|
|
|
}
|