From 4ef6ce5953ed07d048ee8ac89adcb8da905b363c Mon Sep 17 00:00:00 2001 From: Rehno Lindeque Date: Fri, 17 Aug 2018 12:11:40 -0400 Subject: [PATCH] aravis: init at 0.5.13 --- pkgs/development/libraries/aravis/default.nix | 89 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 + 2 files changed, 93 insertions(+) create mode 100644 pkgs/development/libraries/aravis/default.nix diff --git a/pkgs/development/libraries/aravis/default.nix b/pkgs/development/libraries/aravis/default.nix new file mode 100644 index 000000000000..dc98de1c2cb6 --- /dev/null +++ b/pkgs/development/libraries/aravis/default.nix @@ -0,0 +1,89 @@ +{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, gtk-doc, intltool +, audit, glib, libusb, libxml2 +, wrapGAppsHook +, gstreamer ? null +, gst-plugins-base ? null +, gst-plugins-good ? null +, gst-plugins-bad ? null +, libnotify ? null +, gnome3 ? null +, enableUsb ? true +, enablePacketSocket ? true +, enableViewer ? true +, enableGstPlugin ? true +, enableCppTest ? false +, enableFastHeartbeat ? false +, enableAsan ? false +}: + +let + gstreamerAtLeastVersion1 = + stdenv.lib.all + (pkg: pkg != null && stdenv.lib.versionAtLeast (stdenv.lib.getVersion pkg) "1.0") + [ gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad ]; +in + assert enableGstPlugin -> stdenv.lib.all (pkg: pkg != null) [ gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad ]; + assert enableViewer -> enableGstPlugin; + assert enableViewer -> libnotify != null; + assert enableViewer -> gnome3 != null; + assert enableViewer -> gstreamerAtLeastVersion1; + + stdenv.mkDerivation rec { + + pname = "aravis"; + version = "0.5.13"; + name = "${pname}-${version}"; + + src = fetchFromGitHub { + owner = "AravisProject"; + repo = "aravis"; + rev= "c56e530b8ef53b84e17618ea2f334d2cbae04f48"; + sha256 = "1dj24dir239zmiscfhyy1m8z5rcbw0m1vx9lipx0r7c39bzzj5gy"; + }; + + outputs = [ "bin" "dev" "out" "lib" ]; + + nativeBuildInputs = [ + autoreconfHook + pkgconfig + intltool + gtk-doc + ] ++ stdenv.lib.optional enableViewer wrapGAppsHook; + + buildInputs = + [ glib libxml2 ] + ++ stdenv.lib.optional enableUsb libusb + ++ stdenv.lib.optional enablePacketSocket audit + ++ stdenv.lib.optionals (enableViewer || enableGstPlugin) [ gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad ] + ++ stdenv.lib.optionals (enableViewer) [ libnotify gnome3.gtk3 gnome3.defaultIconTheme ]; + + preAutoreconf = ''./autogen.sh''; + + configureFlags = + stdenv.lib.optional enableUsb "--enable-usb" + ++ stdenv.lib.optional enablePacketSocket "--enable-packet-socket" + ++ stdenv.lib.optional enableViewer "--enable-viewer" + ++ stdenv.lib.optional enableGstPlugin + (if gstreamerAtLeastVersion1 then "--enable-gst-plugin" else "--enable-gst-0.10-plugin") + ++ stdenv.lib.optional enableCppTest "--enable-cpp-test" + ++ stdenv.lib.optional enableFastHeartbeat "--enable-fast-heartbeat" + ++ stdenv.lib.optional enableAsan "--enable-asan"; + + 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; + license = stdenv.lib.licenses.lgpl2; + maintainers = []; + platforms = stdenv.lib.platforms.unix; + }; + } + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3b4730f35184..70d9c2cff17f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9136,6 +9136,10 @@ with pkgs; # apr with db58 on freebsd (nov 2015), for unknown reasons }; + aravis = callPackage ../development/libraries/aravis { + inherit (gst_all_1) gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad; + }; + arb = callPackage ../development/libraries/arb {}; arb-git = callPackage ../development/libraries/arb/git.nix {};