commit:     1f191a3a5093f118e0af971d716a389034de473d
Author:     NHOrus <jy6x2b32pie9 <AT> yahoo <DOT> com>
AuthorDate: Tue Feb 18 17:56:35 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Feb 19 11:15:17 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1f191a3a

media-video/xvattr: Fix build

Corrects incompatible pointer types by casting GTK-style.
Also removes fallback definition of getopt, leaving only POSIX one,
because it is present both on glibc and musl systems

Closes: https://bugs.gentoo.org/945292
Closes: https://bugs.gentoo.org/919367
Signed-off-by: NHOrus <jy6x2b32pie9 <AT> yahoo.com>
Closes: https://github.com/gentoo/gentoo/pull/40639
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/xvattr-1.3-conflicting-types.patch       | 42 ++++++++++++++++++++++
 .../{xvattr-1.3-r3.ebuild => xvattr-1.3-r4.ebuild} |  3 +-
 2 files changed, 44 insertions(+), 1 deletion(-)

diff --git a/media-video/xvattr/files/xvattr-1.3-conflicting-types.patch 
b/media-video/xvattr/files/xvattr-1.3-conflicting-types.patch
new file mode 100644
index 000000000000..595c90fbd46b
--- /dev/null
+++ b/media-video/xvattr/files/xvattr-1.3-conflicting-types.patch
@@ -0,0 +1,42 @@
+Fix incompatible pointers, GTK style
+Also, remove non-POSIX getopt declaration that conflitcts
+with musl
+https://bugs.gentoo.org/919367
+https://bugs.gentoo.org/945292
+--- a/gxvattr.c
++++ b/gxvattr.c
+@@ -256,7 +256,7 @@
+         label = gtk_label_new (xvattr[k].name);
+         if (!strcmp(xvattr[k].name, "XV_COLORKEY")) {
+           manipulator = gtk_color_selection_new();
+-          set_color_widget(manipulator, cur_val);
++          set_color_widget(GTK_OBJECT(manipulator), cur_val);
+           property->controller = (GtkObject *) manipulator;
+           property->set_widget = set_color_widget;
+           if (xvattr[k].flags & XvSettable) {
+@@ -269,7 +269,7 @@
+                  xvattr[k].max_value == 1) {
+         // boolean value, use check button
+         manipulator = gtk_check_button_new();
+-        set_bool_widget(manipulator, cur_val);
++        set_bool_widget(GTK_OBJECT(manipulator), cur_val);
+           property->controller = (GtkObject *) manipulator;
+           property->set_widget = set_bool_widget;
+           if (xvattr[k].flags & XvSettable) {
+--- a/getopt.h
++++ b/getopt.h
+@@ -138,14 +138,7 @@
+    `getopt'.  */
+ 
+ #if (defined __STDC__ && __STDC__) || defined __cplusplus
+-# ifdef __GNU_LIBRARY__
+-/* Many other libraries have conflicting prototypes for getopt, with
+-   differences in the consts, in stdlib.h.  To avoid compilation
+-   errors, only prototype getopt for the GNU C library.  */
+ extern int getopt (int __argc, char *const *__argv, const char *__shortopts);
+-# else /* not __GNU_LIBRARY__ */
+-extern int getopt ();
+-# endif /* __GNU_LIBRARY__ */
+ 
+ # ifndef __need_getopt
+ extern int getopt_long (int __argc, char *const *__argv, const char 
*__shortopts,

diff --git a/media-video/xvattr/xvattr-1.3-r3.ebuild 
b/media-video/xvattr/xvattr-1.3-r4.ebuild
similarity index 89%
rename from media-video/xvattr/xvattr-1.3-r3.ebuild
rename to media-video/xvattr/xvattr-1.3-r4.ebuild
index 7a16d54cbe19..23dc55d055f7 100644
--- a/media-video/xvattr/xvattr-1.3-r3.ebuild
+++ b/media-video/xvattr/xvattr-1.3-r4.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -26,6 +26,7 @@ BDEPEND="virtual/pkgconfig"
 PATCHES=(
        "${FILESDIR}"/${P}-gtk.patch
        "${FILESDIR}"/${P}-pod-encoding.patch
+       "${FILESDIR}"/${P}-conflicting-types.patch
 )
 
 src_prepare() {

Reply via email to