about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/aravis/default.nix
blob: ccdc06e906fe7585e7f2190e5eb0a0c1caf4fd49 (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
{ lib
, stdenv
, fetchFromGitHub
, meson
, ninja
, pkg-config
, gi-docgen
, glib
, libxml2
, gobject-introspection

, enableGstPlugin ? true
, enableViewer ? true
, gst_all_1
, gtk3
, wrapGAppsHook

, enableUsb ? true
, libusb1

, enablePacketSocket ? true
, enableFastHeartbeat ? false
}:

assert enableGstPlugin -> gst_all_1 != null;
assert enableViewer -> enableGstPlugin;
assert enableViewer -> gtk3 != null;
assert enableViewer -> wrapGAppsHook != null;

stdenv.mkDerivation rec {
  pname = "aravis";
  version = "0.8.31";

  src = fetchFromGitHub {
    owner = "AravisProject";
    repo = pname;
    rev = version;
    sha256 = "sha256-CsXnwrZqBCS7JVAB/7JlAAvks5HnYxgrdc4Bmg68QdE=";
  };

  outputs = [ "bin" "dev" "out" "lib" ];

  nativeBuildInputs = [
    meson
    ninja
    pkg-config
    gi-docgen
    gobject-introspection
  ] ++ lib.optional enableViewer wrapGAppsHook;

  buildInputs =
    [ glib libxml2 ]
    ++ lib.optional enableUsb libusb1
    ++ lib.optionals (enableViewer || enableGstPlugin) (with gst_all_1; [ gstreamer gst-plugins-base (gst-plugins-good.override { gtkSupport = true; }) gst-plugins-bad ])
    ++ lib.optionals (enableViewer) [ gtk3 ];

  mesonFlags = [
  ] ++ lib.optional enableFastHeartbeat "-Dfast-heartbeat=enabled"
  ++ lib.optional (!enableGstPlugin) "-Dgst-plugin=disabled"
  ++ lib.optional (!enableViewer) "-Dviewer=disabled"
  ++ lib.optional (!enableUsb) "-Dviewer=disabled"
  ++ lib.optional (!enablePacketSocket) "-Dpacket-socket=disabled";

  doCheck = true;

  meta = {
    description = "Library for video acquisition using GenICam cameras";
    longDescription = ''
      Implements the gigabit ethernet and USB3 protocols used by industrial cameras.
    '';
    # the documentation is the best working homepage that's not the Github repo
    homepage = "https://aravisproject.github.io/docs/aravis-0.8";
    license = lib.licenses.lgpl2;
    maintainers = with lib.maintainers; [ tpw_rules ];
    platforms = lib.platforms.unix;
  };
}