push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,103 @@
From fa120ba1a02437c762fc6a37a60728cac380aa41 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zsolt=20Vad=C3=A1sz?= <zsolt_vadasz@protonmail.com>
Date: Sun, 11 May 2025 12:34:28 +0000
Subject: [PATCH] v4l2-tracer: Allow building on systems using musl
Signed-off-by: Zsolt Vadasz <zsolt_vadasz@protonmail.com>
Message-ID: <4dgJekVdP7lLqOQ6JNW05sRHSkRmLLMMQnEn8NGUHPoHDn4SBkaGlHUW89vkJJu3IeFDAh3p6mlplTJJlWJx8V4rr62-hd83quCJ2sIuqoA=@protonmail.com>
---
utils/v4l2-tracer/retrace.cpp | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/utils/v4l2-tracer/retrace.cpp b/utils/v4l2-tracer/retrace.cpp
index 010936c0..0acce10c 100644
--- a/utils/v4l2-tracer/retrace.cpp
+++ b/utils/v4l2-tracer/retrace.cpp
@@ -10,10 +10,14 @@ extern struct retrace_context ctx_retrace;
void retrace_mmap(json_object *mmap_obj, bool is_mmap64)
{
json_object *mmap_args_obj;
+#if defined(linux) && defined(__GLIBC__)
if (is_mmap64)
json_object_object_get_ex(mmap_obj, "mmap64", &mmap_args_obj);
else
json_object_object_get_ex(mmap_obj, "mmap", &mmap_args_obj);
+#else
+ json_object_object_get_ex(mmap_obj, "mmap", &mmap_args_obj);
+#endif
json_object *len_obj;
json_object_object_get_ex(mmap_args_obj, "len", &len_obj);
@@ -46,16 +50,24 @@ void retrace_mmap(json_object *mmap_obj, bool is_mmap64)
return;
void *buf_address_retrace_pointer = nullptr;
+#if defined(linux) && defined(__GLIBC__)
if (is_mmap64)
buf_address_retrace_pointer = mmap64(0, len, prot, flags, fd_retrace, off);
else
buf_address_retrace_pointer = mmap(0, len, prot, flags, fd_retrace, off);
+#else
+ buf_address_retrace_pointer = mmap(0, len, prot, flags, fd_retrace, off);
+#endif
if (buf_address_retrace_pointer == MAP_FAILED) {
+#if defined(linux) && defined(__GLIBC__)
if (is_mmap64)
perror("mmap64");
else
perror("mmap");
+#else
+ perror("mmap");
+#endif
debug_line_info();
print_context();
exit(EXIT_FAILURE);
@@ -116,10 +128,14 @@ void retrace_open(json_object *jobj, bool is_open64)
int fd_trace = json_object_get_int(fd_trace_obj);
json_object *open_args_obj;
+#if defined(linux) && defined(__GLIBC__)
if (is_open64)
json_object_object_get_ex(jobj, "open64", &open_args_obj);
else
json_object_object_get_ex(jobj, "open", &open_args_obj);
+#else
+ json_object_object_get_ex(jobj, "open", &open_args_obj);
+#endif
json_object *path_obj;
std::string path_trace;
@@ -148,10 +164,14 @@ void retrace_open(json_object *jobj, bool is_open64)
mode = s2number(json_object_get_string(mode_obj));
int fd_retrace = 0;
+#if defined(linux) && defined(__GLIBC__)
if (is_open64)
fd_retrace = open64(path_retrace.c_str(), oflag, mode);
else
fd_retrace = open(path_retrace.c_str(), oflag, mode);
+#else
+ fd_retrace = open(path_retrace.c_str(), oflag, mode);
+#endif
if (fd_retrace <= 0) {
line_info("\n\tCan't open: %s", path_retrace.c_str());
@@ -162,10 +182,14 @@ void retrace_open(json_object *jobj, bool is_open64)
if (is_verbose() || errno != 0) {
fprintf(stderr, "path: %s ", path_retrace.c_str());
+#if defined(linux) && defined(__GLIBC__)
if (is_open64)
perror("open64");
else
perror("open");
+#else
+ perror("open");
+#endif
debug_line_info();
print_context();
}
--
2.49.0

View File

@@ -0,0 +1,146 @@
{
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,
libGLU,
qt6Packages,
linuxHeaders,
buildPackages,
}:
# 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 libv4ls closure with Qt
stdenv.mkDerivation (finalAttrs: {
pname = "v4l-utils";
version = "1.30.1";
src = fetchurl {
url = "https://linuxtv.org/downloads/v4l-utils/v4l-utils-${finalAttrs.version}.tar.xz";
hash = "sha256-wc9UnC7DzznrXse/FXMTSeYbJqIbXpY5IttCIzO64Zc=";
};
patches = [
# Has been submitted upstream, but can't fetchurl/fetchpatch
# because patch doesn't know how to decode quoted-printable.
# https://lore.kernel.org/all/4dgJekVdP7lLqOQ6JNW05sRHSkRmLLMMQnEn8NGUHPoHDn4SBkaGlHUW89vkJJu3IeFDAh3p6mlplTJJlWJx8V4rr62-hd83quCJ2sIuqoA=@protonmail.com/
./musl.patch
];
outputs = [
"out"
]
++ lib.optional withUtils "lib"
++ [
"doc"
"dev"
];
mesonFlags = [
(lib.mesonBool "v4l-utils" withUtils)
(lib.mesonEnable "gconv" stdenv.hostPlatform.isGnu)
(lib.mesonEnable "qv4l2" withQt)
(lib.mesonEnable "qvidcap" withQt)
(lib.mesonOption "udevdir" "${placeholder "out"}/lib/udev")
]
++ lib.optionals stdenv.hostPlatform.isGnu [
(lib.mesonOption "gconvsysdir" "${glibc.out}/lib/gconv")
]
++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
# BPF support fail to cross compile, unable to find `linux/lirc.h`
(lib.mesonOption "bpf" "disabled")
];
postFixup = ''
# Create symlink for V4l1 compatibility
ln -s "$dev/include/libv4l1-videodev.h" "$dev/include/videodev.h"
'';
nativeBuildInputs = [
clang
doxygen
meson
ninja
pkg-config
perl
udevCheckHook
]
++ lib.optional withQt qt6Packages.wrapQtAppsHook;
buildInputs = [
json_c
libbpf
libelf
udev
]
++ lib.optional (!stdenv.hostPlatform.isGnu) argp-standalone
++ lib.optionals withQt [
alsa-lib
qt6Packages.qt5compat
qt6Packages.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')"
'';
# Meson unable to find moc/uic/rcc in case of cross-compilation
# https://github.com/mesonbuild/meson/issues/13018
preConfigure = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
export PATH=${buildPackages.qt6Packages.qtbase}/libexec:$PATH
'';
enableParallelBuilding = true;
doInstallCheck = true;
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-${finalAttrs.version}";
license = with licenses; [
lgpl21Plus
gpl2Plus
];
maintainers = with maintainers; [
codyopel
yarny
];
platforms = platforms.linux;
};
})

View File

@@ -0,0 +1,49 @@
{
lib,
stdenv,
fetchgit,
autoreconfHook,
glib,
gst_all_1,
libtool,
pkg-config,
which,
}:
stdenv.mkDerivation rec {
pname = "v4l2-relayd";
version = "0.1.3";
src = fetchgit {
url = "https://git.launchpad.net/v4l2-relayd";
tag = "upstream/${version}";
hash = "sha256-oU6naDFZ0PQVHZ3brANfMULDqYMYxeJN+MCUCvN/DpU=";
};
patches = [
./upstream-v4l2loopback-compatibility.patch
];
nativeBuildInputs = [
autoreconfHook
libtool
pkg-config
which
];
buildInputs = [
glib
gst_all_1.gstreamer
gst_all_1.gst-plugins-base
];
preConfigure = "./autogen.sh --prefix=$out";
meta = with lib; {
description = "Streaming relay for v4l2loopback using GStreamer";
mainProgram = "v4l2-relayd";
homepage = "https://git.launchpad.net/v4l2-relayd";
license = licenses.gpl2Only;
maintainers = with maintainers; [ betaboon ];
platforms = [ "x86_64-linux" ];
};
}

View File

@@ -0,0 +1,16 @@
diff --git a/src/v4l2-relayd.c b/src/v4l2-relayd.c
index 21bb0d5..cfc9e27 100644
--- a/src/v4l2-relayd.c
+++ b/src/v4l2-relayd.c
@@ -27,7 +27,10 @@
#include <gst/app/gstappsrc.h>
#include <gst/video/video-info.h>
-#define V4L2_EVENT_PRI_CLIENT_USAGE V4L2_EVENT_PRIVATE_START
+#define V4L2LOOPBACK_EVENT_BASE (V4L2_EVENT_PRIVATE_START)
+#define V4L2LOOPBACK_EVENT_OFFSET 0x08E00000
+#define V4L2_EVENT_PRI_CLIENT_USAGE \
+ (V4L2LOOPBACK_EVENT_BASE + V4L2LOOPBACK_EVENT_OFFSET + 1)
struct v4l2_event_client_usage {
__u32 count;

View File

@@ -0,0 +1,61 @@
{
lib,
stdenv,
fetchFromGitHub,
autoPatchelfHook,
openssl,
curl,
avahi,
ndi,
}:
stdenv.mkDerivation {
pname = "v4l2-to-ndi";
version = "0-unstable-2022-09-14";
nativeBuildInputs = [ autoPatchelfHook ];
buildInputs = [
openssl
curl
avahi
ndi
];
src = fetchFromGitHub {
owner = "lplassman";
repo = "V4L2-to-NDI";
rev = "4dd5e9594acc4f154658283ee52718fa58018ac9";
hash = "sha256-blB8HRfO2k1zsZamugOXZzW8uS26uf8+7sA0zBbV/K4=";
};
buildPhase = ''
runHook preBuild
mkdir build
g++ -std=c++14 -pthread -Wl,--allow-shlib-undefined -Wl,--as-needed \
-I'NDI SDK for Linux'/include/ \
-Iinclude/ \
-L'NDI SDK for Linux'/lib/x86_64-linux-gnu \
-o build/v4l2ndi main.cpp PixelFormatConverter.cpp -lndi -ldl
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir $out
cp -r build $out/bin
runHook postInstall
'';
meta = with lib; {
description = "Video input (V4L2) to NDI converter";
homepage = "https://github.com/lplassman/V4L2-to-NDI";
license = licenses.mit;
maintainers = with maintainers; [
pinpox
MayNiklas
];
mainProgram = "v4l2ndi";
platforms = platforms.linux;
};
}