diff --git a/pkgs/by-name/ba/babeltrace/package.nix b/pkgs/by-name/ba/babeltrace/package.nix index 1ae395ab66d8..2d995df59c91 100644 --- a/pkgs/by-name/ba/babeltrace/package.nix +++ b/pkgs/by-name/ba/babeltrace/package.nix @@ -9,6 +9,9 @@ libuuid, popt, elfutils, + enablePython ? false, + pythonPackages ? null, + swig2, }: stdenv.mkDerivation (finalAttrs: { @@ -20,15 +23,20 @@ stdenv.mkDerivation (finalAttrs: { sha256 = "Z7Q6qu9clR+nrxpVfPcgGhH+iYdrfCK6CgPLwxbbWpw="; }; - nativeBuildInputs = [ - # The pre-generated ./configure script uses an old autoconf version which - # breaks cross-compilation (replaces references to malloc with rpl_malloc). - # Re-generate with nixpkgs's autoconf. This requires glib to be present in - # nativeBuildInputs for its m4 macros to be present. - autoreconfHook - glib - pkg-config - ]; + nativeBuildInputs = + [ + # The pre-generated ./configure script uses an old autoconf version which + # breaks cross-compilation (replaces references to malloc with rpl_malloc). + # Re-generate with nixpkgs's autoconf. This requires glib to be present in + # nativeBuildInputs for its m4 macros to be present. + autoreconfHook + glib + pkg-config + ] + ++ lib.optionals enablePython [ + swig2 + pythonPackages.setuptools + ]; buildInputs = [ glib libuuid @@ -36,12 +44,21 @@ stdenv.mkDerivation (finalAttrs: { elfutils ]; - configureFlags = [ - # --enable-debug-info (default) requires the configure script to run host - # executables to determine the elfutils library version, which cannot be done - # while cross compiling. - (lib.enableFeature (stdenv.hostPlatform == stdenv.buildPlatform) "debug-info") - ]; + configureFlags = + [ + # --enable-debug-info (default) requires the configure script to run host + # executables to determine the elfutils library version, which cannot be done + # while cross compiling. + (lib.enableFeature (stdenv.hostPlatform == stdenv.buildPlatform) "debug-info") + ] + ++ lib.optionals enablePython [ + # Using (lib.enableFeature enablePython "python-bindings") makes the + # configure script look for python dependencies even when + # enablePython==false. Adding the configure flag conditionally seems to + # solve this. + "--enable-python-bindings" + ]; + # passthru.updateScript = gitUpdater { url = "https://git.efficios.com/babeltrace.git"; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 928edd66a5f2..d6f074162a26 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1330,6 +1330,11 @@ self: super: with self; { babelgladeextractor = callPackage ../development/python-modules/babelgladeextractor { }; + babeltrace = toPythonModule (pkgs.babeltrace.override { + pythonPackages = self; + enablePython = true; + }); + bambi = callPackage ../development/python-modules/bambi { }; pad4pi = callPackage ../development/python-modules/pad4pi { };