nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at 19.03 59 lines 1.8 kB view raw
1{ fetchgit, pkgconfig, gettext, runCommand, makeWrapper 2, elfutils, kernel, gnumake, python2, python2Packages 3}: 4 5let 6 ## fetchgit info 7 url = git://sourceware.org/git/systemtap.git; 8 rev = "release-${version}"; 9 sha256 = "075p45ndr4pzrf5679hcsw1ws4x0xqvx3m037v04545762hki6la"; 10 version = "4.0"; 11 12 inherit (kernel) stdenv; 13 inherit (stdenv) lib; 14 15 ## stap binaries 16 stapBuild = stdenv.mkDerivation { 17 name = "systemtap-${version}"; 18 src = fetchgit { inherit url rev sha256; }; 19 nativeBuildInputs = [ pkgconfig ]; 20 buildInputs = [ elfutils gettext python2 python2Packages.setuptools ]; 21 enableParallelBuilding = true; 22 }; 23 24 ## a kernel build dir as expected by systemtap 25 kernelBuildDir = runCommand "kbuild-${kernel.version}-merged" { } '' 26 mkdir -p $out 27 for f in \ 28 ${kernel}/System.map \ 29 ${kernel.dev}/vmlinux \ 30 ${kernel.dev}/lib/modules/${kernel.modDirVersion}/build/{*,.*} 31 do 32 ln -s $(readlink -f $f) $out 33 done 34 ''; 35 36 pypkgs = with python2Packages; makePythonPath [ pyparsing ]; 37 38in runCommand "systemtap-${kernel.version}-${version}" { 39 inherit stapBuild kernelBuildDir; 40 buildInputs = [ makeWrapper ]; 41 meta = { 42 homepage = https://sourceware.org/systemtap/; 43 repositories.git = url; 44 description = "Provides a scripting language for instrumentation on a live kernel plus user-space"; 45 license = lib.licenses.gpl2; 46 platforms = lib.platforms.linux; 47 }; 48} '' 49 mkdir -p $out/bin 50 for bin in $stapBuild/bin/*; do 51 ln -s $bin $out/bin 52 done 53 rm $out/bin/stap $out/bin/dtrace 54 makeWrapper $stapBuild/bin/stap $out/bin/stap \ 55 --add-flags "-r $kernelBuildDir" \ 56 --prefix PATH : ${lib.makeBinPath [ stdenv.cc.cc stdenv.cc.bintools elfutils gnumake ]} 57 makeWrapper $stapBuild/bin/dtrace $out/bin/dtrace \ 58 --prefix PYTHONPATH : ${pypkgs} 59''