enigma2: fixed crash when a skin with HasSubtitles is used
[opendreambox.git] / meta-opendreambox / recipes-dreambox / enigma2 / enigma2-skins_4.2.0.bb
1 SUMMARY = "Skins for Enigma2"
2 LICENSE = "CLOSED"
3 SRCREV = "${@opendreambox_srcrev('0884ec3e4a3fc216c8a827ff776594a0c3d1c58d', d)}"
4
5 inherit allarch autotools opendreambox-github
6
7 PACKAGES_DYNAMIC = "enigma2-skin-*"
8 PACKAGES += "${PN}-meta"
9
10 FILES_${PN} += " /usr/share/enigma2 /usr/share/fonts "
11 FILES_${PN}-meta = "${datadir}/meta"
12
13 python populate_packages_prepend() {
14     output_pattern = 'enigma2-skin-%s'
15     enigma2_skindir = os.path.join(d.getVar('datadir', True), 'enigma2')
16     do_split_packages(d, enigma2_skindir, '(.*?)/.*', output_pattern, 'Enigma2 Skin: %s', recursive=True, extra_depends='', prepend=True, match_path=True)
17
18     def parseControlFile(pkg, skindir):
19         filename = os.path.join(skindir, 'CONTROL/control')
20         if os.path.exists(filename):
21             src = open(filename).read()
22             for line in src.splitlines():
23                 name, value = line.strip().split(': ', 1)
24                 if name == 'Description':
25                     d.setVar('DESCRIPTION_%s' % pkg, value)
26                 elif name == 'Depends':
27                     d.setVar('RDEPENDS_%s' % pkg, ' '.join(value.split(', ')))
28                 elif name == 'Replaces':
29                     d.setVar('RREPLACES_%s' + pkg, ' '.join(value.split(', ')))
30                 elif name == 'Conflicts':
31                     d.setVar('RCONFLICTS_%s' + pkg, ' '.join(value.split(', ')))
32
33     skinsdir = os.path.join(d.getVar('S', True), 'skins')
34     packages = d.getVar('PACKAGES', True).split()
35     for subdir in os.walk(skinsdir).next()[1]:
36         pkg = output_pattern % legitimize_package_name(subdir)
37         if pkg in packages:
38             parseControlFile(pkg, os.path.join(skinsdir, subdir))
39 }