git.iko.soy/typeable/nixpkgs
on master help sign in
v4l_utils: 1.10.1 -> 1.12.3

Add CLI utils-only mode. Use flags instead of null's. Move to Qt 5.

commitfda2590abb81795e0e5b90d4f5fd5f40f2ce3242 authorNikolay Amiantov <ab@fmap.me> dateSun 2 Apr 2017, 23:43 (10 years ago) parent74e2f48
2 files changed+27−36
pkgs/os-specific/linux/v4l-utils/default.nix+25−29 pkgs/top-level/all-packages.nix+2−7
pkgs/os-specific/linux/v4l-utils/default.nix+25−29
@@ -1,54 +1,50 @@
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
1+{ stdenv, lib, fetchurl, pkgconfig, perl, makeQtWrapper
2+, libjpeg, udev
3+, withUtils ? true
4+, withGUI ? true, alsaLib, libX11, qtbase, mesa_glu
75}:
86
97# See libv4l in all-packages.nix for the libs only (overrides alsa, libX11 & QT)
108
11−assert qt4 != null -> qt5 == null;
12−assert qt5 != null -> qt4 == null;
13−
14−let
15− inherit (stdenv.lib) optional;
16−in
17−
189stdenv.mkDerivation rec {
19− name = "v4l-utils-1.10.1";
10+ name = "v4l-utils-${version}";
11+ version = "1.12.3";
2012
2113 src = fetchurl {
2214 url = "http://linuxtv.org/downloads/v4l-utils/${name}.tar.bz2";
23− sha256 = "1h1nhg5cmmzlbipak526nk4bm6d0yb217mll75f3rpg7kz1cqiv1";
15+ sha256 = "0vpl3jl0x441y7b5cn7zhdsyi954hp9h2p30jhnr1zkx1rpxsiss";
2416 };
2517
2618 outputs = [ "out" "dev" ];
2719
28− configureFlags = [
29− "--enable-libv4l"
30− ] ++ (if (alsaLib != null && libX11 != null && (qt4 != null || qt5 != null)) then [
31− "--with-udevdir=\${out}/lib/udev"
32− "--enable-v4l-utils"
33− "--enable-qv4l2"
34− ] else [
35− "--without-libudev"
36− "--without-udevdir"
37− "--disable-v4l-utils"
38− "--disable-qv4l2"
39− ]);
20+ configureFlags =
21+ if withUtils then [
22+ "--with-udevdir=\${out}/lib/udev"
23+ ] else [
24+ "--disable-v4l-utils"
25+ ];
4026
4127 postFixup = ''
4228 # Create symlink for V4l1 compatibility
4329 ln -s "$dev/include/libv4l1-videodev.h" "$dev/include/videodev.h"
4430 '';
4531
46− nativeBuildInputs = [ pkgconfig ];
32+ nativeBuildInputs = [ pkgconfig perl ] ++ lib.optional (withUtils && withGUI) makeQtWrapper;
4733
48− buildInputs = [ alsaLib libX11 qt4 qt5 ];
34+ buildInputs = [ udev ] ++ lib.optionals (withUtils && withGUI) [ alsaLib libX11 qtbase mesa_glu ];
4935
5036 propagatedBuildInputs = [ libjpeg ];
5137
38+ NIX_CFLAGS_COMPILE = lib.optional (withUtils && withGUI) "-std=c++11";
39+
40+ postPatch = ''
41+ patchShebangs .
42+ '';
43+
44+ postInstall = lib.optionalString (withUtils && withGUI) ''
45+ wrapQtProgram $out/bin/qv4l2
46+ '';
47+
5248 meta = with stdenv.lib; {
5349 description = "V4L utils and libv4l, provide common image formats regardless of the v4l device";
5450 homepage = http://linuxtv.org/projects.php;
pkgs/top-level/all-packages.nix+2−7
@@ -8844,10 +8844,7 @@ with pkgs;
88448844 };
88458845
88468846 libv4l = lowPrio (v4l_utils.override {
8847− alsaLib = null;
8848− libX11 = null;
8849− qt4 = null;
8850− qt5 = null;
8847+ withUtils = false;
88518848 });
88528849
88538850 libva = callPackage ../development/libraries/libva { };
@@ -12198,9 +12195,7 @@ with pkgs;
1219812195 systemd = null;
1219912196 });
1220012197
12201− v4l_utils = callPackage ../os-specific/linux/v4l-utils {
12202− qt5 = null;
12203− };
12198+ v4l_utils = qt5.callPackage ../os-specific/linux/v4l-utils { };
1220412199
1220512200 vndr = callPackage ../development/tools/vndr { };
1220612201