update dm7080 hardware drivers (frontend / demux was broken in 20170409)
[opendreambox.git] / meta-opendreambox / recipes-dreambox / enigma2 / enigma2-plugins.inc
1 SUMMARY = "Additional plugins for Enigma2"
2 LICENSE = "Proprietary"
3 LIC_FILES_CHKSUM = "file://COPYING;md5=8e37f34d0e40d32ea2bc90ee812c9131"
4 DEPENDS = "enigma2 gstreamer1.0 libtirpc nfs-utils openssl"
5
6 SRC_URI += "file://print.mak"
7
8 inherit autotools-brokensep pkgconfig pythonnative
9
10 export BUILD_SYS
11 export HOST_SYS
12 export STAGING_INCDIR
13 export STAGING_LIBDIR
14
15 do_install_append() {
16         # create lists of files installed outside of "${libdir}/enigma2/python/Plugins" or "${datadir}/meta"
17         rm -rf ${INSTALL_ROOTDIR}
18         install -d ${INSTALL_ROOTDIR}
19         SUBDIRS=`make -f Makefile -f ${WORKDIR}/print.mak print-SUBDIRS`
20         for SUBDIR in $SUBDIRS; do
21                 oe_runmake -C $SUBDIR "DESTDIR=${INSTALL_DESTDIR}" install
22                 CATEGORY=`ls -1 ${INSTALL_PLUGINSDIR} | head -n1 | tr '[:upper:]' '[:lower:]'`
23                 NAME=`echo $SUBDIR | tr '[:upper:]' '[:lower:]'`
24                 PKG="enigma2-plugin-$CATEGORY-$NAME"
25                 rm -rf ${INSTALL_METADIR} ${INSTALL_PODIR} ${INSTALL_PLUGINSDIR}
26                 find ${INSTALL_DESTDIR} -type f -name "*.la" -delete
27                 find ${INSTALL_DESTDIR} -type f -fprintf ${INSTALL_ROOTDIR}/$PKG '/%P\n'
28                 [ -s ${INSTALL_ROOTDIR}/$PKG ] || rm ${INSTALL_ROOTDIR}/$PKG
29                 rm -rf ${INSTALL_DESTDIR}
30         done
31
32         # delete unwanted files
33         find ${D} -type f -name "*.la" -delete
34 }
35
36 PACKAGES_DYNAMIC = "^enigma2-plugin-(extensions|skincomponents|systemplugins)-.*"
37 PACKAGES += "${PN}-meta ${PN}-po"
38
39 FILES_${PN} = ""
40 FILES_${PN}-meta = "${datadir}/meta"
41 FILES_${PN}-po = "${datadir}/enigma2/po"
42
43 python enigma2_plugins_split_packages() {
44     enigma2_plugindir = bb.data.expand('${libdir}/enigma2/python/Plugins', d)
45     do_split_packages(d, enigma2_plugindir, '^(\w+/\w+)', 'enigma2-plugin-%s', '%s', recursive=True, extra_depends='enigma2', match_path=True)
46
47     def parseControlFile(package, dir):
48         filename = os.path.join(dir, 'CONTROL/control')
49         if os.path.exists(filename):
50             with open(filename) as f:
51                 for line in f.read().splitlines():
52                     try:
53                         name, value = line.strip().split(': ', 1)
54                         if name == 'Description':
55                             d.setVar('DESCRIPTION_%s' % package, value)
56                         elif name in ('Breaks', 'Conflicts', 'Depends', 'Provides', 'Recommends', 'Replaces', 'Suggests'):
57                             d.appendVar('R%s_%s' % (name.upper(), package), ' ' + ' '.join(value.split(', ')))
58                     except:
59                         bb.fatal("Error parsing control file for package %s" % package)
60
61     def parseFileList(package, dir):
62         filename = os.path.join(dir, package)
63         if os.path.exists(filename):
64             varname = 'FILES_%s' % package
65             files = (d.getVar(varname, True) or "").split()
66             with open(filename) as f:
67                 for line in f.read().splitlines():
68                     if not line in files:
69                         files.append(line)
70             d.setVar(varname, ' '.join(files))
71
72     tempdir = d.getVar('INSTALL_ROOTDIR', True)
73     srcdir = d.getVar('S', True)
74     packages = d.getVar('PACKAGES', True).split()
75     for package in packages:
76         if package.startswith('enigma2-plugin-'):
77             subdir = package.split('-')[-1]
78             parseFileList(package, tempdir)
79             parseControlFile(package, os.path.join(srcdir, subdir))
80 }
81
82 PACKAGESPLITFUNCS_prepend = "enigma2_plugins_split_packages "
83
84 INSTALL_ROOTDIR = "${WORKDIR}/${PN}-packaging-tempdir"
85 INSTALL_DESTDIR = "${INSTALL_ROOTDIR}/destdir"
86 INSTALL_METADIR = "${INSTALL_DESTDIR}${datadir}/meta"
87 INSTALL_PODIR = "${INSTALL_DESTDIR}${datadir}/enigma2/po"
88 INSTALL_PLUGINSDIR = "${INSTALL_DESTDIR}${libdir}/enigma2/python/Plugins"
89
90 # This list of packages is compiled from all 'Depends' fields in all control
91 # files found in the enigma2-plugins repository. If a dependency gets added
92 # there, add it here, too. This allows to keep build dependencies minimal
93 # while making sure that all runtime dependencies are available.
94 # As ${PN} doesn't contain any files and ALLOW_EMPTY isn't set, this list
95 # actually has no impact on any generated packages.
96 RDEPENDS_${PN} = " \
97         aio-grab \
98         arp-scan \
99         avahi-daemon \
100         cdrkit \
101         cdtextinfo \
102         dbttcd \
103         dvdbackup \
104         enigma2-streamproxy \
105         gstreamer1.0-plugins-bad-faad \
106         gstreamer1.0-plugins-bad-fragmented \
107         gstreamer1.0-plugins-good-flv \
108         gstreamer1.0-plugins-good-icydemux \
109         gstreamer1.0-plugins-good-spectrum \
110         hdparm \
111         parted \
112         python-codecs \
113         python-compression \
114         python-crypt \
115         python-difflib \
116         python-email \
117         python-flickrapi \
118         python-gdata \
119         python-google-api-client \
120         python-html \
121         python-io \
122         python-json \
123         python-lang \
124         python-misc \
125         python-mutagen \
126         python-netclient \
127         python-pycrypto \
128         python-pyopenssl \
129         python-pysmb \
130         python-re \
131         python-shell \
132         python-simplejson \
133         python-sqlite3 \
134         python-subprocess \
135         python-textutils \
136         python-threading \
137         python-transmissionrpc \
138         python-twisted-core \
139         python-twisted-mail \
140         python-twisted-names \
141         python-twisted-protocols \
142         python-twisted-web \
143         python-xml \
144         python-xmlrpc \
145         python-youtube-dl \
146         python-zlib \
147         satip-client \
148         shellinabox \
149         smartmontools \
150         streamripper \
151 "