From 689327e79503480e774cff04560f8e4c695f5824 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sun, 4 Mar 2018 15:39:22 -0600 Subject: {main => community}/v4l-utils: move, use Qt 5 --- .../0001-ir-ctl-fixes-for-musl-compile.patch | 37 +++++++++ community/v4l-utils/APKBUILD | 96 ++++++++++++++++++++++ community/v4l-utils/fix-compliance.patch | 77 +++++++++++++++++ community/v4l-utils/getsubopt.patch | 36 ++++++++ community/v4l-utils/qv4l2.desktop | 12 +++ community/v4l-utils/qv4l2.svg | 31 +++++++ 6 files changed, 289 insertions(+) create mode 100644 community/v4l-utils/0001-ir-ctl-fixes-for-musl-compile.patch create mode 100644 community/v4l-utils/APKBUILD create mode 100644 community/v4l-utils/fix-compliance.patch create mode 100644 community/v4l-utils/getsubopt.patch create mode 100644 community/v4l-utils/qv4l2.desktop create mode 100644 community/v4l-utils/qv4l2.svg (limited to 'community/v4l-utils') diff --git a/community/v4l-utils/0001-ir-ctl-fixes-for-musl-compile.patch b/community/v4l-utils/0001-ir-ctl-fixes-for-musl-compile.patch new file mode 100644 index 0000000000..5391d815b5 --- /dev/null +++ b/community/v4l-utils/0001-ir-ctl-fixes-for-musl-compile.patch @@ -0,0 +1,37 @@ +diff --git a/utils/ir-ctl/ir-ctl.c b/utils/ir-ctl/ir-ctl.c +index bc58cee..1a44011 100644 +--- a/utils/ir-ctl/ir-ctl.c ++++ b/utils/ir-ctl/ir-ctl.c +@@ -42,6 +42,16 @@ + # define _(string) string + #endif + ++/* taken from glibc unistd.h */ ++#ifndef TEMP_FAILURE_RETRY ++#define TEMP_FAILURE_RETRY(expression) \ ++ (__extension__ \ ++ ({ long int __result; \ ++ do __result = (long int) (expression); \ ++ while (__result == -1L && errno == EINTR); \ ++ __result; })) ++#endif ++ + # define N_(string) string + + +@@ -344,12 +354,14 @@ static struct file *read_scancode(const char *name) + return NULL; + } + +- pstr = strndupa(name, p - name); ++ pstr = strndup(name, p - name); + + if (!protocol_match(pstr, &proto)) { + fprintf(stderr, _("error: protocol '%s' not found\n"), pstr); ++ free(pstr); + return NULL; + } ++ free(pstr); + + if (!strtoscancode(p + 1, &scancode)) { + fprintf(stderr, _("error: invalid scancode '%s'\n"), p + 1); diff --git a/community/v4l-utils/APKBUILD b/community/v4l-utils/APKBUILD new file mode 100644 index 0000000000..cff94a44ba --- /dev/null +++ b/community/v4l-utils/APKBUILD @@ -0,0 +1,96 @@ +# Contributor: Leonardo Arena +# Maintainer: Francesco Colista +pkgname=v4l-utils +pkgver=1.12.6 +pkgrel=1 +pkgdesc="Userspace tools and conversion library for Video 4 Linux" +url="http://freshmeat.net/projects/libv4l" +arch="all" +license="LGPL-2.0-or-later" +makedepends="qt5-qtbase-dev libjpeg-turbo-dev argp-standalone linux-headers + eudev-dev alsa-lib-dev" +subpackages="$pkgname-dev $pkgname-doc qv4l2 $pkgname-dvbv5 $pkgname-libs ir_keytable" +source="http://linuxtv.org/downloads/v4l-utils/$pkgname-$pkgver.tar.bz2 + qv4l2.svg + qv4l2.desktop + 0001-ir-ctl-fixes-for-musl-compile.patch + getsubopt.patch + " +builddir="$srcdir"/$pkgname-$pkgver + +build() { + cd "$builddir" + [ "$CLIBC" = "musl" ] && export CFLAGS="$CFLAGS -D__off_t=off_t" + export LIBS="-largp -lintl" + ./configure \ + --build=$CBUILD \ + --host=$CHOST \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --localstatedir=/var \ + --enable-libdvbv5 \ + --disable-static + make +} + +check() { + cd "$builddir" + make check +} + +package() { + cd "$builddir" + make -j1 DESTDIR="$pkgdir" install + install -Dm644 "$srcdir"/qv4l2.desktop \ + "$pkgdir"/usr/share/applications/qv4l2.desktop + install -Dm644 "$srcdir"/qv4l2.svg \ + "$pkgdir"/usr/share/icons/hicolor/scalable/apps/qv4l2.svg +} + +qv4l2() { + pkgdesc="QT v4l2 test control and streaming test application" + mkdir -p "$subpkgdir"/usr/bin + mv "$pkgdir"/usr/bin/qv4l2 "$subpkgdir"/usr/bin/ + mv "$pkgdir"/usr/share "$subpkgdir"/usr/ +} + +dvbv5() { + pkgdesc="Backwards compatible DVBv5 command line utilities" + mkdir -p "$subpkgdir"/usr/bin \ + "$subpkgdir"/usr/lib + mv "$pkgdir"/usr/bin/dvb* \ + "$subpkgdir"/usr/bin/ + mv "$pkgdir"/usr/lib/libdvbv5.* \ + "$subpkgdir"/usr/lib/ +} + +libs() { + pkgdesc="Collection of video4linux support libraries" + mkdir -p "$subpkgdir"/usr/lib + mv "$pkgdir"/usr/lib/* \ + "$subpkgdir"/usr/lib +} + +ir_keytable() { + pkgdesc="Alter keymaps of Remote Controller devices" + mkdir -p "$subpkgdir"/lib/udev/rc_keymaps \ + "$subpkgdir"/lib/udev/rules.d \ + "$subpkgdir"/usr/bin \ + "$subpkgdir"/etc + mv "$pkgdir"/lib/udev/rc_keymaps/* \ + "$subpkgdir"/lib/udev/rc_keymaps + mv "$pkgdir"/lib/udev/rules.d/* \ + "$subpkgdir"/lib/udev/rules.d + mv "$pkgdir"/usr/bin/ir-keytable \ + "$subpkgdir"/usr/bin + mv "$pkgdir"/etc/rc_maps.cfg \ + "$subpkgdir"/etc +} + +sha512sums="1f6e7ba9513ea836d6536eaf2f148588e9a2beaab62c49fb295e60aae41382781f76d536e854bbe6fc601f00034e3239b551874dc99a1f6afa788ee94976b332 v4l-utils-1.12.6.tar.bz2 +bc18280046c15b19984103f7c2bb44a0aea79715803c64f0c64bc932499c09022c956914c3b15ae59499adc09f6fbff5378be45707fe851250f495a26b63d682 qv4l2.svg +6f74aa524b3de420eeb8de788ff3f717020732a3f1f6530caee50e63aae7eddbe5f551ffc50065c9f5d6078c13bace089948ecdcacf01f8b82c1a44960e06315 qv4l2.desktop +f93d18b282d52c6cccbedc489e201a19b59f44b5e0aeb74b96537c3f5797c0b3c3f1499cd6ae822715c712e92b5ec5749749394f004ae1887a8bae3bac117c5b 0001-ir-ctl-fixes-for-musl-compile.patch +9a4f6d0a44d30bb7afe4db8b40074d362f240cae1f1b13feb0eb2b1b666479fc6f73ef27542f6f80fb1b922c9540feadc9ff8563890ff3041d3f7fc62e504e29 getsubopt.patch" diff --git a/community/v4l-utils/fix-compliance.patch b/community/v4l-utils/fix-compliance.patch new file mode 100644 index 0000000000..34b85eeb55 --- /dev/null +++ b/community/v4l-utils/fix-compliance.patch @@ -0,0 +1,77 @@ +--- a/lib/libv4l1/v4l1compat.c ++++ b/lib/libv4l1/v4l1compat.c +@@ -62,7 +62,7 @@ + return fd; + } + +-#ifdef linux ++#ifdef __GLIBC__ + LIBV4L_PUBLIC int open64(const char *file, int oflag, ...) + { + int fd; +@@ -94,7 +94,11 @@ + return v4l1_dup(fd); + } + ++#ifdef __GLIBC__ + LIBV4L_PUBLIC int ioctl(int fd, unsigned long int request, ...) ++#else ++LIBV4L_PUBLIC int ioctl(int fd, int request, ...) ++#endif + { + void *arg; + va_list ap; +@@ -117,7 +121,7 @@ + return v4l1_mmap(start, length, prot, flags, fd, offset); + } + +-#ifdef linux ++#ifdef __GLIBC__ + LIBV4L_PUBLIC void *mmap64(void *start, size_t length, int prot, int flags, int fd, + __off64_t offset) + { +--- a/lib/libv4l2/v4l2convert.c ++++ b/lib/libv4l2/v4l2convert.c +@@ -86,7 +86,7 @@ + return fd; + } + +-#ifdef linux ++#ifdef __GLIBC__ + LIBV4L_PUBLIC int open64(const char *file, int oflag, ...) + { + int fd; +@@ -121,7 +121,11 @@ + return v4l2_dup(fd); + } + ++#ifdef __GLIBC__ + LIBV4L_PUBLIC int ioctl(int fd, unsigned long int request, ...) ++#else ++LIBV4L_PUBLIC int ioctl(int fd, int request, ...) ++#endif + { + void *arg; + va_list ap; +@@ -144,7 +148,7 @@ + return v4l2_mmap(start, length, prot, flags, fd, offset); + } + +-#ifdef linux ++#ifdef __GLIBC__ + LIBV4L_PUBLIC void *mmap64(void *start, size_t length, int prot, int flags, int fd, + __off64_t offset) + { +--- a/lib/libv4lconvert/libv4lsyscall-priv.h ++++ b/lib/libv4lconvert/libv4lsyscall-priv.h +@@ -41,7 +41,9 @@ + #include + /* On 32 bits archs we always use mmap2, on 64 bits archs there is no mmap2 */ + #ifdef __NR_mmap2 ++#ifndef SYS_mmap2 + #define SYS_mmap2 __NR_mmap2 ++#endif + #define MMAP2_PAGE_SHIFT 12 + #else + #define SYS_mmap2 SYS_mmap + diff --git a/community/v4l-utils/getsubopt.patch b/community/v4l-utils/getsubopt.patch new file mode 100644 index 0000000000..c476e5ed7e --- /dev/null +++ b/community/v4l-utils/getsubopt.patch @@ -0,0 +1,36 @@ +POSIX says that behavior when subopts list is empty is undefined. +musl libs will set value to NULL which leads to crash. + +Simply avoid getsubopt, since we cannot rely on it. + +diff --git a/utils/v4l2-ctl/v4l2-ctl-common.cpp b/utils/v4l2-ctl/v4l2-ctl-common.cpp +index 3ea6cd3..291fb3e 100644 +--- a/utils/v4l2-ctl/v4l2-ctl-common.cpp ++++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp +@@ -692,16 +692,17 @@ static bool parse_subset(char *optarg) + + static bool parse_next_subopt(char **subs, char **value) + { +- static char *const subopts[] = { +- NULL +- }; +- int opt = getsubopt(subs, subopts, value); ++ char *p = *subs; ++ *value = *subs; + +- if (opt < 0 || *value) +- return false; +- fprintf(stderr, "No value given to suboption <%s>\n", +- subopts[opt]); +- return true; ++ while (*p && *p != ',') ++ p++; ++ ++ if (*p) ++ *p++ = '\0'; ++ ++ *subs = p; ++ return false; + } + + void common_cmd(int ch, char *optarg) diff --git a/community/v4l-utils/qv4l2.desktop b/community/v4l-utils/qv4l2.desktop new file mode 100644 index 0000000000..55e369c7c5 --- /dev/null +++ b/community/v4l-utils/qv4l2.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=QT V4L2 test Utility +Name[pt]=Utilitário de teste V4L2 +Comment=Allow testing Video4Linux devices +Comment[pt]=Permite testar dispositivos Video4Linux +Exec=qv4l2 +Icon=qv4l2 +Terminal=false +Type=Application +Categories=Application;AudioVideo; + diff --git a/community/v4l-utils/qv4l2.svg b/community/v4l-utils/qv4l2.svg new file mode 100644 index 0000000000..3d4f375cc2 --- /dev/null +++ b/community/v4l-utils/qv4l2.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + \ No newline at end of file -- cgit v1.2.3