1{
2 toPythonModule,
3 python,
4 lttng-tools,
5 swig,
6}:
7
8toPythonModule (
9 lttng-tools.overrideAttrs (
10 {
11 nativeBuildInputs ? [ ],
12 configureFlags ? [ ],
13 ...
14 }:
15 {
16 pname = "lttng";
17
18 nativeBuildInputs = nativeBuildInputs ++ [ swig ];
19
20 configureFlags = configureFlags ++ [
21 "--enable-python-bindings"
22 # "--disable-bin-lttng" # The Python bindings depend on liblttng-ctl, which is only built when the binary is enabled.
23 "--disable-bin-lttng-consumerd"
24 "--disable-bin-lttng-crash"
25 "--disable-bin-lttng-relayd"
26 "--disable-bin-lttng-sessiond"
27 # "--disable-extras" # The Python bindings are an extra.
28 "--disable-man-pages"
29 ];
30
31 # Nix treats nativeBuildInputs specially for cross-compilation, but in this
32 # case, cross-compilation is accounted for explicitly. Using the variables
33 # ensures that the platform setup isn't messed with further. It also allows
34 # regular Python to be added in the future if it is ever needed.
35 PYTHON = "${python.pythonOnBuildForHost}/bin/python";
36 PYTHON_CONFIG = "${python.pythonOnBuildForHost}/bin/python-config";
37 }
38 )
39)