Skip to content

Commit e171868

Browse files
committed
v4l-utils: update to 1.32.0.
1 parent 5765f72 commit e171868

2 files changed

Lines changed: 34 additions & 56 deletions

File tree

Lines changed: 31 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,34 @@
1-
From fd882f9e77b13cbc6a669e6836c3943393b44152 Mon Sep 17 00:00:00 2001
2-
From: Michal Rostecki <vadorovsky@gmail.com>
3-
Date: Fri, 6 Sep 2024 14:46:31 +0200
4-
Subject: libv4l2: Guard the v4l2_ioctl function with HAVE_POSIX_IOCTL
1+
Ensure that LIBV4L_HAVE_POSIX_IOCTL define is used when linking with other packages.
52

6-
Lack of this check leads to issues on musl-based system. Even though
7-
compilation of libv4l2 itself with musl doesn't cause any errors,
8-
using the library inside gst-plugins-v4l2 causes a compiler error
9-
due to mismatch of the ioctl signature.
10-
11-
A similar check is already performed in v4l2convert.c, so the change
12-
doesn't bring any inconsistency.
13-
14-
Link: https://bugs.gentoo.org/896418
15-
Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
16-
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
17-
---
18-
lib/include/libv4l2.h | 4 ++++
19-
lib/libv4l2/libv4l2.c | 4 ++++
20-
2 files changed, 8 insertions(+)
21-
22-
diff --git a/lib/include/libv4l2.h b/lib/include/libv4l2.h
23-
index ea1870db..16565555 100644
24-
--- a/lib/include/libv4l2.h
25-
+++ b/lib/include/libv4l2.h
26-
@@ -63,7 +63,11 @@ LIBV4L_PUBLIC extern FILE *v4l2_log_file;
27-
LIBV4L_PUBLIC int v4l2_open(const char *file, int oflag, ...);
28-
LIBV4L_PUBLIC int v4l2_close(int fd);
29-
LIBV4L_PUBLIC int v4l2_dup(int fd);
30-
+#ifdef HAVE_POSIX_IOCTL
31-
+LIBV4L_PUBLIC int v4l2_ioctl(int fd, int request, ...);
32-
+#else
33-
LIBV4L_PUBLIC int v4l2_ioctl(int fd, unsigned long int request, ...);
34-
+#endif
35-
LIBV4L_PUBLIC ssize_t v4l2_read(int fd, void *buffer, size_t n);
36-
LIBV4L_PUBLIC ssize_t v4l2_write(int fd, const void *buffer, size_t n);
37-
LIBV4L_PUBLIC void *v4l2_mmap(void *start, size_t length, int prot, int flags,
38-
diff --git a/lib/libv4l2/libv4l2.c b/lib/libv4l2/libv4l2.c
39-
index 032a4f1c..1607ec35 100644
40-
--- a/lib/libv4l2/libv4l2.c
41-
+++ b/lib/libv4l2/libv4l2.c
42-
@@ -1051,7 +1051,11 @@ static int v4l2_s_fmt(int index, struct v4l2_format *dest_fmt)
43-
return 0;
44-
}
3+
diff -rup meson.build.orig meson.build
4+
--- a/meson.build.orig
5+
+++ b/meson.build
6+
@@ -383,12 +383,14 @@ if have_qt_opengl
7+
conf.set('HAVE_QTGL', 1)
8+
endif
9+
10+
+pkg_arguments = []
11+
ioctl_posix_test = '''
12+
#include <sys/ioctl.h>
13+
int ioctl (int, int, ...);
14+
'''
15+
if cc.compiles(ioctl_posix_test)
16+
conf.set('LIBV4L_HAVE_POSIX_IOCTL', 1)
17+
+ pkg_arguments += '-DLIBV4L_HAVE_POSIX_IOCTL=1'
18+
endif
19+
20+
c_arguments = []
21+
diff -rup lib/libv4l2/meson.build.orig lib/libv4l2/meson.build
22+
--- a/lib/libv4l2/meson.build.orig
23+
+++ b/lib/libv4l2/meson.build
24+
@@ -48,7 +48,8 @@ pkg.generate(
25+
name : 'libv4l2',
26+
version : meson.project_version(),
27+
requires_private : 'libv4lconvert',
28+
- description : 'v4l2 device access library')
29+
+ description : 'v4l2 device access library',
30+
+ extra_cflags : pkg_arguments)
4531

46-
+#ifdef HAVE_POSIX_IOCTL
47-
+int v4l2_ioctl(int fd, int request, ...)
48-
+#else
49-
int v4l2_ioctl(int fd, unsigned long int request, ...)
50-
+#endif
51-
{
52-
void *arg;
53-
va_list ap;
54-
--
55-
cgit v1.2.3
32+
if not get_option('v4l-wrappers')
33+
subdir_done()
5634

srcpkgs/v4l-utils/template

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Template file for 'v4l-utils'
22
pkgname=v4l-utils
3-
version=1.28.1
4-
revision=2
3+
version=1.32.0
4+
revision=1
55
build_style=meson
66
configure_args="-Dqv4l2=disabled -Dudevdir=/usr/lib/udev -Dgconv=disabled"
77
hostmakedepends="perl pkg-config gettext-devel"
@@ -13,7 +13,7 @@ license="GPL-2.0-or-later, LGPL-2.1-or-later"
1313
homepage="https://linuxtv.org/"
1414
changelog="https://git.linuxtv.org/v4l-utils.git/plain/ChangeLog"
1515
distfiles="https://linuxtv.org/downloads/v4l-utils/v4l-utils-${version}.tar.xz"
16-
checksum=0fa075ce59b6618847af6ea191b6155565ccaa44de0504581ddfed795a328a82
16+
checksum=6828828a17775526eb93fb258a9294d1d1073d633c344dd71ecd4e7a1ffb7dfc
1717
conf_files="/etc/rc_maps.cfg"
1818

1919
case "$XBPS_TARGET_MACHINE" in

0 commit comments

Comments
 (0)