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@gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/36361
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Brahmajit Das
2024-04-23 00:05:07 +05:30
committed by Sam James
parent 6301f2d688
commit 97cbea7a03
2 changed files with 110 additions and 0 deletions

View File

@@ -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
}

View File

@@ -0,0 +1,53 @@
https://bugs.gentoo.org/930028
From: Brahmajit Das <brahmajit.xyz@gmail.com>
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 <brahmajit.xyz@gmail.com>
--- 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