[hbbtv/youtubetv] Fixed hanup bug and segmentation fault on 3rd-party images.
[vuplus_openembedded] / recipes / enigma2 / enigma2-plugins.bb
1 DESCRIPTION = "Additional plugins for Enigma2"
2 MAINTAINER = "Felix Domke <tmbinc@elitedvb.net>"
3
4 PACKAGES_DYNAMIC = "enigma2-plugin-*"
5
6 # if you want experimental, use:
7 #SRCREV="87fd2f1120962f553ecb1a88bbee46ed821df975"
8 SRCREV="c8fc96e8e51e1ef71e1709f9dd6f733007f9463e"
9 SRCDATE="20110215"
10 BRANCH="master"
11 PV = "experimental-git${SRCDATE}"
12
13 PR = "r8"
14 SRC_URI="git://code.vuplus.com/git/dvbapp-plugin.git;protocol=git;branch=${BRANCH};tag=${SRCREV}"
15
16 EXTRA_OECONF = " \
17         BUILD_SYS=${BUILD_SYS} \
18         HOST_SYS=${HOST_SYS} \
19         STAGING_INCDIR=${STAGING_INCDIR} \
20         STAGING_LIBDIR=${STAGING_LIBDIR} \
21 "
22
23 SRC_URI_append_vuplus = " \
24            file://enigma2_plugins_mytube_tpm.patch;patch=1;pnum=1 \
25            file://enigma2_plugins_20121113.patch;patch=1;pnum=1 \
26            file://enigma2_plugins_webinterface_tpm.patch;patch=1;pnum=1 \
27            file://enigma2_plugins_ac3lipsync_dolby.patch;patch=1;pnum=1 \
28            file://enigma2_plugins_autoresolution_fix.patch;patch=1;pnum=1 \
29            file://enigma2_plugins_fancontrol2.patch;patch=1;pnum=1 \
30            file://dreamboxweb.png \
31            file://dreamboxwebtv.png \
32            file://favicon.ico"
33
34 FILES_${PN} += " /usr/share/enigma2 /usr/share/fonts "
35 FILES_${PN}-meta = "${datadir}/meta"
36 PACKAGES += "${PN}-meta"
37 PACKAGE_ARCH = "${MACHINE_ARCH}"
38
39 inherit autotools
40
41 S = "${WORKDIR}/git"
42
43 DEPENDS = "python-pyopenssl python-gdata streamripper python-mutagen python-daap"
44 DEPENDS += "enigma2"
45 DEPENDS += "enigma2-plugin-extensions-openwebif"
46
47 DEPENDS_vusolo2 += "enigma2-plugin-systemplugins-autoshutdown"
48
49 def modify_po():
50         import os
51         try:
52                 os.system("find ./ -name \"*.po\" > ./po_list")
53                 os.system("find ./ -name \"*.pot\" >> ./po_list")
54                 po_list = []
55                 po_list = open('po_list','r+').readlines()
56                 for x in po_list:
57                         changeword1(x)
58                 changeword1('enigma2-plugins/networkwizard/src/networkwizard.xml ')
59                 changeword2('enigma2-plugins/webinterface/src/web-data/tpl/default/index.html ')
60                 os.system('rm po_list')
61         except:
62                 print 'word patch error '
63                 return
64
65 def changeword1(file):
66         fn = file[:-1]
67         fnn = file[:-1]+'_n'
68         cmd = "sed s/Dreambox/STB/g "+fn+" > "+fnn
69         os.system(cmd)
70         cmd1 = "mv "+fnn+" "+fn
71         os.system(cmd1)
72
73 def changeword2(file):
74         fn = file[:-1]
75         fnn = file[:-1]+'_n'
76         cmd = "sed s/Dreambox/Vu+/g "+fn+" > "+fnn
77         os.system(cmd)
78         cmd1 = "mv "+fnn+" "+fn
79         os.system(cmd1)
80
81 do_unpack_append(){
82         modify_po()
83 }
84
85
86 do_install_append_vuplus() {
87         install -m 0644 ${WORKDIR}/dreamboxweb.png ${D}/usr/lib/enigma2/python/Plugins/Extensions/WebInterface/web-data/img/
88         install -m 0644 ${WORKDIR}/dreamboxwebtv.png ${D}/usr/lib/enigma2/python/Plugins/Extensions/WebInterface/web-data/tpl/default/streaminterface/img
89         install -m 0644 ${WORKDIR}/favicon.ico ${D}/usr/lib/enigma2/python/Plugins/Extensions/WebInterface/web-data/img/
90 }
91
92 python populate_packages_prepend () {
93         enigma2_plugindir = bb.data.expand('${libdir}/enigma2/python/Plugins', d)
94
95         do_split_packages(d, enigma2_plugindir, '(.*?/.*?)/.*', 'enigma2-plugin-%s', 'Enigma2 Plugin: %s', recursive=True, match_path=True, prepend=True)
96
97         def getControlLines(mydir, d, package):
98                 import os
99                 try:
100                         #ac3lipsync is renamed since 20091121 to audiosync.. but rename in cvs is not possible without lost of revision history..
101                         #so the foldername is still ac3lipsync
102                         if package == 'audiosync':
103                                 package = 'ac3lipsync'
104                         src = open(mydir + package + "/CONTROL/control").read()
105                 except IOError:
106                         return
107                 for line in src.split("\n"):
108                         if line.startswith('Package: '):
109                                 full_package = line[9:]
110                         if line.startswith('Depends: '):
111                                 bb.data.setVar('RDEPENDS_' + full_package, ' '.join(line[9:].split(', ')), d)
112                         if line.startswith('Description: '):
113                                 bb.data.setVar('DESCRIPTION_' + full_package, line[13:], d)
114                         if line.startswith('Replaces: '):
115                                 bb.data.setVar('RREPLACES_' + full_package, ' '.join(line[10:].split(', ')), d)
116                         if line.startswith('Conflicts: '):
117                                 bb.data.setVar('RCONFLICTS_' + full_package, ' '.join(line[11:].split(', ')), d)
118                         if line.startswith('Maintainer: '):
119                                 bb.data.setVar('MAINTAINER_' + full_package, line[12:], d)
120
121         mydir = bb.data.getVar('D', d, 1) + "/../git/"
122         for package in bb.data.getVar('PACKAGES', d, 1).split():
123                 getControlLines(mydir, d, package.split('-')[-1])
124 }