Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | PACKAGESPLITFUNCS_prepend = " split_gstreamer10_packages " |
| 2 | PACKAGESPLITFUNCS_append = " set_metapkg_rdepends " |
| 3 | |
| 4 | python 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='') |
| 11 | do_split_packages(d, gst_libdir, 'libgst(.*)\.la$', d.expand('${PN}-%s-dev'), 'GStreamer plugin for %s (development files)', extra_depends=d.expand('${PN}-dev')) |
| 12 | do_split_packages(d, gst_libdir, 'libgst(.*)\.a$', d.expand('${PN}-%s-staticdev'), 'GStreamer plugin for %s (static development files)', extra_depends=d.expand('${PN}-staticdev')) |
| 13 | } |
| 14 | |
| 15 | python set_metapkg_rdepends () { |
| 16 | import os |
| 17 | |
| 18 | pn = d.getVar('PN', True) |
| 19 | metapkg = pn + '-meta' |
| 20 | d.setVar('ALLOW_EMPTY_' + metapkg, "1") |
| 21 | d.setVar('FILES_' + metapkg, "") |
| 22 | blacklist = [ pn, pn + '-locale', pn + '-dev', pn + '-dbg', pn + '-doc', pn + '-meta' ] |
| 23 | metapkg_rdepends = [] |
| 24 | packages = d.getVar('PACKAGES', True).split() |
| 25 | pkgdest = d.getVar('PKGDEST', True) |
| 26 | for pkg in packages[1:]: |
| 27 | 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'): |
| 28 | # See if the package is empty by looking at the contents of its PKGDEST subdirectory. |
| 29 | # If this subdirectory is empty, then the package is. |
| 30 | # Empty packages do not get added to the meta package's RDEPENDS |
| 31 | pkgdir = os.path.join(pkgdest, pkg) |
| 32 | if os.path.exists(pkgdir): |
| 33 | dir_contents = os.listdir(pkgdir) or [] |
| 34 | else: |
| 35 | dir_contents = [] |
| 36 | is_empty = len(dir_contents) == 0 |
| 37 | if not is_empty: |
| 38 | metapkg_rdepends.append(pkg) |
| 39 | d.setVar('RDEPENDS_' + metapkg, ' '.join(metapkg_rdepends)) |
| 40 | d.setVar('DESCRIPTION_' + metapkg, pn + ' meta package') |
| 41 | } |
| 42 | |
| 43 | # each plugin-dev depends on PN-dev, plugin-staticdev on PN-staticdev |
| 44 | # so we need them even when empty (like in gst-plugins-good case) |
| 45 | ALLOW_EMPTY_${PN} = "1" |
| 46 | ALLOW_EMPTY_${PN}-dev = "1" |
| 47 | ALLOW_EMPTY_${PN}-staticdev = "1" |
| 48 | |
| 49 | PACKAGES += "${PN}-apps ${PN}-meta ${PN}-glib" |
| 50 | FILES_${PN}-apps = "${bindir}" |
| 51 | |
| 52 | RDEPENDS_${PN}-apps += "perl" |
| 53 | RRECOMMENDS_${PN} += "${PN}-meta" |
| 54 | |
| 55 | FILES_${PN} = "" |
| 56 | FILES_${PN}-dbg += "${libdir}/gstreamer-${LIBV}/.debug" |
| 57 | FILES_${PN}-glib = "${datadir}/glib-2.0" |
| 58 | |