summary refs log tree commit diff
path: root/pkgs/applications/networking/flent/default.nix
blob: 8da9a49f90a575299d7df2e110f11a8a76ea2c3d (plain) (blame)
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
48
49
50
51
52
53
54
55
{
  lib,
  buildPythonApplication,
  fetchPypi,
  procps,
  python,
  qt5,
  xvfb-run,
}:
buildPythonApplication rec {
  pname = "flent";
  version = "2.1.1";
  src = fetchPypi {
    inherit pname version;
    sha256 = "sha256-21gd6sPYCZll3Q2O7kucTRhXvc5byXeQr50+1bZVT3M=";
  };

  buildInputs = [python.pkgs.sphinx];
  nativeBuildInputs = [qt5.wrapQtAppsHook];
  propagatedBuildInputs = [
    procps
    python.pkgs.matplotlib
    python.pkgs.pyqt5
    python.pkgs.qtpy
  ];
  nativeCheckInputs = [
    python.pkgs.mock
    xvfb-run
  ];

  checkPhase = ''
    # we want the gui tests to always run
    sed -i 's|self.skip|pass; #&|' unittests/test_gui.py

    cat >test-runner <<EOF
    #!/bin/sh
    ${python.pythonForBuild.interpreter} nix_run_setup test
    EOF
    chmod +x test-runner
    wrapQtApp test-runner --prefix PYTHONPATH : $PYTHONPATH
    xvfb-run -s '-screen 0 800x600x24' ./test-runner
  '';

  preFixup = ''
    makeWrapperArgs+=("''${qtWrapperArgs[@]}")
  '';

  meta = with lib; {
    description = "The FLExible Network Tester";
    homepage = "https://flent.org";
    license = licenses.gpl3;

    maintainers = [maintainers.mmlb];
  };
}