-
Notifications
You must be signed in to change notification settings - Fork 191
/
firefox-l10n.inc
49 lines (36 loc) · 1.32 KB
/
firefox-l10n.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Copyright (C) 2009-2014, O.S. Systems Software Ltda. All Rights Reserved
# Released under the MIT license (see packages/COPYING)
DEPENDS = "mozilla-devscripts-native unzip-native zip-native"
RDEPENDS_${PN} = "firefox"
LICENSE = "MPLv2"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad"
LANGUAGE = "${@get_language_name('${PN}')}"
PR = "r3"
# Mangle place where to store the file
DL_DIR_append = "/${PN}-${PV}"
SRC_URI = "https://archive.mozilla.org/pub/firefox/releases/${PV}/linux-i686/xpi/${LANGUAGE}.xpi"
S = "${WORKDIR}"
inherit allarch
def get_language_name(package):
lang = package.replace('firefox-l10n-', '')
if lang.find('-') != -1:
lang = lang.split('-')
lang[1] = lang[1].upper()
lang = '-'.join(lang)
return lang
do_configure() {
xpi-unpack ${LANGUAGE}.xpi ${LANGUAGE}
}
python do_install() {
manifest = d.getVar("LANGUAGE") + "/manifest.json"
import json
with open(manifest) as f:
data = json.load(f)
d.setVar("EXTENSION", data["applications"]["gecko"]["id"])
bb.build.exec_func("do_install_xpi_pack", d)
}
do_install_xpi_pack() {
xpi-pack ${LANGUAGE} ${EXTENSION}.xpi
install -D -m 0644 ${EXTENSION}.xpi ${D}${libdir}/firefox/browser/extensions/${EXTENSION}.xpi
}
FILES_${PN} += "${libdir}/firefox"