summary refs log tree commit diff
path: root/pkgs/os-specific/linux/lttng-modules/default.nix
blob: a520db334266e712fbb5b34e810f363b587697f6 (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
{ stdenv, fetchgit, kernel }:

assert stdenv.lib.versionAtLeast kernel.version "3.4";  # fails on 3.2

stdenv.mkDerivation rec {
  pname = "lttng-modules-${version}";
  name = "${pname}-${kernel.version}";
  # Support for linux 3.16 and 3.17 was added just after the 2.5.0 release
  version = "2.5.0-58-gbf2ba31"; # "git describe bf2ba318fff"

  src = fetchgit {
    url = "https://github.com/lttng/lttng-modules.git";
    sha256 = "0x70xp463g208rdz5b9b0wdwr2v8px1bwa589knvp4j7zi8d2gj9";
    rev = "bf2ba318fff";
  };

  preConfigure = ''
    export KERNELDIR="${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
    export INSTALL_MOD_PATH="$out"
  '';

  installPhase = ''
    make modules_install
  '';

  meta = with stdenv.lib; {
    description = "Linux kernel modules for LTTng tracing";
    homepage = http://lttng.org/;
    # TODO license = with licenses; [ lgpl21 gpl2 mit ];
    platforms = platforms.linux;
    maintainers = [ maintainers.bjornfor ];
  };

}