summary refs log tree commit diff
path: root/pkgs/development/tools/fmbt/default.nix
blob: 71365c01bfdd9ac0bfc5fea114c8f14ec60477f5 (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
{ stdenv, fetchFromGitHub, python, autoreconfHook, pkgconfig, makeWrapper
, flex
, gettext, libedit, glib, imagemagick, libxml2, boost, gnuplot, graphviz
, tesseract, gts, libXtst
}:
stdenv.mkDerivation rec {
  version = "0.42";
  pname = "fMBT";

  src = fetchFromGitHub {
    owner = "intel";
    repo = "fMBT";
    rev = "v${version}";
    sha256 = "1jb9nb2mipc5cg99a80dny4m06vz2zral0q30fv75rz2cb6ja4zp";
  };

  nativeBuildInputs = [ autoreconfHook pkgconfig flex makeWrapper
    python.pkgs.wrapPython ];

  buildInputs = [ python gettext libedit glib imagemagick libxml2 boost
    gnuplot graphviz tesseract gts 
    ];

  propagatedBuildInputs = with python.pkgs; [
    pyside pydbus pexpect pysideShiboken
  ];

  preBuild = ''
    export PYTHONPATH="$PYTHONPATH:$out/lib/python${python.pythonVersion}/site-packages"
    export PATH="$PATH:$out/bin"
    export LD_LIBRARY_PATH="${stdenv.lib.makeLibraryPath [libXtst]}"
  '';

  postInstall = ''
    echo -e '#! ${stdenv.shell}\npython "$@"' > "$out/bin/fmbt-python"
    chmod a+x "$out/bin/fmbt-python"
    patchShebangs "$out/bin"
    for i in "$out"/bin/*; do
      wrapProgram "$i" --suffix "PATH" ":" "$PATH" \
        --suffix "PYTHONPATH" ":" "$PYTHONPATH" \
        --suffix "LD_LIBRARY_PATH" ":" "$LD_LIBRARY_PATH"
    done
  '';

  meta = with stdenv.lib; {
    description = "Free Model-Based Testing tool";
    homepage = "https://github.com/intel/fMBT";
    license = licenses.lgpl21;
    platforms = platforms.linux;
    maintainers = with maintainers; [ raskin ];
  };
}