lol
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 linuxHeaders,
6}:
7
8stdenv.mkDerivation rec {
9 pname = "linuxptp";
10 version = "4.4";
11
12 src = fetchFromGitHub {
13 owner = "nwtime";
14 repo = "linuxptp";
15 rev = "v${version}";
16 hash = "sha256-w1buo+D8Mnd6ytMhQYhvCDqt+RejlNSN/iVjrDR+Khk=";
17 };
18
19 outputs = [
20 "out"
21 "man"
22 ];
23
24 postPatch = ''
25 substituteInPlace incdefs.sh --replace-fail \
26 '/usr/include/linux/' "${linuxHeaders}/include/linux/"
27 '';
28
29 makeFlags = [
30 "prefix="
31 "CROSS_COMPILE=${stdenv.cc.targetPrefix}"
32 ];
33
34 preInstall = ''
35 export DESTDIR=$out
36 '';
37
38 enableParallelBuilding = true;
39
40 meta = with lib; {
41 description = "Implementation of the Precision Time Protocol (PTP) according to IEEE standard 1588 for Linux";
42 homepage = "https://linuxptp.nwtime.org";
43 maintainers = [ maintainers.markuskowa ];
44 license = licenses.gpl2Only;
45 platforms = platforms.linux;
46 };
47}