2021-02-05 17:12:51 +00:00
|
|
|
|
{ stdenv, lib, fetchurl, pkg-config, perl
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, libjpeg, udev
|
|
|
|
|
, 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";
|
2020-08-20 17:08:02 +00:00
|
|
|
|
version = "1.20.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
|
url = "https://linuxtv.org/downloads/${pname}/${pname}-${version}.tar.bz2";
|
2020-08-20 17:08:02 +00:00
|
|
|
|
sha256 = "1xr66y6w422hil6s7n8d61a2vhwh4im8l267amf41jvw7xqihqcm";
|
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
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
|
buildInputs = [ udev ] ++ lib.optionals withQt [ alsa-lib libX11 qtbase libGLU ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ libjpeg ];
|
|
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
|
patchShebangs utils/cec-ctl/msg2ctl.pl
|
2020-08-20 17:08:02 +00:00
|
|
|
|
patchShebangs utils/libcecutil/cec-gen.pl
|
2020-04-24 23:36:52 +00:00
|
|
|
|
'';
|
|
|
|
|
|
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";
|
|
|
|
|
license = licenses.lgpl21Plus;
|
|
|
|
|
maintainers = with maintainers; [ codyopel ];
|
|
|
|
|
platforms = platforms.linux;
|
|
|
|
|
};
|
|
|
|
|
}
|