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}') |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 6 | postinst = d.getVar('plugin_postinst') |
| 7 | glibdir = d.getVar('libdir') |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 8 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 9 | do_split_packages(d, glibdir, r'^lib(.*)\.so\.*', 'lib%s', 'gstreamer %s library', extra_depends='', allow_links=True) |
| 10 | do_split_packages(d, gst_libdir, r'libgst(.*)\.so$', d.expand('${PN}-%s'), 'GStreamer plugin for %s', postinst=postinst, extra_depends='') |
| 11 | do_split_packages(d, glibdir+'/girepository-1.0', r'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, r'libgst(.*)\.la$', d.expand('${PN}-%s-dev'), 'GStreamer plugin for %s (development files)', extra_depends='${PN}-dev') |
| 13 | do_split_packages(d, gst_libdir, r'libgst(.*)\.a$', d.expand('${PN}-%s-staticdev'), 'GStreamer plugin for %s (static development files)', extra_depends='${PN}-staticdev') |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 14 | } |
| 15 | |
| 16 | python set_metapkg_rdepends () { |
| 17 | import os |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 18 | import oe.utils |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 19 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 20 | pn = d.getVar('PN') |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 21 | metapkg = pn + '-meta' |
| 22 | d.setVar('ALLOW_EMPTY_' + metapkg, "1") |
| 23 | d.setVar('FILES_' + metapkg, "") |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 24 | blacklist = [ pn, pn + '-meta' ] |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 25 | metapkg_rdepends = [] |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 26 | pkgdest = d.getVar('PKGDEST') |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 27 | for pkg in oe.utils.packages_filter_out_system(d): |
| 28 | if pkg not in blacklist and pkg not in metapkg_rdepends: |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 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) |
| 46 | ALLOW_EMPTY_${PN} = "1" |
| 47 | ALLOW_EMPTY_${PN}-dev = "1" |
| 48 | ALLOW_EMPTY_${PN}-staticdev = "1" |
| 49 | |
| 50 | PACKAGES += "${PN}-apps ${PN}-meta ${PN}-glib" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 51 | |
| 52 | FILES_${PN} = "" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 53 | FILES_${PN}-apps = "${bindir}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 54 | FILES_${PN}-glib = "${datadir}/glib-2.0" |
| 55 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 56 | RRECOMMENDS_${PN} += "${PN}-meta" |