blob: c24493e1e8a1186461c20d945a8b1deb2b5bd6e7 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001PACKAGESPLITFUNCS_prepend = " split_gstreamer10_packages "
2PACKAGESPLITFUNCS_append = " set_metapkg_rdepends "
3
4python split_gstreamer10_packages () {
5 gst_libdir = d.expand('${libdir}/gstreamer-${LIBV}')
6 postinst = d.getVar('plugin_postinst', True)
7 glibdir = d.getVar('libdir', True)
8
9 do_split_packages(d, glibdir, '^lib(.*)\.so\.*', 'lib%s', 'gstreamer %s library', extra_depends='', allow_links=True)
10 do_split_packages(d, gst_libdir, 'libgst(.*)\.so$', d.expand('${PN}-%s'), 'GStreamer plugin for %s', postinst=postinst, extra_depends='')
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050011 do_split_packages(d, glibdir+'/girepository-1.0', 'Gst(.*)-1.0\.typelib$', d.expand('${PN}-%s-typelib'), 'GStreamer typelib file for %s', postinst=postinst, extra_depends='')
12 do_split_packages(d, gst_libdir, 'libgst(.*)\.la$', d.expand('${PN}-%s-dev'), 'GStreamer plugin for %s (development files)', extra_depends='${PN}-dev')
13 do_split_packages(d, gst_libdir, 'libgst(.*)\.a$', d.expand('${PN}-%s-staticdev'), 'GStreamer plugin for %s (static development files)', extra_depends='${PN}-staticdev')
Patrick Williamsc124f4f2015-09-15 14:41:29 -050014}
15
16python set_metapkg_rdepends () {
17 import os
18
19 pn = d.getVar('PN', True)
20 metapkg = pn + '-meta'
21 d.setVar('ALLOW_EMPTY_' + metapkg, "1")
22 d.setVar('FILES_' + metapkg, "")
23 blacklist = [ pn, pn + '-locale', pn + '-dev', pn + '-dbg', pn + '-doc', pn + '-meta' ]
24 metapkg_rdepends = []
25 packages = d.getVar('PACKAGES', True).split()
26 pkgdest = d.getVar('PKGDEST', True)
27 for pkg in packages[1:]:
28 if not pkg in blacklist and not pkg in metapkg_rdepends and not pkg.endswith('-dev') and not pkg.endswith('-dbg') and not pkg.count('locale') and not pkg.count('-staticdev'):
29 # See if the package is empty by looking at the contents of its PKGDEST subdirectory.
30 # If this subdirectory is empty, then the package is.
31 # Empty packages do not get added to the meta package's RDEPENDS
32 pkgdir = os.path.join(pkgdest, pkg)
33 if os.path.exists(pkgdir):
34 dir_contents = os.listdir(pkgdir) or []
35 else:
36 dir_contents = []
37 is_empty = len(dir_contents) == 0
38 if not is_empty:
39 metapkg_rdepends.append(pkg)
40 d.setVar('RDEPENDS_' + metapkg, ' '.join(metapkg_rdepends))
41 d.setVar('DESCRIPTION_' + metapkg, pn + ' meta package')
42}
43
44# each plugin-dev depends on PN-dev, plugin-staticdev on PN-staticdev
45# so we need them even when empty (like in gst-plugins-good case)
46ALLOW_EMPTY_${PN} = "1"
47ALLOW_EMPTY_${PN}-dev = "1"
48ALLOW_EMPTY_${PN}-staticdev = "1"
49
50PACKAGES += "${PN}-apps ${PN}-meta ${PN}-glib"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050051
52FILES_${PN} = ""
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050053FILES_${PN}-apps = "${bindir}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050054FILES_${PN}-glib = "${datadir}/glib-2.0"
55
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050056RRECOMMENDS_${PN} += "${PN}-meta"