2021-02-05 17:12:51 +00:00
|
|
|
|
{ stdenv, lib, fetchurl, pkg-config, perl
|
2022-07-14 12:49:19 +00:00
|
|
|
|
, argp-standalone, libjpeg, udev
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, withUtils ? true
|
2021-06-28 23:13:55 +00:00
|
|
|
|
, withGUI ? true, alsa-lib, libX11, qtbase, libGLU, wrapQtAppsHook
|
2020-04-24 23:36:52 +00:00
|
|
|
|
}:
|
|
|
|
|
|
|
|
|
|
# See libv4l in all-packages.nix for the libs only (overrides alsa, libX11 & QT)
|
|
|
|
|
|
|
|
|
|
let
|
|
|
|
|
withQt = withUtils && withGUI;
|
|
|
|
|
|
|
|
|
|
# we need to use stdenv.mkDerivation in order not to pollute the libv4l’s closure with Qt
|
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
|
pname = "v4l-utils";
|
2022-03-30 09:31:56 +00:00
|
|
|
|
version = "1.22.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
|
url = "https://linuxtv.org/downloads/${pname}/${pname}-${version}.tar.bz2";
|
2022-03-30 09:31:56 +00:00
|
|
|
|
hash = "sha256-Zcb76DCkTKEFxEOwJxgsGyyQU6kdHnKthJ36s4i5TjE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
outputs = [ "out" ] ++ lib.optional withUtils "lib" ++ [ "dev" ];
|
|
|
|
|
|
|
|
|
|
configureFlags = (if withUtils then [
|
|
|
|
|
"--with-localedir=${placeholder "lib"}/share/locale"
|
|
|
|
|
"--with-udevdir=${placeholder "out"}/lib/udev"
|
|
|
|
|
] else [
|
|
|
|
|
"--disable-v4l-utils"
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
|
# Create symlink for V4l1 compatibility
|
|
|
|
|
ln -s "$dev/include/libv4l1-videodev.h" "$dev/include/videodev.h"
|
|
|
|
|
'';
|
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
|
nativeBuildInputs = [ pkg-config perl ] ++ lib.optional withQt wrapQtAppsHook;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
|
buildInputs = [ udev ]
|
|
|
|
|
++ lib.optional (!stdenv.hostPlatform.isGnu) argp-standalone
|
|
|
|
|
++ lib.optionals withQt [ alsa-lib libX11 qtbase libGLU ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ libjpeg ];
|
|
|
|
|
|
|
|
|
|
postPatch = ''
|
2022-03-30 09:31:56 +00:00
|
|
|
|
patchShebangs utils/
|
2020-04-24 23:36:52 +00:00
|
|
|
|
'';
|
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
|
description = "V4L utils and libv4l, provide common image formats regardless of the v4l device";
|
|
|
|
|
homepage = "https://linuxtv.org/projects.php";
|
2022-03-30 09:31:56 +00:00
|
|
|
|
changelog = "https://git.linuxtv.org/v4l-utils.git/plain/ChangeLog?h=v4l-utils-${version}";
|
|
|
|
|
license = with licenses; [ lgpl21Plus gpl2Plus ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
maintainers = with maintainers; [ codyopel ];
|
|
|
|
|
platforms = platforms.linux;
|
|
|
|
|
};
|
|
|
|
|
}
|