mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-19 04:02:10 +00:00
6807ea7973
Linux-PTP uses a kernel-like build system which requires that the `CROSS_COMPILE` variable be set to the target prefix when cross-compiling.
37 lines
873 B
Nix
37 lines
873 B
Nix
{ lib, stdenv, fetchurl, linuxHeaders } :
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "linuxptp";
|
|
version = "4.2";
|
|
|
|
src = fetchurl {
|
|
url = "mirror://sourceforge/linuxptp/${pname}-${version}.tgz";
|
|
hash = "sha256-cOOOXSdk4CF0Q9pvFOiEb+QBpHIpOsE42EGcB6ZlRHo=";
|
|
};
|
|
|
|
postPatch = ''
|
|
substituteInPlace incdefs.sh --replace \
|
|
'/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.sourceforge.net/";
|
|
maintainers = [ maintainers.markuskowa ];
|
|
license = licenses.gpl2Only;
|
|
platforms = platforms.linux;
|
|
};
|
|
}
|