1 |
commit: 07dd2bd52d9a752cfad41d95efc2386c253371fa |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Mar 30 12:17:39 2020 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Mar 30 12:18:40 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=07dd2bd5 |
7 |
|
8 |
www-client/firefox: use wrapper |
9 |
|
10 |
Backport of commit de3255e329bf23cd3e8247e475e75b374e53aec9. |
11 |
|
12 |
Package-Manager: Portage-2.3.96, Repoman-2.3.22 |
13 |
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org> |
14 |
|
15 |
www-client/firefox/firefox-68.6.0-r2.ebuild | 62 +++++++++++++++++++++++++---- |
16 |
1 file changed, 55 insertions(+), 7 deletions(-) |
17 |
|
18 |
diff --git a/www-client/firefox/firefox-68.6.0-r2.ebuild b/www-client/firefox/firefox-68.6.0-r2.ebuild |
19 |
index 8aedb7bf41c..a10f2faf8a7 100644 |
20 |
--- a/www-client/firefox/firefox-68.6.0-r2.ebuild |
21 |
+++ b/www-client/firefox/firefox-68.6.0-r2.ebuild |
22 |
@@ -738,7 +738,6 @@ PROFILE_EOF |
23 |
done |
24 |
# Install a 48x48 icon into /usr/share/pixmaps for legacy DEs |
25 |
newicon "${icon_path}/default48.png" "${icon}.png" |
26 |
- newmenu "${FILESDIR}/icon/${PN}-r1.desktop" "${PN}.desktop" |
27 |
|
28 |
# Add StartupNotify=true bug 237317 |
29 |
local startup_notify="false" |
30 |
@@ -746,12 +745,61 @@ PROFILE_EOF |
31 |
startup_notify="true" |
32 |
fi |
33 |
|
34 |
- sed -i \ |
35 |
- -e "s:@NAME@:${name}:" \ |
36 |
- -e "s:@EXEC@:firefox:" \ |
37 |
- -e "s:@ICON@:${icon}:" \ |
38 |
- -e "s:@STARTUP_NOTIFY@:${startup_notify}:" \ |
39 |
- "${ED%/}/usr/share/applications/${PN}.desktop" || die |
40 |
+ local display_protocols="auto X11" use_wayland="false" |
41 |
+ if use wayland ; then |
42 |
+ display_protocols+=" Wayland" |
43 |
+ use_wayland="true" |
44 |
+ fi |
45 |
+ |
46 |
+ local app_name desktop_filename display_protocol exec_command |
47 |
+ for display_protocol in ${display_protocols} ; do |
48 |
+ app_name="${name} on ${display_protocol}" |
49 |
+ desktop_filename="${PN}-${display_protocol,,}.desktop" |
50 |
+ |
51 |
+ case ${display_protocol} in |
52 |
+ Wayland) |
53 |
+ exec_command='firefox-wayland --name firefox-wayland' |
54 |
+ newbin "${FILESDIR}"/firefox-wayland.sh firefox-wayland |
55 |
+ ;; |
56 |
+ X11) |
57 |
+ exec_command='firefox-x11 --name firefox-x11' |
58 |
+ if use wayland ; then |
59 |
+ # Only needed when there's actually a choice |
60 |
+ newbin "${FILESDIR}"/firefox-x11.sh firefox-x11 |
61 |
+ fi |
62 |
+ ;; |
63 |
+ *) |
64 |
+ app_name="${name}" |
65 |
+ desktop_filename="${PN}.desktop" |
66 |
+ exec_command='firefox' |
67 |
+ ;; |
68 |
+ esac |
69 |
+ |
70 |
+ newmenu "${FILESDIR}/icon/${PN}-r1.desktop" "${desktop_filename}" |
71 |
+ sed -i \ |
72 |
+ -e "s:@NAME@:${app_name}:" \ |
73 |
+ -e "s:@EXEC@:${exec_command}:" \ |
74 |
+ -e "s:@ICON@:${icon}:" \ |
75 |
+ -e "s:@STARTUP_NOTIFY@:${startup_notify}:" \ |
76 |
+ "${ED%/}/usr/share/applications/${desktop_filename}" || die |
77 |
+ done |
78 |
+ |
79 |
+ rm "${ED%/}"/usr/bin/firefox || die |
80 |
+ newbin "${FILESDIR}"/firefox.sh firefox |
81 |
+ |
82 |
+ local wrapper |
83 |
+ for wrapper in \ |
84 |
+ "${ED%/}"/usr/bin/firefox \ |
85 |
+ "${ED%/}"/usr/bin/firefox-x11 \ |
86 |
+ "${ED%/}"/usr/bin/firefox-wayland \ |
87 |
+ ; do |
88 |
+ [[ ! -f "${wrapper}" ]] && continue |
89 |
+ |
90 |
+ sed -i \ |
91 |
+ -e "s:@PREFIX@:${EPREFIX%/}/usr:" \ |
92 |
+ -e "s:@DEFAULT_WAYLAND@:${use_wayland}:" \ |
93 |
+ "${wrapper}" || die |
94 |
+ done |
95 |
|
96 |
# Don't install llvm-symbolizer from sys-devel/llvm package |
97 |
[[ -f "${ED%/}${MOZILLA_FIVE_HOME}/llvm-symbolizer" ]] && \ |