commit:     1689da0dbd5ff186c849af42f236a9dc7c8e089c
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Mon Oct  6 08:57:26 2025 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Mon Oct  6 08:58:39 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1689da0d

media-video/guvcview: fix building on musl

Musl issues include:

- using definitions from <sys/cdefs.h>
- missing include for <limits.h>

Closes: https://bugs.gentoo.org/831634
Closes: https://bugs.gentoo.org/928031
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 .../guvcview/files/guvcview-2.2.1-musl.patch       | 102 +++++++++++++++++++++
 media-video/guvcview/guvcview-2.2.1.ebuild         |   1 +
 2 files changed, 103 insertions(+)

diff --git a/media-video/guvcview/files/guvcview-2.2.1-musl.patch 
b/media-video/guvcview/files/guvcview-2.2.1-musl.patch
new file mode 100644
index 000000000000..77e786afd30e
--- /dev/null
+++ b/media-video/guvcview/files/guvcview-2.2.1-musl.patch
@@ -0,0 +1,102 @@
+--- a/guvcview/core_io.c
++++ b/guvcview/core_io.c
+@@ -30,6 +30,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
++#include <limits.h>
+ // #include "gviewv4l2core.h"
+ // #include "../config.h"
+ 
+--- a/gview_audio/gviewaudio.h
++++ b/gview_audio/gviewaudio.h
+@@ -39,7 +39,9 @@
+ #include <sys/types.h>
+ 
+ /*make sure we support c++*/
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ /*Audio API*/
+ #define AUDIO_NONE (0)
+@@ -369,6 +371,8 @@ int audio_stop(audio_context_t *audio_ctx);
+  */
+ void audio_close(audio_context_t *audio_ctx);
+ 
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif
+--- a/gview_encoder/gviewencoder.h
++++ b/gview_encoder/gviewencoder.h
+@@ -38,7 +38,9 @@
+ #include <sys/types.h>
+ 
+ /*make sure we support c++*/
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ /*encoder modes*/
+ #define ENCODER_MODE_NONE   (0)
+@@ -717,6 +719,8 @@ int encoder_write_audio_data(encoder_context_t 
*encoder_ctx);
+  */
+ int encoder_disk_supervisor(int treshold, const char *path);
+ 
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif
+--- a/gview_render/gviewrender.h
++++ b/gview_render/gviewrender.h
+@@ -38,7 +38,9 @@
+ #include <sys/types.h>
+ 
+ /*make sure we support c++*/
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ #define RENDER_NONE     (0)
+ #define RENDER_SDL      (1)
+@@ -361,6 +363,8 @@ void render_clean_fx();
+  */
+ void render_close();
+ 
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif
+--- a/gview_v4l2core/gviewv4l2core.h
++++ b/gview_v4l2core/gviewv4l2core.h
+@@ -33,7 +33,9 @@
+ #include <sys/types.h>
+ 
+ /*make sure we support c++*/
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ /*
+  * LOGITECH Dynamic controls defs
+@@ -1416,6 +1418,8 @@ int v4l2core_save_image(v4l2_frame_buff_t *frame, const 
char *filename,
+  */
+ uint64_t v4l2core_time_get_timestamp();
+ 
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif

diff --git a/media-video/guvcview/guvcview-2.2.1.ebuild 
b/media-video/guvcview/guvcview-2.2.1.ebuild
index 38edf71a6787..4399e94626c3 100644
--- a/media-video/guvcview/guvcview-2.2.1.ebuild
+++ b/media-video/guvcview/guvcview-2.2.1.ebuild
@@ -51,6 +51,7 @@ PATCHES=(
        "${FILESDIR}"/${PN}-2.2.1-fix-desktop-file-for-cmake.patch
        "${FILESDIR}"/${PN}-2.2.1-set-metainfo-dir.patch
        "${FILESDIR}"/${PN}-2.2.1-ffmpeg-8.patch
+       "${FILESDIR}"/${PN}-2.2.1-musl.patch
 )
 
 src_configure() {

Reply via email to