16 withStaticLLVM ? true,
19 buildPythonPackage rec {
24 disabled = isPyPy || pythonAtLeast "3.13";
26 src = fetchFromGitHub {
29 rev = "refs/tags/v${version}";
30 hash = "sha256-5QBSRDb28Bui9IOhGofj+c7Rk7J5fNv5nPksEPY/O5o=";
33 build-system = [ setuptools ];
35 buildInputs = [ llvm ] ++ lib.optionals withStaticLLVM [ libxml2.dev ];
37 postPatch = lib.optionalString withStaticLLVM ''
38 substituteInPlace ffi/build.py --replace-fail "--system-libs --libs all" "--system-libs --libs --link-static all"
41 # Set directory containing llvm-config binary
42 env.LLVM_CONFIG = "${llvm.dev}/bin/llvm-config";
44 nativeCheckInputs = [ pytestCheckHook ];
46 # https://github.com/NixOS/nixpkgs/issues/255262
51 __impureHostDeps = lib.optionals stdenv.hostPlatform.isDarwin [ "/usr/lib/libm.dylib" ];
53 passthru = lib.optionalAttrs (!withStaticLLVM) { inherit llvm; };
56 changelog = "https://github.com/numba/llvmlite/blob/v${version}/CHANGE_LOG";
57 description = "Lightweight LLVM python binding for writing JIT compilers";
58 downloadPage = "https://github.com/numba/llvmlite";
59 homepage = "http://llvmlite.pydata.org/";
60 license = lib.licenses.bsd2;