nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, stdenv, kernel, fetchFromGitHub, autoreconfHook, bison, flex, p7zip, rsync }:
2
3stdenv.mkDerivation rec {
4 pname = "ply";
5 version = "2.1.1-${lib.substring 0 7 src.rev}";
6
7 nativeBuildInputs = [ autoreconfHook flex bison p7zip rsync ];
8
9 src = fetchFromGitHub {
10 owner = "iovisor";
11 repo = "ply";
12 rev = "e25c9134b856cc7ffe9f562ff95caf9487d16b59";
13 sha256 = "1178z7vvnjwnlxc98g2962v16878dy7bd0b2njsgn4vqgrnia7i5";
14 };
15
16 preAutoreconf = ''
17 # If kernel sources are a folder (i.e. fetched from git), we just copy them in
18 # Since they are owned by uid 0 and read-only, we need to fix permissions
19 if [ -d ${kernel.src} ]; then
20 cp -r ${kernel.src} linux-${kernel.version}
21 chown -R $(whoami): linux-${kernel.version}
22 chmod -R a+w linux-${kernel.version}
23 else
24 # ply wants to install header files to its build directory
25 # use 7z to handle multiple archive formats transparently
26 7z x ${kernel.src} -so | 7z x -aoa -si -ttar
27 fi
28
29 configureFlagsArray+=(--with-kerneldir=$(echo $(pwd)/linux-*))
30 ./autogen.sh --prefix=$out
31 '';
32
33 meta = with lib; {
34 description = "Dynamic tracing in Linux";
35 mainProgram = "ply";
36 homepage = "https://wkz.github.io/ply/";
37 license = [ licenses.gpl2Only ];
38 maintainers = with maintainers; [ mic92 mbbx6spp ];
39 };
40}