1{
2 buildPythonPackage,
3 python,
4 root,
5}:
6
7let
8 unwrapped = root.override { python3 = python; };
9in
10buildPythonPackage rec {
11 # ROOT builds the C++ libraries and CPython extensions in one package and
12 # python versions must never be mixed
13 passthru = {
14 inherit unwrapped;
15 };
16
17 inherit (unwrapped) pname version meta;
18
19 src = null;
20
21 format = "other"; # disables setuptools/pyproject logic
22
23 dontUnpack = true;
24 dontConfigure = true;
25 dontBuild = true;
26
27 installPhase = ''
28 mkdir -p $out/${python.sitePackages}
29 rmdir $out/${python.sitePackages}
30 ln -s ${unwrapped}/lib $out/${python.sitePackages}
31 '';
32
33 # Those namespaces are looked up dynamically via ROOTs CPython extension, so
34 # these checks cover the most fragile parts of the package
35 pythonImportsCheck = [
36 "ROOT"
37 "ROOT.Experimental"
38 "ROOT.Math"
39 "ROOT.RooFit"
40 "ROOT.std"
41 ];
42}