mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 23:13:19 +00:00
sysdig: fix bash-completion location
In order to support auto-loading, the bash-completion scripts should live in $out/share/bash-completion.
This commit is contained in:
parent
fc7f72e144
commit
6da39cde64
@ -1,4 +1,4 @@
|
|||||||
{ stdenv, fetchFromGitHub, cmake, kernel
|
{ stdenv, fetchFromGitHub, cmake, kernel, installShellFiles
|
||||||
, luajit, zlib, ncurses, perl, jsoncpp, libb64, openssl, curl, jq, gcc, elfutils, tbb, c-ares, protobuf, grpc
|
, luajit, zlib, ncurses, perl, jsoncpp, libb64, openssl, curl, jq, gcc, elfutils, tbb, c-ares, protobuf, grpc
|
||||||
}:
|
}:
|
||||||
|
|
||||||
@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
|
|||||||
sha256 = "sha256-lYjMvxMIReANNwMr62u881Nugrs9piOaN3EmrvGzRns=";
|
sha256 = "sha256-lYjMvxMIReANNwMr62u881Nugrs9piOaN3EmrvGzRns=";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake perl ];
|
nativeBuildInputs = [ cmake perl installShellFiles ];
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
zlib luajit ncurses jsoncpp libb64 openssl curl jq gcc elfutils tbb c-ares protobuf grpc
|
zlib luajit ncurses jsoncpp libb64 openssl curl jq gcc elfutils tbb c-ares protobuf grpc
|
||||||
] ++ optionals (kernel != null) kernel.moduleBuildDependencies;
|
] ++ optionals (kernel != null) kernel.moduleBuildDependencies;
|
||||||
@ -38,19 +38,28 @@ stdenv.mkDerivation rec {
|
|||||||
export KERNELDIR="${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
export KERNELDIR="${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postInstall = optionalString (kernel != null) ''
|
postInstall =
|
||||||
make install_driver
|
''
|
||||||
kernel_dev=${kernel.dev}
|
# Fix the bash completion location
|
||||||
kernel_dev=''${kernel_dev#/nix/store/}
|
installShellCompletion --bash $out/etc/bash_completion.d/sysdig
|
||||||
kernel_dev=''${kernel_dev%%-linux*dev*}
|
rm $out/etc/bash_completion.d/sysdig
|
||||||
if test -f "$out/lib/modules/${kernel.modDirVersion}/extra/sysdig-probe.ko"; then
|
rmdir $out/etc/bash_completion.d
|
||||||
sed -i "s#$kernel_dev#................................#g" $out/lib/modules/${kernel.modDirVersion}/extra/sysdig-probe.ko
|
rmdir $out/etc
|
||||||
else
|
''
|
||||||
xz -d $out/lib/modules/${kernel.modDirVersion}/extra/sysdig-probe.ko.xz
|
+ optionalString (kernel != null) ''
|
||||||
sed -i "s#$kernel_dev#................................#g" $out/lib/modules/${kernel.modDirVersion}/extra/sysdig-probe.ko
|
make install_driver
|
||||||
xz $out/lib/modules/${kernel.modDirVersion}/extra/sysdig-probe.ko
|
kernel_dev=${kernel.dev}
|
||||||
fi
|
kernel_dev=''${kernel_dev#/nix/store/}
|
||||||
'';
|
kernel_dev=''${kernel_dev%%-linux*dev*}
|
||||||
|
if test -f "$out/lib/modules/${kernel.modDirVersion}/extra/sysdig-probe.ko"; then
|
||||||
|
sed -i "s#$kernel_dev#................................#g" $out/lib/modules/${kernel.modDirVersion}/extra/sysdig-probe.ko
|
||||||
|
else
|
||||||
|
xz -d $out/lib/modules/${kernel.modDirVersion}/extra/sysdig-probe.ko.xz
|
||||||
|
sed -i "s#$kernel_dev#................................#g" $out/lib/modules/${kernel.modDirVersion}/extra/sysdig-probe.ko
|
||||||
|
xz $out/lib/modules/${kernel.modDirVersion}/extra/sysdig-probe.ko
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "A tracepoint-based system tracing tool for Linux (with clients for other OSes)";
|
description = "A tracepoint-based system tracing tool for Linux (with clients for other OSes)";
|
||||||
|
Loading…
Reference in New Issue
Block a user