commit 0fb8c78a4a9ad02c95fd33d6b481fc42f7dc5c47 parent bf53492ab718a829553bc3883ebdae401c7d0e81 Author: Andreas Gruhler <andreas.gruhler@adfinis.com> Date: Fri, 7 Jun 2024 13:24:40 +0200 feat: add babeltrace2 Diffstat:
A | .gitignore | | | 1 | + |
A | babeltrace2/default.nix | | | 34 | ++++++++++++++++++++++++++++++++++ |
2 files changed, 35 insertions(+), 0 deletions(-)
diff --git a/.gitignore b/.gitignore @@ -0,0 +1 @@ +**result diff --git a/babeltrace2/default.nix b/babeltrace2/default.nix @@ -0,0 +1,34 @@ +# https://raw.githubusercontent.com/NixOS/nixpkgs/nixos-24.05/pkgs/development/tools/misc/babeltrace/default.nix + +let + pkgs = import <nixpkgs> { }; +in + pkgs.stdenv.mkDerivation rec { + pname = "babeltrace2"; + version = "2.0.6"; + + src = pkgs.fetchurl { + url = "https://www.efficios.com/files/babeltrace/${pname}-${version}.tar.bz2"; + sha256 = "1jajxjlj7p25j2awjlnddxayp6ac4c3cfb7kj5dhppj2wrspw750"; + }; + + # 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. + nativeBuildInputs = with pkgs; [ autoreconfHook glib pkg-config ]; + buildInputs = with pkgs; [ glib libuuid popt elfutils ]; + + # --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. + configureFlags = pkgs.lib.optional (pkgs.stdenv.hostPlatform != pkgs.stdenv.buildPlatform) "--disable-debug-info"; + + meta = with pkgs.lib; { + description = "Command-line tool and library to read and convert LTTng tracefiles"; + homepage = "https://www.efficios.com/babeltrace"; + license = licenses.mit; + platforms = platforms.linux; + maintainers = [ maintainers.bjornfor ]; + }; + }