2024-02-07 01:22:34 +00:00
|
|
|
{ lib, stdenv, fetchurl, perl, libunwind, buildPackages, gitUpdater, elfutils }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "strace";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "6.11";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://strace.io/files/${version}/${pname}-${version}.tar.xz";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-gyYlg6NSnwLDUBqouKx3K0y8A9yTTpi6tuSINibig6U=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
|
|
|
nativeBuildInputs = [ perl ];
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
# libunwind for -k.
|
2021-06-06 07:54:09 +00:00
|
|
|
# On RISC-V platforms, LLVM's libunwind implementation is unsupported by strace.
|
|
|
|
# The build will silently fall back and -k will not work on RISC-V.
|
2024-02-29 20:09:43 +00:00
|
|
|
buildInputs = [ libunwind ]
|
|
|
|
# -kk
|
|
|
|
++ lib.optional (lib.meta.availableOn stdenv.hostPlatform elfutils) elfutils;
|
2020-05-15 21:57:56 +00:00
|
|
|
|
2024-07-31 10:19:44 +00:00
|
|
|
configureFlags = [ "--enable-mpers=check" ]
|
|
|
|
++ lib.optional stdenv.cc.isClang "CFLAGS=-Wno-unused-function";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
passthru.updateScript = gitUpdater {
|
|
|
|
# No nicer place to find latest release.
|
|
|
|
url = "https://github.com/strace/strace.git";
|
|
|
|
rev-prefix = "v";
|
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://strace.io/";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "System call tracer for Linux";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = with licenses; [ lgpl21Plus gpl2Plus ]; # gpl2Plus is for the test suite
|
|
|
|
platforms = platforms.linux;
|
2021-05-04 21:07:42 +00:00
|
|
|
maintainers = with maintainers; [ globin ma27 qyliss ];
|
2023-10-19 13:55:26 +00:00
|
|
|
mainProgram = "strace";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|