2021-03-14 17:50:12 +00:00
|
|
|
{ lib, stdenv, kernel, fetchFromGitHub, autoreconfHook, bison, flex, p7zip, rsync }:
|
2017-06-18 12:52:02 +01:00
|
|
|
|
2021-01-15 14:45:37 +00:00
|
|
|
assert kernel != null -> lib.versionAtLeast kernel.version "4.0";
|
2017-06-18 12:52:02 +01:00
|
|
|
|
2017-06-14 23:25:46 +01:00
|
|
|
let
|
|
|
|
version = "1.0.beta1-9e810b1";
|
|
|
|
in stdenv.mkDerivation {
|
2019-08-13 22:52:01 +01:00
|
|
|
pname = "ply";
|
|
|
|
inherit version;
|
2021-03-14 17:50:12 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook flex bison p7zip rsync ];
|
2017-06-14 23:25:46 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "iovisor";
|
|
|
|
repo = "ply";
|
|
|
|
rev = "9e810b157ba079c32c430a7d4c6034826982056e";
|
|
|
|
sha256 = "15cp6iczawaqlhsa0af6i37zn5iq53kh6ya8s2hzd018yd7mhg50";
|
|
|
|
};
|
|
|
|
|
2017-06-15 20:30:12 +01:00
|
|
|
preAutoreconf = ''
|
2017-08-29 01:12:17 +01:00
|
|
|
# If kernel sources are a folder (i.e. fetched from git), we just copy them in
|
|
|
|
# Since they are owned by uid 0 and read-only, we need to fix permissions
|
|
|
|
if [ -d ${kernel.src} ]; then
|
|
|
|
cp -r ${kernel.src} linux-${kernel.version}
|
|
|
|
chown -R $(whoami): linux-${kernel.version}
|
|
|
|
chmod -R a+w linux-${kernel.version}
|
|
|
|
else
|
|
|
|
# ply wants to install header files to its build directory
|
|
|
|
# use 7z to handle multiple archive formats transparently
|
|
|
|
7z x ${kernel.src} -so | 7z x -aoa -si -ttar
|
|
|
|
fi
|
2017-06-18 12:52:02 +01:00
|
|
|
|
2017-06-15 20:30:12 +01:00
|
|
|
configureFlagsArray+=(--with-kerneldir=$(echo $(pwd)/linux-*))
|
|
|
|
./autogen.sh --prefix=$out
|
|
|
|
'';
|
2017-06-14 23:25:46 +01:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2017-06-15 20:30:12 +01:00
|
|
|
description = "dynamic Tracing in Linux";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://wkz.github.io/ply/";
|
2017-06-15 20:30:12 +01:00
|
|
|
license = [ licenses.gpl2 ];
|
|
|
|
maintainers = with maintainers; [ mic92 mbbx6spp ];
|
|
|
|
};
|
2017-06-14 23:25:46 +01:00
|
|
|
}
|