2015-04-05 21:23:37 +01:00
|
|
|
{ stdenv, fetchurl, pkgconfig
|
|
|
|
, libjpeg
|
|
|
|
, alsaLib ? null
|
|
|
|
, libX11 ? null
|
|
|
|
, qt4 ? null # The default is set to qt4 in all-packages.nix
|
|
|
|
, qt5 ? null
|
|
|
|
}:
|
2011-08-13 09:59:00 +01:00
|
|
|
|
2015-04-05 21:23:37 +01:00
|
|
|
# See libv4l in all-packages.nix for the libs only (overrides alsa, libX11 & QT)
|
|
|
|
|
|
|
|
assert qt4 != null -> qt5 == null;
|
|
|
|
assert qt5 != null -> qt4 == null;
|
|
|
|
|
|
|
|
let
|
|
|
|
inherit (stdenv.lib) optional;
|
|
|
|
in
|
2012-05-22 15:30:12 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2016-07-09 17:44:44 +01:00
|
|
|
name = "v4l-utils-1.10.1";
|
2012-05-22 15:30:12 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://linuxtv.org/downloads/v4l-utils/${name}.tar.bz2";
|
2016-07-09 17:44:44 +01:00
|
|
|
sha256 = "1h1nhg5cmmzlbipak526nk4bm6d0yb217mll75f3rpg7kz1cqiv1";
|
2011-08-13 09:59:00 +01:00
|
|
|
};
|
|
|
|
|
2016-08-29 01:30:01 +01:00
|
|
|
outputs = [ "out" "dev" ];
|
2016-04-24 18:33:54 +01:00
|
|
|
|
2015-04-05 21:23:37 +01:00
|
|
|
configureFlags = [
|
|
|
|
"--enable-libv4l"
|
|
|
|
] ++ (if (alsaLib != null && libX11 != null && (qt4 != null || qt5 != null)) then [
|
|
|
|
"--with-udevdir=\${out}/lib/udev"
|
|
|
|
"--enable-v4l-utils"
|
|
|
|
"--enable-qv4l2"
|
|
|
|
] else [
|
|
|
|
"--without-libudev"
|
|
|
|
"--without-udevdir"
|
|
|
|
"--disable-v4l-utils"
|
|
|
|
"--disable-qv4l2"
|
|
|
|
]);
|
|
|
|
|
2016-04-24 18:33:54 +01:00
|
|
|
postFixup = ''
|
2015-04-05 21:23:37 +01:00
|
|
|
# Create symlink for V4l1 compatibility
|
2016-04-24 18:33:54 +01:00
|
|
|
ln -s "$dev/include/libv4l1-videodev.h" "$dev/include/videodev.h"
|
2015-04-05 21:23:37 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2011-08-13 09:59:00 +01:00
|
|
|
|
2015-04-06 06:27:23 +01:00
|
|
|
buildInputs = [ alsaLib libX11 qt4 qt5 ];
|
2016-04-24 18:33:54 +01:00
|
|
|
|
2015-04-06 06:27:23 +01:00
|
|
|
propagatedBuildInputs = [ libjpeg ];
|
2011-08-13 09:59:00 +01:00
|
|
|
|
2015-04-05 21:23:37 +01:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "V4L utils and libv4l, provide common image formats regardless of the v4l device";
|
2012-05-22 15:30:12 +01:00
|
|
|
homepage = http://linuxtv.org/projects.php;
|
2015-04-05 21:23:37 +01:00
|
|
|
license = licenses.lgpl21Plus;
|
|
|
|
maintainers = with maintainers; [ codyopel viric ];
|
|
|
|
platforms = platforms.linux;
|
2011-08-13 09:59:00 +01:00
|
|
|
};
|
2012-05-22 15:30:12 +01:00
|
|
|
}
|