at 24.05-pre 72 lines 2.2 kB view raw
1{ lib 2, buildDotnetModule 3, fetchurl 4, unzip 5, dos2unix 6, msbuild 7, mono 8}: 9buildDotnetModule rec { 10 pname = "networkminer"; 11 version = "2.8"; 12 13 src = fetchurl { 14 # Upstream does not provide versioned releases, a mirror has been uploaded 15 # to archive.org 16 url = "https://archive.org/download/networkminer-${lib.replaceStrings ["."] ["-"] version}/NetworkMiner_${lib.replaceStrings ["."] ["-"] version}_source.zip"; 17 sha256 = "1n2312acq5rq0jizlcfk0crslx3wgcsd836p47nk3pnapzw0cqvv"; 18 }; 19 20 nativeBuildInputs = [ unzip dos2unix msbuild ]; 21 22 patches = [ 23 # Store application data in XDG_DATA_DIRS instead of trying to write to nix store 24 ./xdg-dirs.patch 25 ]; 26 27 postPatch = '' 28 # Not all files have UTF-8 BOM applied consistently 29 find . -type f -exec dos2unix -m {} \+ 30 31 # Embedded base64-encoded app icon in resx fails to parse. Delete it 32 sed -zi 's|<data name="$this.Icon".*</data>||g' NetworkMiner/NamedPipeForm.resx 33 sed -zi 's|<data name="$this.Icon".*</data>||g' NetworkMiner/UpdateCheck.resx 34 ''; 35 36 nugetDeps = ./deps.nix; 37 38 buildPhase = '' 39 runHook preBuild 40 41 msbuild /p:Configuration=Release NetworkMiner.sln 42 43 runHook postBuild 44 ''; 45 46 installPhase = '' 47 runHook preInstall 48 49 mkdir -p $out/bin $out/share 50 cp -r NetworkMiner/bin/Release $out/share/NetworkMiner 51 makeWrapper ${mono}/bin/mono $out/bin/NetworkMiner \ 52 --add-flags "$out/share/NetworkMiner/NetworkMiner.exe" \ 53 --add-flags "--noupdatecheck" 54 55 install -D NetworkMiner/NetworkMiner.desktop $out/share/applications/NetworkMiner.desktop 56 substituteInPlace $out/share/applications/NetworkMiner.desktop \ 57 --replace "Exec=mono NetworkMiner.exe %f" "Exec=NetworkMiner" \ 58 --replace "Icon=./networkminericon-96x96.png" "Icon=NetworkMiner" 59 install -D NetworkMiner/networkminericon-96x96.png $out/share/pixmaps/NetworkMiner.png 60 61 runHook postInstall 62 ''; 63 64 meta = with lib; { 65 description = "The Open Source Network Forensic Analysis Tool (NFAT)"; 66 homepage = "https://www.netresec.com/?page=NetworkMiner"; 67 license = licenses.gpl2Only; 68 maintainers = with maintainers; [ emilytrau ]; 69 platforms = platforms.linux; 70 mainProgram = "NetworkMiner"; 71 }; 72}