about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/networking/lxi-tools/default.nix
blob: ddf2147cea9f5b1557aa849508d808a6058f05c9 (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
{ lib, stdenv, fetchFromGitHub
, meson, ninja, cmake, pkg-config
, liblxi, readline, lua, bash-completion
, wrapGAppsHook
, glib, gtk4, gtksourceview5, libadwaita, json-glib
, desktop-file-utils, appstream-glib
, gsettings-desktop-schemas
, withGui ? false
}:

stdenv.mkDerivation rec {
  pname = "lxi-tools";
  version = "2.6";

  src = fetchFromGitHub {
    owner = "lxi-tools";
    repo = "lxi-tools";
    rev = "v${version}";
    sha256 = "sha256-THtMSiGlBes9OujFEZL88Twx+etYiQRJSk9DFYeGFhY=";
  };

  nativeBuildInputs = [
    meson ninja cmake pkg-config
  ] ++ lib.optional withGui wrapGAppsHook;

  buildInputs = [
    liblxi readline lua bash-completion
  ] ++ lib.optionals withGui [
    glib gtk4 gtksourceview5 libadwaita json-glib
    desktop-file-utils appstream-glib
    gsettings-desktop-schemas
  ];

  postUnpack = "sed -i '/meson.add_install.*$/d' source/meson.build";

  mesonFlags = lib.optional (!withGui) "-Dgui=false";

  postInstall = lib.optionalString withGui
    "glib-compile-schemas $out/share/glib-2.0/schemas";

  meta = with lib; {
    description = "Tool for communicating with LXI compatible instruments";
    longDescription = ''
      lxi-tools is a collection of open source software tools
      that enables control of LXI compatible instruments such
      as modern oscilloscopes, power supplies,
      spectrum analyzers etc.
    '';
    homepage = "https://lxi-tools.github.io/";
    license = licenses.bsd3;
    platforms = platforms.unix;
    maintainers = [ maintainers.vq ];
  };
}