summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/jn/jnetmap/package.nix
blob: 778b6c15bb79b03f29b7db2865b8a2fe23c2f26a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{
  lib,
  stdenv,
  fetchurl,
  jre,
  makeWrapper,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "jnetmap";
  version = "0.5.5";
  versionSuffix = "-703";

  src = fetchurl {
    url = "mirror://sourceforge/project/jnetmap/jNetMap%20${finalAttrs.version}/jNetMap-${finalAttrs.version}${finalAttrs.versionSuffix}.jar";
    sha256 = "sha256-e4Ssm2Sq/v1YZ7ZudAqgQ7Cz2ffwWbSmLFoKhaZvTPg=";
  };

  nativeBuildInputs = [ makeWrapper ];
  buildInputs = [ jre ];

  dontUnpack = true;

  installPhase = ''
    runHook preInstall

    mkdir -p "$out/bin"
    mkdir -p "$out/lib"

    cp "${finalAttrs.src}" "$out/lib/jnetmap.jar"
    makeWrapper "${jre}/bin/java" "$out/bin/jnetmap" \
        --add-flags "-jar \"$out/lib/jnetmap.jar\""

    runHook postInstall
  '';

  meta = {
    description = "Graphical network monitoring and documentation tool";
    mainProgram = "jnetmap";
    homepage = "http://www.rakudave.ch/jnetmap/";
    sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
    license = lib.licenses.gpl3Plus;
    # Upstream supports macOS and Windows too.
    platforms = lib.platforms.linux;
    maintainers = [ lib.maintainers.bjornfor ];
  };
})