about summary refs log tree commit diff
path: root/pkgs/os-specific/linux/linuxptp/default.nix
blob: 23f79e7f6653665f560ff0e01afa3ced7cf5a385 (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
{ lib, stdenv, fetchFromGitHub, linuxHeaders } :


stdenv.mkDerivation rec {
  pname = "linuxptp";
  version = "4.3";

  src = fetchFromGitHub {
    owner = "nwtime";
    repo = "linuxptp";
    rev = "v${version}";
    hash = "sha256-FFBbbmVPP74p/OkqNXXgynBS/NcuPoYs3OCof11NZOI=";
  };

  outputs = [ "out" "man" ];

  postPatch = ''
    substituteInPlace incdefs.sh --replace-fail \
       '/usr/include/linux/' "${linuxHeaders}/include/linux/"
  '';

  makeFlags = [
    "prefix="
    "CROSS_COMPILE=${stdenv.cc.targetPrefix}"
  ];

  preInstall = ''
    export DESTDIR=$out
  '';

  enableParallelBuilding = true;

  meta = with lib; {
    description = "Implementation of the Precision Time Protocol (PTP) according to IEEE standard 1588 for Linux";
    homepage = "https://linuxptp.nwtime.org";
    maintainers = [ maintainers.markuskowa ];
    license = licenses.gpl2Only;
    platforms = platforms.linux;
  };
}