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