mstflint: 4.17 -> 4.26

Adds support for new Nvidia NICs and bugfixes.
Also add myself as maintainer.

Most notable changes are also documented in:
https://github.com/Mellanox/mstflint/files/12317054/MSTFLINT.Package.-Firmware.Burning.and.Diagnostics.Tools.Documentation.v4.26.0.pdf

Signed-off-by: Markus Theil <theil.markus@gmail.com>

+89 -5
+89 -5
pkgs/tools/misc/mstflint/default.nix
··· 1 { lib 2 , stdenv 3 , fetchurl 4 - , libibmad 5 , openssl 6 , zlib 7 }: 8 9 stdenv.mkDerivation rec { 10 pname = "mstflint"; 11 - version = "4.17.0-1"; 12 13 src = fetchurl { 14 url = "https://github.com/Mellanox/mstflint/releases/download/v${version}/mstflint-${version}.tar.gz"; 15 - sha256 = "030vpiv44sxmjf0dng91ziq1cggwj33yp0l4xc6cdhnrv2prjs7y"; 16 }; 17 18 buildInputs = [ 19 - libibmad 20 openssl 21 - zlib 22 ]; 23 24 hardeningDisable = [ "format" ]; 25 26 dontDisableStatic = true; # the build fails without this. should probably be reported upstream ··· 29 description = "Open source version of Mellanox Firmware Tools (MFT)"; 30 homepage = "https://github.com/Mellanox/mstflint"; 31 license = with licenses; [ gpl2 bsd2 ]; 32 platforms = platforms.linux; 33 }; 34 }
··· 1 { lib 2 , stdenv 3 , fetchurl 4 + , rdma-core 5 , openssl 6 , zlib 7 + , xz 8 + , expat 9 + , boost 10 + , curl 11 + , pkg-config 12 + , libxml2 13 + , pciutils 14 + , busybox 15 + , python3 16 + , automake 17 + , autoconf 18 + , libtool 19 + , git 20 + # use this to shrink the package's footprint if necessary (e.g. for hardened appliances) 21 + , onlyFirmwareUpdater ? false 22 + # contains binary-only libraries 23 + , enableDPA ? true 24 }: 25 26 stdenv.mkDerivation rec { 27 pname = "mstflint"; 28 + version = "4.26.0-1"; 29 30 src = fetchurl { 31 url = "https://github.com/Mellanox/mstflint/releases/download/v${version}/mstflint-${version}.tar.gz"; 32 + hash = "sha256-P8XACcz6d8UTOhFFeTijfFOthBqnUghGlDj9K145sZ8="; 33 }; 34 35 + nativeBuildInputs = [ 36 + autoconf 37 + automake 38 + libtool 39 + pkg-config 40 + libxml2 41 + git 42 + ]; 43 + 44 buildInputs = [ 45 + rdma-core 46 + zlib 47 + libxml2 48 openssl 49 + ] ++ lib.optionals (!onlyFirmwareUpdater) [ 50 + boost 51 + curl 52 + expat 53 + xz 54 + python3 55 ]; 56 57 + preConfigure = '' 58 + export CPPFLAGS="-I$(pwd)/tools_layouts -isystem ${libxml2.dev}/include/libxml2" 59 + export INSTALL_BASEDIR=$out 60 + ./autogen.sh 61 + ''; 62 + 63 + # Cannot use wrapProgram since the python script's logic depends on the 64 + # filename and will get messed up if the executable is named ".xyz-wrapped". 65 + # That is why the python executable and runtime dependencies are injected 66 + # this way. 67 + # 68 + # Remove host_cpu replacement again (see https://github.com/Mellanox/mstflint/pull/865), 69 + # needs to hit master or a release. master_devel may be rebased. 70 + # 71 + # Remove patch for regex check, after https://github.com/Mellanox/mstflint/pull/871 72 + # got merged. 73 + prePatch = [ 74 + '' 75 + patchShebangs eval_git_sha.sh 76 + substituteInPlace configure.ac \ 77 + --replace "build_cpu" "host_cpu" 78 + substituteInPlace common/compatibility.h \ 79 + --replace "#define ROOT_PATH \"/\"" "#define ROOT_PATH \"$out/\"" 80 + substituteInPlace configure.ac \ 81 + --replace 'Whether to use GNU C regex])' 'Whether to use GNU C regex])],[AC_MSG_RESULT([yes])' 82 + '' 83 + (lib.optionals (!onlyFirmwareUpdater) '' 84 + substituteInPlace common/python_wrapper.sh \ 85 + --replace \ 86 + 'exec $PYTHON_EXEC $SCRIPT_PATH "$@"' \ 87 + 'export PATH=$PATH:${lib.makeBinPath [ (placeholder "out") pciutils busybox]}; exec ${python3}/bin/python3 $SCRIPT_PATH "$@"' 88 + '') 89 + ]; 90 + 91 + configureFlags = [ 92 + "--enable-xml2" 93 + "--datarootdir=${placeholder "out"}/share" 94 + ] ++ lib.optionals (!onlyFirmwareUpdater) [ 95 + "--enable-adb-generic-tools" 96 + "--enable-cs" 97 + "--enable-dc" 98 + "--enable-fw-mgr" 99 + "--enable-inband" 100 + "--enable-rdmem" 101 + ] ++ lib.optionals enableDPA [ 102 + "--enable-dpa" 103 + ]; 104 + 105 + enableParallelBuilding = true; 106 + 107 hardeningDisable = [ "format" ]; 108 109 dontDisableStatic = true; # the build fails without this. should probably be reported upstream ··· 112 description = "Open source version of Mellanox Firmware Tools (MFT)"; 113 homepage = "https://github.com/Mellanox/mstflint"; 114 license = with licenses; [ gpl2 bsd2 ]; 115 + maintainers = with maintainers; [ thillux ]; 116 platforms = platforms.linux; 117 }; 118 }