Merge pull request #119126 from fabaff/pycomfoconnect
[NixPkgs.git] / pkgs / development / python-modules / llvmlite / default.nix
blob609dcb82237dea99861e2726b306c0818e458f05
1 { lib
2 , stdenv
3 , fetchPypi
4 , buildPythonPackage
5 , python
6 , llvm
7 , pythonOlder
8 , isPyPy
9 , enum34
10 , isPy3k
13 buildPythonPackage rec {
14   pname = "llvmlite";
15   version = "0.35.0";
17   disabled = isPyPy || !isPy3k;
19   src = fetchPypi {
20     inherit pname version;
21     sha256 = "80e51d5aa02ad72da9870e89d21f9b152b0220ca551b4596a6c0614bcde336fc";
22   };
24   nativeBuildInputs = [ llvm ];
25   propagatedBuildInputs = [ ] ++ lib.optional (pythonOlder "3.4") enum34;
27   # Disable static linking
28   # https://github.com/numba/llvmlite/issues/93
29   postPatch = ''
30     substituteInPlace ffi/Makefile.linux --replace "-static-libstdc++" ""
32     substituteInPlace llvmlite/tests/test_binding.py --replace "test_linux" "nope"
33   '';
34   # Set directory containing llvm-config binary
35   preConfigure = ''
36     export LLVM_CONFIG=${llvm}/bin/llvm-config
37   '';
38   checkPhase = ''
39     ${python.executable} runtests.py
40   '';
42   __impureHostDeps = lib.optionals stdenv.isDarwin [ "/usr/lib/libm.dylib" ];
44   passthru.llvm = llvm;
46   meta = with lib; {
47     description = "A lightweight LLVM python binding for writing JIT compilers";
48     homepage = "http://llvmlite.pydata.org/";
49     license = licenses.bsd2;
50     maintainers = with maintainers; [ fridh ];
51   };