biome: 1.9.2 -> 1.9.3 (#349335)
[NixPkgs.git] / pkgs / development / python-modules / llvmlite / default.nix
blob19941cd4b4a317457d81f5fb8e76dbffb7d8c7cd
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   buildPythonPackage,
6   isPyPy,
7   pythonAtLeast,
9   setuptools,
11   # tests
12   pytestCheckHook,
13   llvm,
14   libxml2,
16   withStaticLLVM ? true,
19 buildPythonPackage rec {
20   pname = "llvmlite";
21   version = "0.43.0";
22   pyproject = true;
24   disabled = isPyPy || pythonAtLeast "3.13";
26   src = fetchFromGitHub {
27     owner = "numba";
28     repo = "llvmlite";
29     rev = "refs/tags/v${version}";
30     hash = "sha256-5QBSRDb28Bui9IOhGofj+c7Rk7J5fNv5nPksEPY/O5o=";
31   };
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"
39   '';
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
47   preCheck = ''
48     cd $out
49   '';
51   __impureHostDeps = lib.optionals stdenv.hostPlatform.isDarwin [ "/usr/lib/libm.dylib" ];
53   passthru = lib.optionalAttrs (!withStaticLLVM) { inherit llvm; };
55   meta = {
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;
61   };