sysdig: 0.6.0 -> 0.8.0; unpack kernel module when needed

This commit is contained in:
Michael Raskin 2016-02-14 14:42:37 +01:00
parent 4e27311fbf
commit 1e80424799

View File

@ -3,10 +3,10 @@ let
inherit (stdenv.lib) optional optionalString; inherit (stdenv.lib) optional optionalString;
s = rec { s = rec {
baseName="sysdig"; baseName="sysdig";
version = "0.6.0"; version = "0.8.0";
name="${baseName}-${version}"; name="${baseName}-${version}";
url="https://github.com/draios/sysdig/archive/${version}.tar.gz"; url="https://github.com/draios/sysdig/archive/${version}.tar.gz";
sha256 = "0729mjs9gpd7kb495q80zlp23zczm8ka3xcq4571c0sm732sa3g3"; sha256 = "1939k3clwxg09m1bn0szqiy2nxg66srl72n7476jc58hgaraq3dr";
}; };
buildInputs = [ buildInputs = [
cmake zlib luajit ncurses perl jsoncpp libb64 openssl curl cmake zlib luajit ncurses perl jsoncpp libb64 openssl curl
@ -32,7 +32,13 @@ stdenv.mkDerivation {
kernel_dev=${kernel.dev} kernel_dev=${kernel.dev}
kernel_dev=''${kernel_dev#/nix/store/} kernel_dev=''${kernel_dev#/nix/store/}
kernel_dev=''${kernel_dev%%-linux*dev*} kernel_dev=''${kernel_dev%%-linux*dev*}
sed -i "s#$kernel_dev#................................#g" $out/lib/modules/${kernel.modDirVersion}/extra/sysdig-probe.ko 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 = with stdenv.lib; { meta = with stdenv.lib; {