2021-03-14 18:50:12 +01:00
|
|
|
{ lib, stdenv, kernel, fetchFromGitHub, autoreconfHook, bison, flex, p7zip, rsync }:
|
2017-06-18 13:52:02 +02:00
|
|
|
|
2017-06-15 00:25:46 +02:00
|
|
|
let
|
2021-08-15 12:22:35 +02:00
|
|
|
version = "2.1.1";
|
2017-06-15 00:25:46 +02:00
|
|
|
in stdenv.mkDerivation {
|
2019-08-13 23:52:01 +02:00
|
|
|
pname = "ply";
|
|
|
|
inherit version;
|
2021-03-14 18:50:12 +01:00
|
|
|
nativeBuildInputs = [ autoreconfHook flex bison p7zip rsync ];
|
2017-06-15 00:25:46 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "iovisor";
|
|
|
|
repo = "ply";
|
2021-08-17 08:11:22 +02:00
|
|
|
rev = version;
|
2021-08-15 12:22:35 +02:00
|
|
|
sha256 = "0mfnfczk6kw6p15nx5l735qmcnb0pkix7ngq0j8nndg7r2fsckah";
|
2017-06-15 00:25:46 +02:00
|
|
|
};
|
|
|
|
|
2017-06-15 21:30:12 +02:00
|
|
|
preAutoreconf = ''
|
2017-08-29 02:12:17 +02: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 13:52:02 +02:00
|
|
|
|
2017-06-15 21:30:12 +02:00
|
|
|
configureFlagsArray+=(--with-kerneldir=$(echo $(pwd)/linux-*))
|
|
|
|
./autogen.sh --prefix=$out
|
|
|
|
'';
|
2017-06-15 00:25:46 +02:00
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2021-08-15 12:22:35 +02:00
|
|
|
description = "Dynamic tracing in Linux";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://wkz.github.io/ply/";
|
2017-06-15 21:30:12 +02:00
|
|
|
license = [ licenses.gpl2 ];
|
|
|
|
maintainers = with maintainers; [ mic92 mbbx6spp ];
|
2021-08-17 08:08:02 +02:00
|
|
|
broken = lib.versionAtLeast kernel.version "4.0";
|
2017-06-15 21:30:12 +02:00
|
|
|
};
|
2017-06-15 00:25:46 +02:00
|
|
|
}
|