systemtap-unwrapped: extract from linuxPackages

This doesn't depend on a kernel version, and it's depended on by other
tools that don't depend on a kernel version.  They shouldn't have to
reach into linuxPackages for an arbitrary kernel version to get it.
This commit is contained in:
Alyssa Ross
2025-09-01 17:45:08 +02:00
parent 88e2e5af84
commit 4e7b9f82a4
3 changed files with 47 additions and 39 deletions
@@ -0,0 +1,41 @@
{
lib,
stdenv,
fetchgit,
pkg-config,
gettext,
cpio,
elfutils,
python3,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "systemtap";
version = "5.2";
src = fetchgit {
url = "git://sourceware.org/git/systemtap.git";
rev = "release-${finalAttrs.version}";
hash = "sha256-SUPNarZW8vdK9hQaI2kU+rfKWIPiXB4BvJvRNC1T9tU=";
};
nativeBuildInputs = [
pkg-config
cpio
python3
python3.pkgs.setuptools
];
buildInputs = [
elfutils
gettext
python3
];
enableParallelBuilding = true;
meta = {
homepage = "https://sourceware.org/systemtap/";
description = "Provides a scripting language for instrumentation on a live kernel plus user-space";
license = lib.licenses.gpl2;
platforms = lib.systems.inspect.patterns.isGnu;
};
})
@@ -1,11 +1,8 @@
{
lib,
fetchgit,
pkg-config,
gettext,
runCommand,
makeWrapper,
cpio,
systemtap-unwrapped,
elfutils,
kernel,
gnumake,
@@ -15,33 +12,8 @@
}:
let
## fetchgit info
url = "git://sourceware.org/git/systemtap.git";
rev = "release-${version}";
hash = "sha256-SUPNarZW8vdK9hQaI2kU+rfKWIPiXB4BvJvRNC1T9tU=";
version = "5.2";
inherit (kernel) stdenv;
## stap binaries
stapBuild = stdenv.mkDerivation {
pname = "systemtap";
inherit version;
src = fetchgit { inherit url rev hash; };
nativeBuildInputs = [
pkg-config
cpio
python3
python3.pkgs.setuptools
];
buildInputs = [
elfutils
gettext
python3
];
enableParallelBuilding = true;
};
## symlink farm for --sysroot flag
sysroot = runCommand "systemtap-sysroot-${kernel.version}" { } ''
mkdir -p $out/boot $out/usr/lib/debug
@@ -53,17 +25,12 @@ let
pypkgs = with python3.pkgs; makePythonPath [ pyparsing ];
in
runCommand "systemtap-${version}"
runCommand "systemtap-${systemtap-unwrapped.version}"
{
inherit stapBuild;
stapBuild = systemtap-unwrapped;
nativeBuildInputs = [ makeWrapper ];
passthru.tests = { inherit (nixosTests.systemtap) linux_default linux_latest; };
meta = {
homepage = "https://sourceware.org/systemtap/";
description = "Provides a scripting language for instrumentation on a live kernel plus user-space";
license = lib.licenses.gpl2;
platforms = lib.systems.inspect.patterns.isGnu;
};
inherit (systemtap-unwrapped) meta;
}
(
''
@@ -27,7 +27,7 @@
libpfm,
libtraceevent,
openssl,
systemtap,
systemtap-unwrapped,
numactl,
zlib,
babeltrace,
@@ -150,7 +150,7 @@ stdenv.mkDerivation {
libopcodes_2_38
]
)
++ lib.optional (lib.meta.availableOn stdenv.hostPlatform systemtap) systemtap.stapBuild
++ lib.optional (lib.meta.availableOn stdenv.hostPlatform systemtap-unwrapped) systemtap-unwrapped
++ lib.optional withGtk gtk2
++ lib.optional withZstd zstd
++ lib.optional withLibcap libcap