Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions pkgs/by-name/ed/edid-decode/package.nix

This file was deleted.

4 changes: 2 additions & 2 deletions pkgs/by-name/ed/edid-generator/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
stdenv,
fetchFromGitHub,
dos2unix,
edid-decode,
hexdump,
v4l-utils,
zsh,
}:

Expand Down Expand Up @@ -34,8 +34,8 @@ stdenv.mkDerivation {

nativeBuildInputs = [
dos2unix
edid-decode
hexdump
v4l-utils
zsh
];

Expand Down
4 changes: 2 additions & 2 deletions pkgs/by-name/ga/gamescope/package.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
stdenv,
buildPackages,
edid-decode,
v4l-utils,
fetchFromGitHub,
fetchpatch,
meson,
Expand Down Expand Up @@ -115,7 +115,7 @@ stdenv.mkDerivation (finalAttrs: {
# For `libdisplay-info`
python3
hwdata
edid-decode
v4l-utils
# For OpenVR
cmake

Expand Down
4 changes: 2 additions & 2 deletions pkgs/by-name/li/libdisplay-info/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
ninja,
python3,
hwdata,
edid-decode,
v4l-utils,
}:

stdenv.mkDerivation rec {
Expand All @@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
meson
pkg-config
ninja
edid-decode
v4l-utils
hwdata
python3
];
Expand Down
79 changes: 56 additions & 23 deletions pkgs/os-specific/linux/v4l-utils/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,76 +2,106 @@
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;

in
# we need to use stdenv.mkDerivation in order not to pollute the libv4l’s closure with Qt
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "v4l-utils";
version = "1.24.1";
version = "1.30.1";

src = fetchurl {
url = "https://linuxtv.org/downloads/${pname}/${pname}-${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" ];
outputs =
[ "out" ]
++ lib.optional withUtils "lib"
++ [
"doc"
"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
ln -s "$dev/include/libv4l1-videodev.h" "$dev/include/videodev.h"
'';

nativeBuildInputs = [
clang
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we require clang rather than use whatever the stdenv provides?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we need it for BPF-related functionality: https://github.com/gjasny/v4l-utils/blob/v4l-utils-1.30.1/meson.build#L86
But since that's disabled in cross environments, clang shouldn't be added to nativeBuildInputs in those.

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;
Expand All @@ -81,12 +111,15 @@ stdenv.mkDerivation rec {
meta = with lib; {
description = "V4L utils and libv4l, provide common image formats regardless of the v4l device";
homepage = "https://linuxtv.org/projects.php";
changelog = "https://git.linuxtv.org/v4l-utils.git/plain/ChangeLog?h=v4l-utils-${version}";
changelog = "https://git.linuxtv.org/v4l-utils.git/plain/ChangeLog?h=v4l-utils-${finalAttrs.version}";
license = with licenses; [
lgpl21Plus
gpl2Plus
];
maintainers = with maintainers; [ codyopel ];
maintainers = with maintainers; [
codyopel
yarny
];
platforms = platforms.linux;
};
}
})
4 changes: 2 additions & 2 deletions pkgs/tools/system/hw-probe/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
coreutils,
curl, # Preferred to using the Perl HTTP libs - according to hw-probe.
dmidecode,
edid-decode,
gnugrep,
gnutar,
hwinfo,
Expand All @@ -27,6 +26,7 @@
perl,
smartmontools,
usbutils,
v4l-utils,
xz,

# Conditionally recommended
Expand Down Expand Up @@ -83,12 +83,12 @@ stdenv.mkDerivation rec {
smartmontools
pciutils
usbutils
edid-decode
iproute2 # (ip)
coreutils # (sort)
gnugrep
curl
gnutar
v4l-utils
xz
kmod # (lsmod)
];
Expand Down
1 change: 1 addition & 0 deletions pkgs/top-level/aliases.nix
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,7 @@ mapAliases {
edUnstable = throw "edUnstable was removed; use ed instead"; # Added 2024-07-01
edgedb = throw "edgedb replaced to gel because of change of upstream"; # Added 2025-02-24
edge-runtime = throw "'edge-runtime' was removed as it was unused, unmaintained, likely insecure and failed to build"; # Added 2025-05-18
edid-decode = v4l-utils; # Added 2025-06-20
eidolon = throw "eidolon was removed as it is unmaintained upstream."; # Added 2025-05-28
eintopf = lauti; # Project was renamed, added 2025-05-01
elasticsearch7Plugins = elasticsearchPlugins;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 { };

Expand Down
Loading