summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMart Raudsepp <leio@gentoo.org>2023-12-24 13:56:23 +0200
committerMart Raudsepp <leio@gentoo.org>2023-12-24 14:00:01 +0200
commit7b9626eea5fb19247b433695ca2efc840d1e400a (patch)
tree135d3ad0ab42b464e77e3394a3c0af9423c37ba5 /gnome-base/nautilus
parentdev-util/gtk-update-icon-cache: add 3.24.39 (diff)
downloadgentoo-7b9626eea5fb19247b433695ca2efc840d1e400a.tar.gz
gentoo-7b9626eea5fb19247b433695ca2efc840d1e400a.tar.bz2
gentoo-7b9626eea5fb19247b433695ca2efc840d1e400a.zip
gnome-base/nautilus: Fix crash opening audio/video properties
The crash doesn't happen on all systems (at least some amd64 don't), but that was by pure luck from compiler UB handling. Also include another changeset from gnome-45 stable branch while revbumping anyways. Signed-off-by: Mart Raudsepp <leio@gentoo.org>
Diffstat (limited to 'gnome-base/nautilus')
-rw-r--r--gnome-base/nautilus/files/45.2.1-better-icon-lookup-fallback.patch116
-rw-r--r--gnome-base/nautilus/files/45.2.1-fix-av-props-crash.patch38
-rw-r--r--gnome-base/nautilus/nautilus-45.2.1-r1.ebuild125
3 files changed, 279 insertions, 0 deletions
diff --git a/gnome-base/nautilus/files/45.2.1-better-icon-lookup-fallback.patch b/gnome-base/nautilus/files/45.2.1-better-icon-lookup-fallback.patch
new file mode 100644
index 000000000000..ba7f970d7f28
--- /dev/null
+++ b/gnome-base/nautilus/files/45.2.1-better-icon-lookup-fallback.patch
@@ -0,0 +1,116 @@
+From 95befc684c535e251278ccc68b06261c2620271d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ant=C3=B3nio=20Fernandes?= <antoniof@gnome.org>
+Date: Sun, 10 Dec 2023 17:01:18 +0000
+Subject: [PATCH 1/2] icon-info: Don't ask the theme for an icon it doesn't
+ have
+
+GtkIconTheme changed behavior from GTK3 to GTK4. Before, it would
+return NULL for a non-existent icon. Now it returns a non-scallable
+`image-missing` icon.
+
+But our icon info code still relies on NULL icon to set a fallback.
+
+The documented solution to get the old behavior back is to call
+gtk_icon_theme_has_gicon(). Let's just do that instead.
+
+Also use a more generic fallback icon that's been available in
+adwaita-icon-theme for a few versions before our GTK4 port.
+
+Closes https://gitlab.gnome.org/GNOME/nautilus/-/issues/2796
+
+
+(cherry picked from commit 7de816f8a2019adec468cf39073fcd5bb922512f)
+---
+ src/nautilus-file.c | 2 +-
+ src/nautilus-icon-info.c | 7 ++++---
+ src/nautilus-properties-window.c | 2 +-
+ 3 files changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/src/nautilus-file.c b/src/nautilus-file.c
+index 0492e2f87..b469288a3 100644
+--- a/src/nautilus-file.c
++++ b/src/nautilus-file.c
+@@ -4706,7 +4706,7 @@ get_default_file_icon (void)
+ static GIcon *fallback_icon = NULL;
+ if (fallback_icon == NULL)
+ {
+- fallback_icon = g_themed_icon_new ("text-x-generic");
++ fallback_icon = g_themed_icon_new ("application-x-generic");
+ }
+
+ return fallback_icon;
+diff --git a/src/nautilus-icon-info.c b/src/nautilus-icon-info.c
+index c6b1e9a92..a7f3243d6 100644
+--- a/src/nautilus-icon-info.c
++++ b/src/nautilus-icon-info.c
+@@ -395,13 +395,14 @@ nautilus_icon_info_lookup (GIcon *icon,
+ return g_object_ref (icon_info);
+ }
+
+- icon_paintable = gtk_icon_theme_lookup_by_gicon (gtk_icon_theme_get_for_display (gdk_display_get_default ()),
+- icon, size, scale, GTK_TEXT_DIR_NONE, 0);
+- if (icon_paintable == NULL)
++ GtkIconTheme *theme = gtk_icon_theme_get_for_display (gdk_display_get_default ());
++ if (!gtk_icon_theme_has_gicon (theme, icon))
+ {
+ return nautilus_icon_info_new_for_paintable (NULL, scale);
+ }
+
++ icon_paintable = gtk_icon_theme_lookup_by_gicon (theme, icon, size, scale, GTK_TEXT_DIR_NONE, 0);
++
+ if (G_IS_THEMED_ICON (icon))
+ {
+ ThemedIconKey lookup_key;
+diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c
+index 08bf91fcb..6a6dcc362 100644
+--- a/src/nautilus-properties-window.c
++++ b/src/nautilus-properties-window.c
+@@ -570,7 +570,7 @@ get_image_for_properties_window (NautilusPropertiesWindow *self,
+
+ if (!icon)
+ {
+- g_autoptr (GIcon) gicon = g_themed_icon_new ("text-x-generic");
++ g_autoptr (GIcon) gicon = g_themed_icon_new ("application-x-generic");
+
+ icon = nautilus_icon_info_lookup (gicon, NAUTILUS_GRID_ICON_SIZE_MEDIUM, icon_scale);
+ }
+--
+2.43.0
+
+
+From 038885de47293a3fd2a15410d7cf3e0d36406a0d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ant=C3=B3nio=20Fernandes?= <antoniof@gnome.org>
+Date: Wed, 13 Dec 2023 00:13:35 +0000
+Subject: [PATCH 2/2] icon-info: Fix build
+
+Previous commit relied on mixing declarations with code, which is not allowed with the build flags of this branch.
+
+(cherry picked from commit deed9bcab051529e64e3fc1870f299233b8c200e)
+---
+ src/nautilus-icon-info.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/nautilus-icon-info.c b/src/nautilus-icon-info.c
+index a7f3243d6..f18d574d6 100644
+--- a/src/nautilus-icon-info.c
++++ b/src/nautilus-icon-info.c
+@@ -333,6 +333,7 @@ nautilus_icon_info_lookup (GIcon *icon,
+ {
+ NautilusIconInfo *icon_info;
+ g_autoptr (GtkIconPaintable) icon_paintable = NULL;
++ GtkIconTheme *theme;
+
+ if (G_IS_LOADABLE_ICON (icon))
+ {
+@@ -395,7 +396,7 @@ nautilus_icon_info_lookup (GIcon *icon,
+ return g_object_ref (icon_info);
+ }
+
+- GtkIconTheme *theme = gtk_icon_theme_get_for_display (gdk_display_get_default ());
++ theme = gtk_icon_theme_get_for_display (gdk_display_get_default ());
+ if (!gtk_icon_theme_has_gicon (theme, icon))
+ {
+ return nautilus_icon_info_new_for_paintable (NULL, scale);
+--
+2.43.0
+
diff --git a/gnome-base/nautilus/files/45.2.1-fix-av-props-crash.patch b/gnome-base/nautilus/files/45.2.1-fix-av-props-crash.patch
new file mode 100644
index 000000000000..e1136fb196c9
--- /dev/null
+++ b/gnome-base/nautilus/files/45.2.1-fix-av-props-crash.patch
@@ -0,0 +1,38 @@
+From 6836526d6c95107f0bcdcf628ab2dfed394541a5 Mon Sep 17 00:00:00 2001
+From: Peter Eisenmann <p3732@getgoogleoff.me>
+Date: Sat, 9 Dec 2023 14:40:52 +0100
+Subject: [PATCH] properties-window: fix extension callback signature
+
+This was added in [1] with an incorrect signature.
+
+Relates to #3160
+
+[1] bc4dfddd80544092483fb058c946716ea4fc47f1
+
+
+(cherry picked from commit 8d51206503304ff62ca5eeba30ef3b29cdc50820)
+---
+ src/nautilus-properties-window.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c
+index 14c8f74213..08bf91fcb7 100644
+--- a/src/nautilus-properties-window.c
++++ b/src/nautilus-properties-window.c
+@@ -925,10 +925,10 @@ create_extension_group_row (NautilusPropertiesItem *item,
+ }
+
+ static void
+-navigate_extension_model_page (AdwPreferencesRow *row,
+- GParamSpec *params,
+- NautilusPropertiesWindow *self)
++navigate_extension_model_page (AdwPreferencesRow *row,
++ gpointer user_data)
+ {
++ NautilusPropertiesWindow *self = NAUTILUS_PROPERTIES_WINDOW (user_data);
+ GListModel *list_model = g_object_get_data (G_OBJECT (row), "nautilus-extension-properties-model");
+ AdwNavigationPage *page;
+
+--
+GitLab
+
diff --git a/gnome-base/nautilus/nautilus-45.2.1-r1.ebuild b/gnome-base/nautilus/nautilus-45.2.1-r1.ebuild
new file mode 100644
index 000000000000..a84dd38af2c3
--- /dev/null
+++ b/gnome-base/nautilus/nautilus-45.2.1-r1.ebuild
@@ -0,0 +1,125 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit gnome.org gnome2-utils meson readme.gentoo-r1 virtualx xdg
+
+DESCRIPTION="Default file manager for the GNOME desktop"
+HOMEPAGE="https://apps.gnome.org/Nautilus/"
+
+LICENSE="GPL-3+ LGPL-2.1+"
+SLOT="0"
+IUSE="+cloudproviders gnome +gstreamer gtk-doc +introspection +previewer selinux sendto"
+REQUIRED_USE="gtk-doc? ( introspection )"
+
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~x86"
+
+DEPEND="
+ >=dev-libs/glib-2.77.0:2
+ >=media-libs/gexiv2-0.14.2
+ >=x11-libs/gdk-pixbuf-2.30.0:2
+ gstreamer? ( media-libs/gstreamer:1.0
+ media-libs/gst-plugins-base:1.0 )
+ >=app-arch/gnome-autoar-0.4.4
+ >=gnome-base/gnome-desktop-43:4=
+ >=gnome-base/gsettings-desktop-schemas-42
+ >=gui-libs/gtk-4.11.2:4[introspection?]
+ >=gui-libs/libadwaita-1.4_alpha:1
+ >=dev-libs/libportal-0.5:=[gtk]
+ >=x11-libs/pango-1.28.3
+ selinux? ( >=sys-libs/libselinux-2.0 )
+ >=app-misc/tracker-3.0:3
+ >=dev-libs/libxml2-2.7.8:2
+ cloudproviders? ( >=net-libs/libcloudproviders-0.3.1 )
+ introspection? ( >=dev-libs/gobject-introspection-1.54:= )
+"
+RDEPEND="${DEPEND}
+ >=app-misc/tracker-miners-3.0:3=
+" # uses org.freedesktop.Tracker.Miner.Files gsettings schema from tracker-miners
+BDEPEND="
+ >=dev-util/gdbus-codegen-2.51.2
+ dev-util/glib-utils
+ gtk-doc? (
+ app-text/docbook-xml-dtd:4.1.2
+ dev-util/gi-docgen
+ )
+ >=sys-devel/gettext-0.19.8
+ virtual/pkgconfig
+ test? ( sys-apps/dbus )
+"
+PDEPEND="
+ gnome? ( x11-themes/adwaita-icon-theme )
+ previewer? ( >=gnome-extra/sushi-0.1.9 )
+ sendto? ( >=gnome-extra/nautilus-sendto-3.0.1 )
+ >=gnome-base/gvfs-1.14[gtk(+)]
+" # Need gvfs[gtk] for recent:/// support; always built (without USE=gtk) since gvfs-1.34
+
+PATCHES=(
+ "${FILESDIR}"/43.0-optional-gstreamer.patch # Allow controlling audio-video-properties build
+ "${FILESDIR}"/${PV}-fix-av-props-crash.patch # Fix crash opening audio/video properties, upstream #3160
+ "${FILESDIR}"/${PV}-better-icon-lookup-fallback.patch # Upstream #2796 from gnome-45 branch
+)
+
+src_prepare() {
+ default
+ xdg_environment_reset
+
+ # Disable -Werror
+ sed -e '/-Werror=/d' -i meson.build || die
+
+ if use previewer; then
+ DOC_CONTENTS="nautilus uses gnome-extra/sushi to preview media files.
+ To activate the previewer, select a file and press space; to
+ close the previewer, press space again."
+ fi
+
+ # Disable test-nautilus-search-engine-tracker; bug #831170
+ sed -e '/^tracker_tests = /{n;N;N;d}' -i test/automated/displayless/meson.build || die
+}
+
+src_configure() {
+ local emesonargs=(
+ $(meson_use gtk-doc docs)
+ -Dextensions=true # image file properties, sendto support; also required for -Dgstreamer=true
+ $(meson_use introspection)
+ -Dpackagekit=false
+ $(meson_use selinux)
+ $(meson_use cloudproviders)
+ -Dprofiling=false
+ -Dtests=$(usex test all none)
+
+ $(meson_use gstreamer) # gstreamer audio-video-properties extension
+ )
+ meson_src_configure
+}
+
+src_install() {
+ use previewer && readme.gentoo_create_doc
+ meson_src_install
+}
+
+src_test() {
+ # Avoid dconf that looks at XDG_DATA_DIRS, which can sandbox fail if flatpak is installed
+ gnome2_environment_reset
+ # TODO: Tests require tracker testutils (e.g. tracker-sandbox), which may
+ # need some sorting out with tracker use flag deps
+ # GIO_USE_VOLUME_MONITOR=unix due to https://gitlab.gnome.org/GNOME/gvfs/-/issues/629#note_1467280
+ GIO_USE_VOLUME_MONITOR=unix XDG_SESSION_TYPE=x11 virtx dbus-run-session meson test -C "${BUILD_DIR}" || die
+}
+
+pkg_postinst() {
+ xdg_pkg_postinst
+ gnome2_schemas_update
+
+ if use previewer; then
+ readme.gentoo_print_elog
+ else
+ elog "To preview media files, emerge nautilus with USE=previewer"
+ fi
+}
+
+pkg_postrm() {
+ xdg_pkg_postrm
+ gnome2_schemas_update
+}