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:
zimbatm 2020-12-02 12:30:21 +01:00
parent fc7f72e144
commit 6da39cde64
No known key found for this signature in database
GPG Key ID: 71BAF6D40C1D63D7

View File

@ -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,7 +38,15 @@ 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 =
''
# Fix the bash completion location
installShellCompletion --bash $out/etc/bash_completion.d/sysdig
rm $out/etc/bash_completion.d/sysdig
rmdir $out/etc/bash_completion.d
rmdir $out/etc
''
+ optionalString (kernel != null) ''
make install_driver make install_driver
kernel_dev=${kernel.dev} kernel_dev=${kernel.dev}
kernel_dev=''${kernel_dev#/nix/store/} kernel_dev=''${kernel_dev#/nix/store/}
@ -52,6 +60,7 @@ stdenv.mkDerivation rec {
fi 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)";
license = with licenses; [ asl20 gpl2 mit ]; license = with licenses; [ asl20 gpl2 mit ];