2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, gtk-doc, intltool
|
2020-04-24 23:36:52 +00:00
|
|
|
, audit, glib, libusb1, libxml2
|
|
|
|
, wrapGAppsHook
|
|
|
|
, gstreamer ? null
|
|
|
|
, gst-plugins-base ? null
|
|
|
|
, gst-plugins-good ? null
|
|
|
|
, gst-plugins-bad ? null
|
|
|
|
, libnotify ? null
|
2021-05-20 23:08:51 +00:00
|
|
|
, gnome ? null
|
2020-04-24 23:36:52 +00:00
|
|
|
, gtk3 ? null
|
|
|
|
, enableUsb ? true
|
|
|
|
, enablePacketSocket ? true
|
|
|
|
, enableViewer ? true
|
|
|
|
, enableGstPlugin ? true
|
|
|
|
, enableCppTest ? false
|
|
|
|
, enableFastHeartbeat ? false
|
|
|
|
, enableAsan ? false
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
gstreamerAtLeastVersion1 =
|
2021-02-05 17:12:51 +00:00
|
|
|
lib.all
|
|
|
|
(pkg: pkg != null && lib.versionAtLeast (lib.getVersion pkg) "1.0")
|
2020-04-24 23:36:52 +00:00
|
|
|
[ gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad ];
|
|
|
|
in
|
2021-02-05 17:12:51 +00:00
|
|
|
assert enableGstPlugin -> lib.all (pkg: pkg != null) [ gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad ];
|
2020-04-24 23:36:52 +00:00
|
|
|
assert enableViewer -> enableGstPlugin;
|
|
|
|
assert enableViewer -> libnotify != null;
|
2021-05-20 23:08:51 +00:00
|
|
|
assert enableViewer -> gnome != null;
|
2020-04-24 23:36:52 +00:00
|
|
|
assert enableViewer -> gtk3 != null;
|
|
|
|
assert enableViewer -> gstreamerAtLeastVersion1;
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
|
|
|
pname = "aravis";
|
|
|
|
version = "0.6.4";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "AravisProject";
|
|
|
|
repo = pname;
|
|
|
|
rev= "ARAVIS_${builtins.replaceStrings ["."] ["_"] version}";
|
|
|
|
sha256 = "18fnliks661kzc3g8v08hcaj18hjid8b180d6s9gwn0zgv4g374w";
|
|
|
|
};
|
|
|
|
|
|
|
|
outputs = [ "bin" "dev" "out" "lib" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
autoreconfHook
|
2021-02-05 17:12:51 +00:00
|
|
|
pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
intltool
|
|
|
|
gtk-doc
|
2021-02-05 17:12:51 +00:00
|
|
|
] ++ lib.optional enableViewer wrapGAppsHook;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs =
|
|
|
|
[ glib libxml2 ]
|
2021-02-05 17:12:51 +00:00
|
|
|
++ lib.optional enableUsb libusb1
|
|
|
|
++ lib.optional enablePacketSocket audit
|
|
|
|
++ lib.optionals (enableViewer || enableGstPlugin) [ gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad ]
|
2021-05-20 23:08:51 +00:00
|
|
|
++ lib.optionals (enableViewer) [ libnotify gtk3 gnome.adwaita-icon-theme ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
preAutoreconf = "./autogen.sh";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
configureFlags =
|
2021-02-05 17:12:51 +00:00
|
|
|
lib.optional enableUsb "--enable-usb"
|
|
|
|
++ lib.optional enablePacketSocket "--enable-packet-socket"
|
|
|
|
++ lib.optional enableViewer "--enable-viewer"
|
|
|
|
++ lib.optional enableGstPlugin
|
2020-04-24 23:36:52 +00:00
|
|
|
(if gstreamerAtLeastVersion1 then "--enable-gst-plugin" else "--enable-gst-0.10-plugin")
|
2021-02-05 17:12:51 +00:00
|
|
|
++ lib.optional enableCppTest "--enable-cpp-test"
|
|
|
|
++ lib.optional enableFastHeartbeat "--enable-fast-heartbeat"
|
|
|
|
++ lib.optional enableAsan "--enable-asan";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
ln -s ${gtk-doc}/share/gtk-doc/data/gtk-doc.make .
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Library for video acquisition using GenICam cameras";
|
|
|
|
longDescription = ''
|
|
|
|
Implements the gigabit ethernet and USB3 protocols used by industrial cameras.
|
|
|
|
'';
|
|
|
|
homepage = "https://aravisproject.github.io/docs/aravis-0.5";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = lib.licenses.lgpl2;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = [];
|
2021-02-05 17:12:51 +00:00
|
|
|
platforms = lib.platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|