gstreamer1.0-plugins-packaging.inc 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. # This .inc file contains functionality for automatically splitting
  2. # built plugins into individual packages for each plugin. A -meta
  3. # package is also set up that has no files of its own, but contains
  4. # the names of all plugin packages in its RDEPENDS list.
  5. #
  6. # This is mainly used by the gstreamer1.0-plugins-* plugin set recipes,
  7. # but can be used in any recipe that produces GStreamer plugins.
  8. PACKAGESPLITFUNCS_prepend = " split_gstreamer10_packages "
  9. PACKAGESPLITFUNCS_append = " set_gstreamer10_metapkg_rdepends "
  10. python split_gstreamer10_packages () {
  11. gst_libdir = d.expand('${libdir}/gstreamer-1.0')
  12. postinst = d.getVar('plugin_postinst')
  13. glibdir = d.getVar('libdir')
  14. # GStreamer libraries
  15. do_split_packages(d, glibdir, r'^lib(.*)\.so\.*', 'lib%s', 'GStreamer 1.0 %s library', extra_depends='', allow_links=True)
  16. # GStreamer plugin shared objects
  17. do_split_packages(d, gst_libdir, r'libgst(.*)\.so$', d.expand('${PN}-%s'), 'GStreamer 1.0 plugin for %s', postinst=postinst, extra_depends='')
  18. # GObject introspection files for GStreamer plugins
  19. do_split_packages(d, glibdir+'/girepository-1.0', r'Gst(.*)-1.0\.typelib$', d.expand('${PN}-%s-typelib'), 'GStreamer 1.0 typelib file for %s', postinst=postinst, extra_depends='')
  20. # Static GStreamer libraries for development
  21. do_split_packages(d, gst_libdir, r'libgst(.*)\.a$', d.expand('${PN}-%s-staticdev'), 'GStreamer 1.0 plugin for %s (static development files)', extra_depends='${PN}-staticdev')
  22. }
  23. python set_gstreamer10_metapkg_rdepends () {
  24. import os
  25. import oe.utils
  26. # Go through all generated packages (excluding the main package and
  27. # the -meta package itself) and add them to the -meta package as RDEPENDS.
  28. pn = d.getVar('PN')
  29. metapkg = pn + '-meta'
  30. d.setVar('ALLOW_EMPTY_' + metapkg, "1")
  31. d.setVar('FILES_' + metapkg, "")
  32. blacklist = [ pn, pn + '-meta' ]
  33. metapkg_rdepends = []
  34. pkgdest = d.getVar('PKGDEST')
  35. for pkg in oe.utils.packages_filter_out_system(d):
  36. if pkg not in blacklist and pkg not in metapkg_rdepends:
  37. # See if the package is empty by looking at the contents of its PKGDEST subdirectory.
  38. # If this subdirectory is empty, then the package is.
  39. # Empty packages do not get added to the meta package's RDEPENDS
  40. pkgdir = os.path.join(pkgdest, pkg)
  41. if os.path.exists(pkgdir):
  42. dir_contents = os.listdir(pkgdir) or []
  43. else:
  44. dir_contents = []
  45. is_empty = len(dir_contents) == 0
  46. if not is_empty:
  47. metapkg_rdepends.append(pkg)
  48. d.setVar('RDEPENDS_' + metapkg, ' '.join(metapkg_rdepends))
  49. d.setVar('DESCRIPTION_' + metapkg, pn + ' meta package')
  50. }
  51. # each plugin-dev depends on PN-dev, plugin-staticdev on PN-staticdev
  52. # so we need them even when empty (like in gst-plugins-good case)
  53. ALLOW_EMPTY_${PN} = "1"
  54. ALLOW_EMPTY_${PN}-dev = "1"
  55. ALLOW_EMPTY_${PN}-staticdev = "1"
  56. PACKAGES += "${PN}-apps ${PN}-meta ${PN}-glib"
  57. FILES_${PN} = ""
  58. FILES_${PN}-apps = "${bindir}"
  59. FILES_${PN}-glib = "${datadir}/glib-2.0"
  60. RRECOMMENDS_${PN} += "${PN}-meta"