1 |
commit: 52716463ca346792b17cb994b9cf77639def040d |
2 |
Author: Ian Stakenvicius <axs <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Sep 7 17:11:43 2018 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Sep 7 17:15:31 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=52716463 |
7 |
|
8 |
www-client/firefox: install language packs as XPI file |
9 |
|
10 |
Unpacked extensions are no longer supported. [Link 1] |
11 |
|
12 |
Link 1: https://blog.mozilla.org/addons/2018/02/22/removing-support-unpacked-extensions/ |
13 |
Closes: https://bugs.gentoo.org/665352 |
14 |
Package-Manager: Portage-2.3.49, Repoman-2.3.10 |
15 |
|
16 |
eclass/mozextension.eclass | 30 ++++++++++++++++++++++++++++++ |
17 |
eclass/mozlinguas-v2.eclass | 14 ++++++++++++-- |
18 |
www-client/firefox/firefox-62.0-r1.ebuild | 2 +- |
19 |
3 files changed, 43 insertions(+), 3 deletions(-) |
20 |
|
21 |
diff --git a/eclass/mozextension.eclass b/eclass/mozextension.eclass |
22 |
index 425da7e85bf..68f401ee866 100644 |
23 |
--- a/eclass/mozextension.eclass |
24 |
+++ b/eclass/mozextension.eclass |
25 |
@@ -91,5 +91,35 @@ xpi_install() { |
26 |
doins -r "${x}"/* || die "failed to copy extension" |
27 |
} |
28 |
|
29 |
+xpi_copy() { |
30 |
+ local emid |
31 |
+ |
32 |
+ # You must tell xpi_install which xpi to use |
33 |
+ [[ ${#} -ne 1 ]] && die "$FUNCNAME takes exactly one argument, please specify an xpi to unpack" |
34 |
+ |
35 |
+ x="${1}" |
36 |
+ #cd ${x} |
37 |
+ # determine id for extension |
38 |
+ if [[ -f "${x}"/install.rdf ]]; then |
39 |
+ emid="$(sed -n -e '/install-manifest/,$ { /em:id/!d; s/.*[\">]\([^\"<>]*\)[\"<].*/\1/; p; q }' "${x}"/install.rdf)" \ |
40 |
+ || die "failed to determine extension id from install.rdf" |
41 |
+ elif [[ -f "${x}"/manifest.json ]]; then |
42 |
+ emid="$( sed -n 's/.*"id": "\([^"]*\)",.*/\1/p' "${x}"/manifest.json )" \ |
43 |
+ || die "failed to determine extension id from manifest.json" |
44 |
+ else |
45 |
+ die "failed to determine extension id" |
46 |
+ fi |
47 |
+ |
48 |
+ if [[ -n ${MOZEXTENSION_TARGET} ]]; then |
49 |
+ insinto "${MOZILLA_FIVE_HOME}"/${MOZEXTENSION_TARGET%/} |
50 |
+ elif $(mozversion_extension_location) ; then |
51 |
+ insinto "${MOZILLA_FIVE_HOME}"/browser/extensions |
52 |
+ else |
53 |
+ insinto "${MOZILLA_FIVE_HOME}"/extensions |
54 |
+ fi |
55 |
+ |
56 |
+ newins "${DISTDIR%/}"/${x##*/}.xpi ${emid}.xpi |
57 |
+} |
58 |
+ |
59 |
_MOZEXTENSION=1 |
60 |
fi |
61 |
|
62 |
diff --git a/eclass/mozlinguas-v2.eclass b/eclass/mozlinguas-v2.eclass |
63 |
index 77f1d0a439c..73576e967fa 100644 |
64 |
--- a/eclass/mozlinguas-v2.eclass |
65 |
+++ b/eclass/mozlinguas-v2.eclass |
66 |
@@ -124,13 +124,18 @@ esac |
67 |
# shouldn't (ie it is an alpha or beta package) |
68 |
: ${MOZ_FORCE_UPSTREAM_L10N:=""} |
69 |
|
70 |
- |
71 |
# @ECLASS-VARIABLE: MOZ_TOO_REGIONALIZED_FOR_L10N |
72 |
# @INTERNAL |
73 |
# @DESCRIPTION: |
74 |
# Upstream identifiers that should not contain region subtags in L10N |
75 |
MOZ_TOO_REGIONALIZED_FOR_L10N=( fy-NL ga-IE gu-IN hi-IN hy-AM nb-NO nn-NO pa-IN sv-SE ) |
76 |
|
77 |
+# @ECLASS-VARIABLE: MOZ_INSTALL_L10N_XPIFILE |
78 |
+# @DESCRIPTION: |
79 |
+# Install langpacks as .xpi file instead of unpacked directory. |
80 |
+# Leave unset to install unpacked |
81 |
+: ${MOZ_INSTALL_L10N_XPIFILE:=""} |
82 |
+ |
83 |
# Add l10n_* to IUSE according to available language packs |
84 |
# No language packs for alphas and betas |
85 |
if ! [[ -n ${MOZ_GENERATE_LANGPACKS} ]] ; then |
86 |
@@ -365,8 +370,13 @@ mozlinguas_src_install() { |
87 |
done |
88 |
popd > /dev/null || die |
89 |
fi |
90 |
+ |
91 |
for x in "${mozlinguas[@]}"; do |
92 |
- xpi_install "${WORKDIR}/${MOZ_P}-${x}${MOZ_LANGPACK_UNOFFICIAL:+.unofficial}" |
93 |
+ if [[ -n ${MOZ_INSTALL_L10N_XPIFILE} ]]; then |
94 |
+ xpi_copy "${WORKDIR}/${MOZ_P}-${x}${MOZ_LANGPACK_UNOFFICIAL:+.unofficial}" |
95 |
+ else |
96 |
+ xpi_install "${WORKDIR}/${MOZ_P}-${x}${MOZ_LANGPACK_UNOFFICIAL:+.unofficial}" |
97 |
+ fi |
98 |
done |
99 |
} |
100 |
|
101 |
|
102 |
diff --git a/www-client/firefox/firefox-62.0-r1.ebuild b/www-client/firefox/firefox-62.0-r1.ebuild |
103 |
index bebe61b439c..6f2ad021ba7 100644 |
104 |
--- a/www-client/firefox/firefox-62.0-r1.ebuild |
105 |
+++ b/www-client/firefox/firefox-62.0-r1.ebuild |
106 |
@@ -439,7 +439,7 @@ src_install() { |
107 |
DESTDIR="${D}" ./mach install |
108 |
|
109 |
# Install language packs |
110 |
- mozlinguas_src_install |
111 |
+ MOZ_INSTALL_L10N_XPIFILE="1" mozlinguas_src_install |
112 |
|
113 |
local size sizes icon_path icon name |
114 |
if use bindist; then |