2019-06-16 21:59:06 +02:00
|
|
|
{ stdenv, rpmextract, ncurses5, patchelf, requireFile, unzip }:
|
2013-09-17 11:03:51 +02:00
|
|
|
|
2013-09-16 15:56:55 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2019-03-18 21:32:02 +01:00
|
|
|
name = "megacli-${version}";
|
|
|
|
version = "8.07.14";
|
2013-09-17 11:03:51 +02:00
|
|
|
|
|
|
|
src =
|
2013-09-16 15:56:55 +02:00
|
|
|
requireFile {
|
2019-03-18 21:32:02 +01:00
|
|
|
name = "${builtins.replaceStrings ["."] ["-"] version}_MegaCLI.zip";
|
|
|
|
url = https://docs.broadcom.com/docs/12351587;
|
|
|
|
sha256 = "1sdn58fbmd3fj4nzbajq3gcyw71ilgdh45r5p4sa6xmb7np55cfr";
|
2013-09-16 15:56:55 +02:00
|
|
|
};
|
|
|
|
|
2019-03-18 21:32:02 +01:00
|
|
|
buildInputs = [rpmextract ncurses5 unzip];
|
2013-09-16 15:56:55 +02:00
|
|
|
libPath =
|
|
|
|
stdenv.lib.makeLibraryPath
|
2017-07-01 19:15:02 +02:00
|
|
|
[ stdenv.cc.cc stdenv.cc.libc ncurses5 ];
|
2013-09-16 15:56:55 +02:00
|
|
|
|
|
|
|
buildCommand = ''
|
|
|
|
unzip ${src}
|
2019-03-18 21:32:02 +01:00
|
|
|
rpmextract Linux/MegaCli-${version}-1.noarch.rpm
|
|
|
|
|
|
|
|
mkdir -p $out/{bin,share/MegaRAID/MegaCli}
|
|
|
|
cp -r opt $out
|
|
|
|
cp ${version}_MegaCLI.txt $out/share/MegaRAID/MegaCli
|
|
|
|
|
|
|
|
${patchelf}/bin/patchelf \
|
|
|
|
--interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
|
|
|
--set-rpath ${libPath}:${stdenv.cc.cc.lib}/lib64:${stdenv.cc.cc.lib}/lib \
|
|
|
|
$out/opt/MegaRAID/MegaCli/MegaCli64
|
|
|
|
|
2013-09-16 15:56:55 +02:00
|
|
|
ln -s $out/opt/MegaRAID/MegaCli/MegaCli64 $out/bin/MegaCli64
|
|
|
|
eval fixupPhase
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2013-09-17 11:03:51 +02:00
|
|
|
description = "CLI program for LSI MegaRAID cards, which also works with some Dell PERC RAID cards";
|
2014-06-19 06:19:00 +02:00
|
|
|
license = stdenv.lib.licenses.unfree;
|
2018-05-03 07:58:11 +02:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2013-09-16 15:56:55 +02:00
|
|
|
};
|
|
|
|
}
|