diff options
author | Joonas Niilola <juippis@gentoo.org> | 2024-09-09 14:26:25 +0300 |
---|---|---|
committer | Joonas Niilola <juippis@gentoo.org> | 2024-09-09 14:28:34 +0300 |
commit | de952745c916c1b1b5bd95346c886ed42eba306f (patch) | |
tree | ec5b789d4b8bfeab4fdd5fb4060ee696490c25eb /www-client | |
parent | mail-client/thunderbird: add 115.15.0 (diff) | |
download | gentoo-de952745c916c1b1b5bd95346c886ed42eba306f.tar.gz gentoo-de952745c916c1b1b5bd95346c886ed42eba306f.tar.bz2 gentoo-de952745c916c1b1b5bd95346c886ed42eba306f.zip |
www-client/firefox: move installing gnome search provider files
- Introduce new "gnome-shell" use flag to install search provider files for
Gnome. It requires adding prefs and I'm not confident it's not going to
break when using other DEs/WMs. "gnome-shell" use flag is default-enabled
in Gnome profiles, so it should integrate neatly when using Gnome profile.
Closes: https://bugs.gentoo.org/939196
Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'www-client')
-rw-r--r-- | www-client/firefox/firefox-128.2.0.ebuild | 32 | ||||
-rw-r--r-- | www-client/firefox/firefox-130.0.ebuild | 32 | ||||
-rw-r--r-- | www-client/firefox/metadata.xml | 1 |
3 files changed, 47 insertions, 18 deletions
diff --git a/www-client/firefox/firefox-128.2.0.ebuild b/www-client/firefox/firefox-128.2.0.ebuild index a6327fea1b9c..1abb459187c9 100644 --- a/www-client/firefox/firefox-128.2.0.ebuild +++ b/www-client/firefox/firefox-128.2.0.ebuild @@ -67,7 +67,7 @@ IUSE+=" pulseaudio selinux sndio +system-av1 +system-harfbuzz +system-icu +syste IUSE+=" +system-libevent +system-libvpx system-png +system-webp +telemetry wayland wifi +X" # Firefox-only IUSE -IUSE+=" +gmp-autoupdate" +IUSE+=" +gmp-autoupdate gnome-shell" REQUIRED_USE="|| ( X wayland ) debug? ( !system-av1 ) @@ -1261,16 +1261,30 @@ src_install() { rm "${WORKDIR}/${PN}.desktop-template" || die - # Install search provider for Gnome - insinto /usr/share/gnome-shell/search-providers/ - doins browser/components/shell/search-provider-files/org.mozilla.firefox.search-provider.ini + if use gnome-shell ; then + # Install search provider for Gnome + insinto /usr/share/gnome-shell/search-providers/ + doins browser/components/shell/search-provider-files/org.mozilla.firefox.search-provider.ini - insinto /usr/share/dbus-1/services/ - doins browser/components/shell/search-provider-files/org.mozilla.firefox.SearchProvider.service + insinto /usr/share/dbus-1/services/ + doins browser/components/shell/search-provider-files/org.mozilla.firefox.SearchProvider.service - sed -e "s/firefox.desktop/${desktop_filename}/g" \ - -i "${ED}/usr/share/gnome-shell/search-providers/org.mozilla.firefox.search-provider.ini" || - die "Failed to sed search-provider file." + # Toggle between rapid and esr desktop file names + sed -e "s/firefox.desktop/${desktop_filename}/g" \ + -i "${ED}/usr/share/gnome-shell/search-providers/org.mozilla.firefox.search-provider.ini" || + die "Failed to sed search-provider file." + + # Make the dbus service aware of a previous session, bgo#939196 + sed -e \ + "s/Exec=\/usr\/bin\/firefox/Exec=\/usr\/$(get_libdir)\/firefox\/firefox --dbus-service \/usr\/bin\/firefox/g" \ + -i "${ED}/usr/share/dbus-1/services/org.mozilla.firefox.SearchProvider.service" || + die "Failed to sed org.mozilla.firefox.SearchProvider.service dbus file" + + # Update prefs to enable Gnome search provider + cat >>"${GENTOO_PREFS}" <<-EOF || die "failed to enable gnome-search-provider via prefs" + pref("browser.gnome-search-provider.enabled", true); + EOF + fi # Install wrapper script [[ -f "${ED}/usr/bin/${PN}" ]] && rm "${ED}/usr/bin/${PN}" diff --git a/www-client/firefox/firefox-130.0.ebuild b/www-client/firefox/firefox-130.0.ebuild index 52a69fea3f84..1931b3127270 100644 --- a/www-client/firefox/firefox-130.0.ebuild +++ b/www-client/firefox/firefox-130.0.ebuild @@ -68,7 +68,7 @@ IUSE+=" +system-jpeg +system-libevent +system-libvpx system-png +system-webp +te IUSE+=" wayland wifi +X" # Firefox-only IUSE -IUSE+=" +gmp-autoupdate" +IUSE+=" +gmp-autoupdate gnome-shell" REQUIRED_USE="|| ( X wayland ) debug? ( !system-av1 ) @@ -1272,16 +1272,30 @@ src_install() { rm "${WORKDIR}/${PN}.desktop-template" || die - # Install search provider for Gnome - insinto /usr/share/gnome-shell/search-providers/ - doins browser/components/shell/search-provider-files/org.mozilla.firefox.search-provider.ini + if use gnome-shell ; then + # Install search provider for Gnome + insinto /usr/share/gnome-shell/search-providers/ + doins browser/components/shell/search-provider-files/org.mozilla.firefox.search-provider.ini - insinto /usr/share/dbus-1/services/ - doins browser/components/shell/search-provider-files/org.mozilla.firefox.SearchProvider.service + insinto /usr/share/dbus-1/services/ + doins browser/components/shell/search-provider-files/org.mozilla.firefox.SearchProvider.service - sed -e "s/firefox.desktop/${desktop_filename}/g" \ - -i "${ED}/usr/share/gnome-shell/search-providers/org.mozilla.firefox.search-provider.ini" || - die "Failed to sed search-provider file." + # Toggle between rapid and esr desktop file names + sed -e "s/firefox.desktop/${desktop_filename}/g" \ + -i "${ED}/usr/share/gnome-shell/search-providers/org.mozilla.firefox.search-provider.ini" || + die "Failed to sed org.mozilla.firefox.search-provider.ini file." + + # Make the dbus service aware of a previous session, bgo#939196 + sed -e \ + "s/Exec=\/usr\/bin\/firefox/Exec=\/usr\/$(get_libdir)\/firefox\/firefox --dbus-service \/usr\/bin\/firefox/g" \ + -i "${ED}/usr/share/dbus-1/services/org.mozilla.firefox.SearchProvider.service" || + die "Failed to sed org.mozilla.firefox.SearchProvider.service dbus file" + + # Update prefs to enable Gnome search provider + cat >>"${GENTOO_PREFS}" <<-EOF || die "failed to enable gnome-search-provider via prefs" + pref("browser.gnome-search-provider.enabled", true); + EOF + fi # Install wrapper script [[ -f "${ED}/usr/bin/${PN}" ]] && rm "${ED}/usr/bin/${PN}" diff --git a/www-client/firefox/metadata.xml b/www-client/firefox/metadata.xml index b0a1758bd35a..2e477393e06d 100644 --- a/www-client/firefox/metadata.xml +++ b/www-client/firefox/metadata.xml @@ -11,6 +11,7 @@ <flag name="geckodriver">Enable WebDriver support</flag> <flag name="gmp-autoupdate">Allow Gecko Media Plugins (binary blobs) to be automatically downloaded and kept up-to-date in user profiles</flag> + <flag name="gnome-shell">Integrate with gnome-base/gnome-shell search</flag> <flag name="hwaccel">Force-enable hardware-accelerated rendering (Mozilla bug 594876)</flag> <flag name="jumbo-build">Enable unified build - combines source files to speed up build process, but requires more memory</flag> <flag name="libproxy">Enable libproxy support</flag> |