2021-01-15 09:19:50 +00:00
|
|
|
{ lib, stdenv, rpmextract, ncurses5, patchelf, fetchurl, unzip }:
|
2013-09-17 09:03:51 +00:00
|
|
|
|
2013-09-16 13:56:55 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "megacli";
|
2019-03-18 20:32:02 +00:00
|
|
|
version = "8.07.14";
|
2013-09-17 09:03:51 +00:00
|
|
|
|
2019-09-03 12:56:44 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://docs.broadcom.com/docs-and-downloads/raid-controllers/raid-controllers-common-files/${builtins.replaceStrings ["."] ["-"] version}_MegaCLI.zip";
|
|
|
|
sha256 = "1sdn58fbmd3fj4nzbajq3gcyw71ilgdh45r5p4sa6xmb7np55cfr";
|
|
|
|
};
|
2013-09-16 13:56:55 +00:00
|
|
|
|
2021-02-20 21:01:53 +00:00
|
|
|
nativeBuildInputs = [ unzip ];
|
|
|
|
buildInputs = [rpmextract ncurses5];
|
2013-09-16 13:56:55 +00:00
|
|
|
libPath =
|
2021-01-15 09:19:50 +00:00
|
|
|
lib.makeLibraryPath
|
2017-07-01 17:15:02 +00:00
|
|
|
[ stdenv.cc.cc stdenv.cc.libc ncurses5 ];
|
2013-09-16 13:56:55 +00:00
|
|
|
|
|
|
|
buildCommand = ''
|
|
|
|
unzip ${src}
|
2019-03-18 20:32:02 +00: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 13:56:55 +00:00
|
|
|
ln -s $out/opt/MegaRAID/MegaCli/MegaCli64 $out/bin/MegaCli64
|
|
|
|
eval fixupPhase
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2013-09-17 09:03:51 +00:00
|
|
|
description = "CLI program for LSI MegaRAID cards, which also works with some Dell PERC RAID cards";
|
2022-06-16 23:40:08 +00:00
|
|
|
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
|
2021-01-15 09:19:50 +00:00
|
|
|
license = lib.licenses.unfree;
|
2018-05-03 05:58:11 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2013-09-16 13:56:55 +00:00
|
|
|
};
|
|
|
|
}
|