about summary refs log tree commit diff
path: root/pkgs/by-name/ba/babeltrace/package.nix
blob: 3f3dbafb679d1b001cc15306f58e8c829ad77b6f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{
  lib,
  stdenv,
  fetchurl,
  gitUpdater,
  autoreconfHook,
  pkg-config,
  glib,
  libuuid,
  popt,
  elfutils,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "babeltrace";
  version = "1.5.11";

  src = fetchurl {
    url = "https://www.efficios.com/files/babeltrace/${finalAttrs.pname}-${finalAttrs.version}.tar.bz2";
    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
  ];
  buildInputs = [
    glib
    libuuid
    popt
    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")
  ];

  passthru.updateScript = gitUpdater {
    url = "https://git.efficios.com/babeltrace.git";
    rev-prefix = "v";
    # Versions 2.x are packaged independently as babeltrace2
    ignoredVersions = "^[^1]";
  };

  meta = {
    description = "Command-line tool and library to read and convert LTTng tracefiles";
    homepage = "https://www.efficios.com/babeltrace";
    license = lib.licenses.mit;
    platforms = lib.platforms.linux;
    maintainers = with lib.maintainers; [ bjornfor ];
  };
})