diff --git a/pkgs/os-specific/linux/v4l-utils/default.nix b/pkgs/os-specific/linux/v4l-utils/default.nix index 76303415ae3c..f8b7697954bf 100644 --- a/pkgs/os-specific/linux/v4l-utils/default.nix +++ b/pkgs/os-specific/linux/v4l-utils/default.nix @@ -2,22 +2,30 @@ stdenv, lib, fetchurl, + glibc, + clang, + doxygen, + meson, + ninja, pkg-config, perl, argp-standalone, libjpeg, + json_c, + libbpf, + libelf, udev, udevCheckHook, withUtils ? true, withGUI ? true, alsa-lib, - libX11, + qt5compat, qtbase, libGLU, wrapQtAppsHook, }: -# See libv4l in all-packages.nix for the libs only (overrides alsa, libX11 & QT) +# See libv4l in all-packages.nix for the libs only (overrides alsa, QT) let withQt = withUtils && withGUI; @@ -26,26 +34,22 @@ in # we need to use stdenv.mkDerivation in order not to pollute the libv4l’s closure with Qt stdenv.mkDerivation (finalAttrs: { pname = "v4l-utils"; - version = "1.24.1"; + version = "1.30.1"; src = fetchurl { - url = "https://linuxtv.org/downloads/v4l-utils/v4l-utils-${finalAttrs.version}.tar.bz2"; - hash = "sha256-y7f+imMH9c5TOgXN7XC7k8O6BjlaubbQB+tTt12AX1s="; + url = "https://linuxtv.org/downloads/v4l-utils/v4l-utils-${finalAttrs.version}.tar.xz"; + hash = "sha256-wc9UnC7DzznrXse/FXMTSeYbJqIbXpY5IttCIzO64Zc="; }; 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" - ] - ); + mesonFlags = [ + (lib.mesonBool "v4l-utils" withUtils) + (lib.mesonEnable "qv4l2" withQt) + (lib.mesonEnable "qvidcap" withQt) + (lib.mesonOption "gconvsysdir" "${glibc.out}/lib/gconv") + (lib.mesonOption "udevdir" "${placeholder "out"}/lib/udev") + ]; postFixup = '' # Create symlink for V4l1 compatibility @@ -53,25 +57,45 @@ stdenv.mkDerivation (finalAttrs: { ''; nativeBuildInputs = [ + clang + doxygen + meson + ninja pkg-config perl udevCheckHook ] ++ lib.optional withQt wrapQtAppsHook; buildInputs = - [ udev ] + [ + json_c + libbpf + libelf + udev + ] ++ lib.optional (!stdenv.hostPlatform.isGnu) argp-standalone ++ lib.optionals withQt [ alsa-lib - libX11 + qt5compat qtbase libGLU ]; + hardeningDisable = [ "zerocallusedregs" ]; + propagatedBuildInputs = [ libjpeg ]; + # these two `substituteInPlace` have been sent upstream as patches + # https://lore.kernel.org/linux-media/867c4d2e-7871-4280-8c89-d4b654597f32@public-files.de/T/ + # they might fail and have to be removed once the patches get accepted postPatch = '' patchShebangs utils/ + substituteInPlace \ + lib/libdvbv5/meson.build \ + --replace-fail "install_dir: 'include/libdvbv5'" "install_dir: get_option('includedir') / 'libdvbv5'" + substituteInPlace \ + meson.build \ + --replace-fail "get_option('datadir') / 'locale'" "get_option('localedir')" ''; enableParallelBuilding = true; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 741975335fcf..74a167c932bd 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11515,7 +11515,7 @@ with pkgs; translateManpages = false; }; - v4l-utils = qt5.callPackage ../os-specific/linux/v4l-utils { }; + v4l-utils = qt6.callPackage ../os-specific/linux/v4l-utils { }; windows = callPackages ../os-specific/windows { };