@@ -1,26 +1,55 @@
1−{stdenv, fetchurl, which, libjpeg
1+{ stdenv, fetchurl, pkgconfig
2−, withQt4 ? false, qt4 ? null}:
2+, libjpeg
5+, qt4 ? null # The default is set to qt4 in all-packages.nix
9+# See libv4l in all-packages.nix for the libs only (overrides alsa, libX11 & QT)
11+assert qt4 != null -> qt5 == null;
4−assert withQt4 -> qt4 != null;
12+assert qt5 != null -> qt4 == null;
15+ inherit (stdenv.lib) optional;
6stdenv.mkDerivation rec {
18stdenv.mkDerivation rec {
7− name = "v4l-utils-1.0.0";
19+ name = "v4l-utils-1.6.2";
9 src = fetchurl {
21 src = fetchurl {
10 url = "http://linuxtv.org/downloads/v4l-utils/${name}.tar.bz2";
22 url = "http://linuxtv.org/downloads/v4l-utils/${name}.tar.bz2";
11− sha256 = "0c2z500ijxr1ldzb4snasfpwi2icp04f8pk7akiqjkp0k4h8iqqx";
23+ sha256 = "0zdyjrja2mkqlijpdb4gz1vw0g7pslswmgqqsgri3yq408gypmnk";
14− buildInputs = [ which ];
26+ configureFlags = [
15− propagatedBuildInputs = [ libjpeg ] ++ stdenv.lib.optional withQt4 qt4;
27+ "--enable-libv4l"
28+ ] ++ (if (alsaLib != null && libX11 != null && (qt4 != null || qt5 != null)) then [
29+ "--with-udevdir=\${out}/lib/udev"
35+ "--disable-v4l-utils"
40+ # Create symlink for V4l1 compatibility
41+ ln -s $out/include/libv4l1-videodev.h $out/include/videodev.h
44+ nativeBuildInputs = [ pkgconfig ];
17− preConfigure = ''configureFlags="--with-udevdir=$out/lib/udev"'';
46+ buildInputs = [ alsaLib libjpeg libX11 qt4 qt5 ];
19− meta = {
48+ meta = with stdenv.lib; {
49+ description = "V4L utils and libv4l, provide common image formats regardless of the v4l device";
20 homepage = http://linuxtv.org/projects.php;
50 homepage = http://linuxtv.org/projects.php;
21− description = "V4L utils and libv4l, that provides common image formats regardless of the v4l device";
51+ license = licenses.lgpl21Plus;
22− license = stdenv.lib.licenses.free; # The libs are of LGPLv2.1+, some other pieces are GPL.
23− maintainers = with stdenv.lib.maintainers; [viric];
52+ maintainers = with maintainers; [ codyopel viric ];
24− platforms = with stdenv.lib.platforms; linux;
53+ platforms = platforms.linux;