commit:     e89b47b59fd909723f4ca92c5515f595eb66119c
Author:     Matthew S. Turnbull <sparky <AT> bluefang-logic <DOT> com>
AuthorDate: Sun Jun  8 20:22:54 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jun 16 04:08:13 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e89b47b5

gnome-extra/cinnamon-desktop: fix potential crash on audio output change

Signed-off-by: Matthew S. Turnbull <sparky <AT> bluefang-logic.com>
Part-of: https://github.com/gentoo/gentoo/pull/42510
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../cinnamon-desktop-6.4.1-r2.ebuild               | 83 ++++++++++++++++++++++
 ...innamon-desktop-6.4.0-fix-gvc-mixer-crash.patch | 45 ++++++++++++
 2 files changed, 128 insertions(+)

diff --git a/gnome-extra/cinnamon-desktop/cinnamon-desktop-6.4.1-r2.ebuild 
b/gnome-extra/cinnamon-desktop/cinnamon-desktop-6.4.1-r2.ebuild
new file mode 100644
index 000000000000..4acc4f954d8c
--- /dev/null
+++ b/gnome-extra/cinnamon-desktop/cinnamon-desktop-6.4.1-r2.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..13} )
+
+inherit meson flag-o-matic gnome2-utils python-any-r1
+
+DESCRIPTION="A collection of libraries and utilites used by Cinnamon"
+HOMEPAGE="https://projects.linuxmint.com/cinnamon/ 
https://github.com/linuxmint/cinnamon-desktop";
+SRC_URI="https://github.com/linuxmint/cinnamon-desktop/archive/${PV}.tar.gz -> 
${P}.tar.gz"
+
+LICENSE="GPL-1 GPL-2+ LGPL-2+ LGPL-2.1+ MIT"
+SLOT="0/4" # subslot = libcinnamon-desktop soname version
+KEYWORDS="~amd64 ~arm64 ~loong ~ppc64 ~riscv ~x86"
+IUSE="wayland"
+
+RDEPEND="
+       app-text/iso-codes
+       >=dev-libs/glib-2.37.3:2[dbus]
+       >=dev-libs/gobject-introspection-0.10.2:=
+       >=gnome-base/gsettings-desktop-schemas-3.5.91
+       >=media-libs/libpulse-12.99.3[glib]
+       sys-apps/accountsservice
+       virtual/libudev:=
+       x11-libs/cairo[X]
+       >=x11-libs/gdk-pixbuf-2.22:2[introspection]
+       >=x11-libs/gtk+-3.3.16:3[introspection,wayland?,X]
+       x11-libs/libX11
+       >=x11-libs/libXext-1.1
+       x11-libs/libxkbfile
+       >=x11-libs/libXrandr-1.3
+       x11-misc/xkeyboard-config
+"
+DEPEND="
+       ${RDEPEND}
+       x11-base/xorg-proto
+"
+BDEPEND="
+       ${PYTHON_DEPS}
+       dev-util/gdbus-codegen
+       dev-util/glib-utils
+       sys-devel/gettext
+       virtual/pkgconfig
+"
+
+PATCHES=(
+       # Remove dead config option to prevent junk files from being installed
+       # https://github.com/linuxmint/cinnamon-desktop/pull/249
+       "${FILESDIR}/${PN}-6.4.0-remove-pnp_ids-option.patch"
+
+       # Fix GVC Mixer Crash
+       # https://github.com/linuxmint/cinnamon-desktop/pull/254
+       "${FILESDIR}/${PN}-6.4.0-fix-gvc-mixer-crash.patch"
+)
+
+src_prepare() {
+       default
+       python_fix_shebang install-scripts
+}
+
+src_configure() {
+       # defang automagic dependencies
+       # Preliminary wayland support only. Xorg code is unconditional.
+       use wayland || append-cflags -DGENTOO_GTK_HIDE_WAYLAND
+
+       local emesonargs=(
+               # 
https://github.com/linuxmint/cinnamon-desktop/commit/7eadfb1da9a42384396978b8ab46e0725d18e04f
+               # > Unless/until this fixes an actual identified issue for us 
or provides significant advantages
+               # > we're not using it in Cinnamon.
+               -Dsystemd=disabled
+       )
+       meson_src_configure
+}
+
+pkg_postinst() {
+       gnome2_schemas_update
+}
+
+pkg_postrm() {
+       gnome2_schemas_update
+}

diff --git 
a/gnome-extra/cinnamon-desktop/files/cinnamon-desktop-6.4.0-fix-gvc-mixer-crash.patch
 
b/gnome-extra/cinnamon-desktop/files/cinnamon-desktop-6.4.0-fix-gvc-mixer-crash.patch
new file mode 100644
index 000000000000..3a55f4e7c86d
--- /dev/null
+++ 
b/gnome-extra/cinnamon-desktop/files/cinnamon-desktop-6.4.0-fix-gvc-mixer-crash.patch
@@ -0,0 +1,45 @@
+From 1e68cdbe2d837594d8258a026500a0b84a57e792 Mon Sep 17 00:00:00 2001
+From: Spencer Lommel <[email protected]>
+Date: Wed, 16 Apr 2025 08:10:16 -0500
+Subject: [PATCH] Cvc null check profile (#254)
+
+* null checks on mixer profile
+
+* style fix to conform with the rest of the code
+---
+ libcvc/gvc-mixer-control.c   | 5 +++++
+ libcvc/gvc-mixer-ui-device.c | 5 +++++
+ 2 files changed, 10 insertions(+)
+
+diff --git a/libcvc/gvc-mixer-control.c b/libcvc/gvc-mixer-control.c
+index b385461..acd8d9b 100644
+--- a/libcvc/gvc-mixer-control.c
++++ b/libcvc/gvc-mixer-control.c
+@@ -549,6 +549,11 @@ gvc_mixer_control_change_profile_on_selected_device 
(GvcMixerControl  *control,
+         g_object_get (G_OBJECT (device), "card", &card, NULL);
+         current_profile = gvc_mixer_card_get_profile (card);
+ 
++        if (!current_profile) {
++          g_warning("gvc_mixer_card_get_profile() returned NULL for card %p", 
card);
++          return FALSE;
++        }
++        
+         if (current_profile)
+                 best_profile = gvc_mixer_ui_device_get_best_profile (device, 
profile, current_profile->profile);
+         else
+diff --git a/libcvc/gvc-mixer-ui-device.c b/libcvc/gvc-mixer-ui-device.c
+index a0567fc..a6b7882 100644
+--- a/libcvc/gvc-mixer-ui-device.c
++++ b/libcvc/gvc-mixer-ui-device.c
+@@ -557,6 +557,11 @@ gvc_mixer_ui_device_get_active_profile (GvcMixerUIDevice* 
device)
+         }
+ 
+         profile = gvc_mixer_card_get_profile (device->priv->card);
++        if (!profile) {
++                g_warning ("gvc_mixer_card_get_profile() returned NULL for 
card %p", device->priv->card);
++                return NULL;
++        }
++        
+         return gvc_mixer_ui_device_get_matching_profile (device, 
profile->profile);
+ }
+ 

Reply via email to