commit:     97cbea7a03817fe51ea7947a7de9b72c19accbf9
Author:     Brahmajit Das <brahmajit.xyz <AT> gmail <DOT> com>
AuthorDate: Mon Apr 22 18:35:07 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Feb 10 09:17:03 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=97cbea7a

media-sound/aumix: Fix passing incompatible pointer type

And update EAPI 7 -> 8

Closes: https://bugs.gentoo.org/930028
Signed-off-by: Brahmajit Das <brahmajit.xyz <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/36361
Signed-off-by: Sam James <sam <AT> gentoo.org>

 media-sound/aumix/aumix-2.9.1-r1.ebuild            | 57 ++++++++++++++++++++++
 .../aumix/files/aumix-2.9.1-gcc14-build-fix.patch  | 53 ++++++++++++++++++++
 2 files changed, 110 insertions(+)

diff --git a/media-sound/aumix/aumix-2.9.1-r1.ebuild 
b/media-sound/aumix/aumix-2.9.1-r1.ebuild
new file mode 100644
index 000000000000..2162516551f1
--- /dev/null
+++ b/media-sound/aumix/aumix-2.9.1-r1.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools desktop
+
+DESCRIPTION="Aumix volume/mixer control program"
+HOMEPAGE="http://jpj.net/~trevor/aumix.html";
+SRC_URI="http://jpj.net/~trevor/aumix/releases/${P}.tar.bz2";
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+IUSE="gpm gtk nls"
+
+RDEPEND="sys-libs/ncurses:0=
+       gpm? ( sys-libs/gpm )
+       gtk? ( x11-libs/gtk+:2 )
+       nls? ( virtual/libintl )"
+DEPEND="${RDEPEND}"
+BDEPEND="
+       virtual/pkgconfig
+       nls? ( sys-devel/gettext )
+"
+
+PATCHES=(
+       "${FILESDIR}"/${P}-tinfo.patch #578722
+       "${FILESDIR}"/${P}-fno-common.patch
+       "${FILESDIR}"/${P}-gcc14-build-fix.patch
+)
+
+src_prepare() {
+       default
+       eautoreconf #578722
+}
+
+src_configure() {
+       local myeconfargs=(
+               $(use_enable nls)
+               $(usex gtk '' --without-gtk)
+               $(usex gpm '' --without-gpm)
+       )
+
+       econf "${myeconfargs[@]}"
+}
+
+src_install() {
+       default
+
+       newinitd "${FILESDIR}"/aumix.rc6 aumix
+
+       if use gtk; then
+               doicon data/aumix.xpm
+               make_desktop_entry aumix Aumix
+       fi
+}

diff --git a/media-sound/aumix/files/aumix-2.9.1-gcc14-build-fix.patch 
b/media-sound/aumix/files/aumix-2.9.1-gcc14-build-fix.patch
new file mode 100644
index 000000000000..4bae1bad9a82
--- /dev/null
+++ b/media-sound/aumix/files/aumix-2.9.1-gcc14-build-fix.patch
@@ -0,0 +1,53 @@
+https://bugs.gentoo.org/930028
+From: Brahmajit Das <[email protected]>
+Date: Mon, 22 Apr 2024 20:16:11 +0530
+Subject: [PATCH 1/1] Fix build with GCC 14
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+GCC 14 enables -Wincompatible-pointer-types and a few other compiler
+flags that results in build errors such as:
+gtk.c:465:28: error: passing argument 1 of ‘gtk_widget_destroy’ from 
incompatible pointer type [-Wincompatible-pointer-types]
+  465 |         gtk_widget_destroy(fs);
+      |                            ^~
+      |                            |
+      |                            GtkFileSelection * {aka struct 
_GtkFileSelection *}
+/usr/include/gtk-2.0/gtk/gtkwidget.h:837:65: note: expected ‘GtkWidget *’ {aka 
‘struct _GtkWidget *’} but argument is of type ‘GtkFileSelection *’ {aka 
‘struct _GtkFileSelection *’}
+  837 | void       gtk_widget_destroy             (GtkWidget           
*widget);
+      |                                            ~~~~~~~~~~~~~~~~~~~~~^~~~~~
+gtk.c: In function ‘FileOKSave’:
+gtk.c:473:28: error: passing argument 1 of ‘gtk_widget_destroy’ from 
incompatible pointer type [-Wincompatible-pointer-types]
+  473 |         gtk_widget_destroy(fs);
+      |                            ^~
+      |                            |
+      |                            GtkFileSelection * {aka struct 
_GtkFileSelection *}
+
+Using GTK_WIDGET to cast the GtkFileSelection handle to GtkWidget type
+helps with the error, as the funtion gtk_widget_destroy expects a
+GtkWidget type data.
+
+Signed-off-by: Brahmajit Das <[email protected]>
+--- a/src/gtk.c
++++ b/src/gtk.c
+@@ -462,7 +462,7 @@ void            FileOKLoad(GtkWidget * w, GtkFileSelection 
* fs)
+ /* Get the selected filename and copy it into the global save_filename. */
+ {
+       save_filename = 
g_strdup(gtk_file_selection_get_filename(GTK_FILE_SELECTION(fs)));
+-      gtk_widget_destroy(fs);
++      gtk_widget_destroy(GTK_WIDGET(fs));
+       ErrorExitWarn(LoadSettings(), 'w');
+ }
+ 
+@@ -470,7 +470,7 @@ void            FileOKSave(GtkWidget * w, GtkFileSelection 
* fs)
+ /* Get the selected filename and copy it into the global save_filename. */
+ {
+       save_filename = 
g_strdup(gtk_file_selection_get_filename(GTK_FILE_SELECTION(fs)));
+-      gtk_widget_destroy(fs);
++      gtk_widget_destroy(GTK_WIDGET(fs));
+       ErrorExitWarn(SaveSettings(), 'e');
+ }
+ 
+-- 
+2.44.0
+

Reply via email to