nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, gtk-doc, intltool
2, audit, glib, libusb1, libxml2
3, wrapGAppsHook
4, gstreamer ? null
5, gst-plugins-base ? null
6, gst-plugins-good ? null
7, gst-plugins-bad ? null
8, libnotify ? null
9, gnome3 ? null
10, gtk3 ? null
11, enableUsb ? true
12, enablePacketSocket ? true
13, enableViewer ? true
14, enableGstPlugin ? true
15, enableCppTest ? false
16, enableFastHeartbeat ? false
17, enableAsan ? false
18}:
19
20let
21 gstreamerAtLeastVersion1 =
22 stdenv.lib.all
23 (pkg: pkg != null && stdenv.lib.versionAtLeast (stdenv.lib.getVersion pkg) "1.0")
24 [ gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad ];
25in
26 assert enableGstPlugin -> stdenv.lib.all (pkg: pkg != null) [ gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad ];
27 assert enableViewer -> enableGstPlugin;
28 assert enableViewer -> libnotify != null;
29 assert enableViewer -> gnome3 != null;
30 assert enableViewer -> gtk3 != null;
31 assert enableViewer -> gstreamerAtLeastVersion1;
32
33 stdenv.mkDerivation rec {
34
35 pname = "aravis";
36 version = "0.6.4";
37
38 src = fetchFromGitHub {
39 owner = "AravisProject";
40 repo = pname;
41 rev= "ARAVIS_${builtins.replaceStrings ["."] ["_"] version}";
42 sha256 = "18fnliks661kzc3g8v08hcaj18hjid8b180d6s9gwn0zgv4g374w";
43 };
44
45 outputs = [ "bin" "dev" "out" "lib" ];
46
47 nativeBuildInputs = [
48 autoreconfHook
49 pkgconfig
50 intltool
51 gtk-doc
52 ] ++ stdenv.lib.optional enableViewer wrapGAppsHook;
53
54 buildInputs =
55 [ glib libxml2 ]
56 ++ stdenv.lib.optional enableUsb libusb1
57 ++ stdenv.lib.optional enablePacketSocket audit
58 ++ stdenv.lib.optionals (enableViewer || enableGstPlugin) [ gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad ]
59 ++ stdenv.lib.optionals (enableViewer) [ libnotify gtk3 gnome3.adwaita-icon-theme ];
60
61 preAutoreconf = ''./autogen.sh'';
62
63 configureFlags =
64 stdenv.lib.optional enableUsb "--enable-usb"
65 ++ stdenv.lib.optional enablePacketSocket "--enable-packet-socket"
66 ++ stdenv.lib.optional enableViewer "--enable-viewer"
67 ++ stdenv.lib.optional enableGstPlugin
68 (if gstreamerAtLeastVersion1 then "--enable-gst-plugin" else "--enable-gst-0.10-plugin")
69 ++ stdenv.lib.optional enableCppTest "--enable-cpp-test"
70 ++ stdenv.lib.optional enableFastHeartbeat "--enable-fast-heartbeat"
71 ++ stdenv.lib.optional enableAsan "--enable-asan";
72
73 postPatch = ''
74 ln -s ${gtk-doc}/share/gtk-doc/data/gtk-doc.make .
75 '';
76
77 doCheck = true;
78
79 meta = {
80 description = "Library for video acquisition using GenICam cameras";
81 longDescription = ''
82 Implements the gigabit ethernet and USB3 protocols used by industrial cameras.
83 '';
84 homepage = "https://aravisproject.github.io/docs/aravis-0.5";
85 license = stdenv.lib.licenses.lgpl2;
86 maintainers = [];
87 platforms = stdenv.lib.platforms.unix;
88 };
89 }
90