diff options
author | Randolph Sapp <rs@ti.com> | 2023-06-21 13:26:04 -0500 |
---|---|---|
committer | Ryan Eatmon <reatmon@ti.com> | 2023-06-22 07:11:48 -0500 |
commit | 1705f6d3c41302c6dae04e93bba84e203624e6c5 (patch) | |
tree | 849fe13cb266ae5c9a26dc68e11e5fd801a5eb33 | |
parent | e15df9d32c5fb5980e7cc04398396e7d1a380806 (diff) | |
download | meta-ti-1705f6d3c41302c6dae04e93bba84e203624e6c5.tar.gz |
ti-img-rogue-umlibs: make all components optional
Bumping into the limitations of the binary_package class. This change
allows all rogue components to be optionally packaged without blowing
out the dependency chain.
Add a python function to fetch file paths from the FILE vars for each
component so we don't end up double tracking files. Add variables to
track component packages if things split up more later. Add a package
config string to set runtime dependencies and recommendations. Change
all logic to revolve around the PACKAGECONFIG instead of distro
features.
Signed-off-by: Randolph Sapp <rs@ti.com>
Signed-off-by: Ryan Eatmon <reatmon@ti.com>
-rw-r--r-- | meta-ti-bsp/recipes-graphics/powervr-umlibs/ti-img-rogue-umlibs_23.1.6404501.bb | 58 |
1 files changed, 49 insertions, 9 deletions
diff --git a/meta-ti-bsp/recipes-graphics/powervr-umlibs/ti-img-rogue-umlibs_23.1.6404501.bb b/meta-ti-bsp/recipes-graphics/powervr-umlibs/ti-img-rogue-umlibs_23.1.6404501.bb index b166736c..c012859f 100644 --- a/meta-ti-bsp/recipes-graphics/powervr-umlibs/ti-img-rogue-umlibs_23.1.6404501.bb +++ b/meta-ti-bsp/recipes-graphics/powervr-umlibs/ti-img-rogue-umlibs_23.1.6404501.bb | |||
@@ -28,20 +28,63 @@ RDEPENDS:${PN} = " \ | |||
28 | ${PN}-firmware \ | 28 | ${PN}-firmware \ |
29 | " | 29 | " |
30 | 30 | ||
31 | PACKAGECONFIG ?= " \ | ||
32 | ${@bb.utils.contains('DISTRO_FEATURES', 'vulkan x11 wayland', 'vulkan', '', d)} \ | ||
33 | ${@bb.utils.filter('DISTRO_FEATURES', 'opengl opencl', d)} \ | ||
34 | " | ||
35 | |||
36 | PACKAGECONFIG[opengl] = ",,,${GLES_LIB_PACKAGES}" | ||
37 | PACKAGECONFIG[vulkan] = ",,,${VULKAN_LIB_PACKAGES}" | ||
38 | PACKAGECONFIG[opencl] = ",,,${OPENCL_LIB_PACKAGES},libopencl-rogue-tools" | ||
39 | |||
40 | def get_file_list(package_list_var, d): | ||
41 | file_list = [] | ||
42 | package_list = d.getVar(package_list_var) | ||
43 | if package_list: | ||
44 | for package in package_list.split(): | ||
45 | package_files = d.getVar(f"FILES:{package}") | ||
46 | if package_files: | ||
47 | file_list.append(package_files) | ||
48 | return " ".join(file_list) | ||
49 | |||
31 | do_install:append() { | 50 | do_install:append() { |
51 | if ${@bb.utils.contains('PACKAGECONFIG', 'opengl', 'false', 'true', d)}; then | ||
52 | for file in ${@get_file_list('GLES_PACKAGES', d)}; do | ||
53 | rm -rf ${D}/${file} | ||
54 | rmdir --ignore-fail-on-non-empty $(dirname ${D}/${file}) | ||
55 | done | ||
56 | fi | ||
57 | if ${@bb.utils.contains('PACKAGECONFIG', 'vulkan', 'false', 'true', d)}; then | ||
58 | for file in ${@get_file_list('VULKAN_PACKAGES', d)}; do | ||
59 | rm -rf ${D}/${file} | ||
60 | rmdir --ignore-fail-on-non-empty $(dirname ${D}/${file}) | ||
61 | done | ||
62 | fi | ||
63 | if ${@bb.utils.contains('PACKAGECONFIG', 'opencl', 'false', 'true', d)}; then | ||
64 | for file in ${@get_file_list('OPENCL_PACKAGES', d)}; do | ||
65 | rm -rf ${D}/${file} | ||
66 | rmdir --ignore-fail-on-non-empty $(dirname ${D}/${file}) | ||
67 | done | ||
68 | fi | ||
32 | if ${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', 'true', 'false', d)}; then | 69 | if ${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', 'true', 'false', d)}; then |
33 | mv ${D}/lib/firmware ${D}${nonarch_base_libdir} | 70 | mv ${D}/lib/firmware ${D}${nonarch_base_libdir} |
34 | rmdir ${D}/lib | 71 | rmdir ${D}/lib |
35 | fi | 72 | fi |
36 | } | 73 | } |
37 | 74 | ||
75 | GLES_LIB_PACKAGES = "libgles1-rogue libgles2-rogue libgles3-rogue" | ||
76 | GLES_PACKAGES = "${GLES_LIB_PACKAGES}" | ||
77 | |||
78 | VULKAN_LIB_PACKAGES = "libvk-rogue" | ||
79 | VULKAN_PACKAGES = "${VULKAN_LIB_PACKAGES}" | ||
80 | |||
81 | OPENCL_LIB_PACKAGES = "libopencl-rogue" | ||
82 | OPENCL_PACKAGES = "${OPENCL_LIB_PACKAGES} libopencl-rogue-tools" | ||
83 | |||
38 | PACKAGES = " \ | 84 | PACKAGES = " \ |
39 | libgles1-rogue \ | 85 | ${@bb.utils.contains('PACKAGECONFIG', 'opengl', d.getVar('GLES_PACKAGES'), '', d)} \ |
40 | libgles2-rogue \ | 86 | ${@bb.utils.contains('PACKAGECONFIG', 'vulkan', d.getVar('VULKAN_PACKAGES'), '', d)} \ |
41 | libgles3-rogue \ | 87 | ${@bb.utils.contains('PACKAGECONFIG', 'opencl', d.getVar('OPENCL_PACKAGES'), '', d)} \ |
42 | libvk-rogue \ | ||
43 | libopencl-rogue \ | ||
44 | libopencl-rogue-tools \ | ||
45 | ${PN}-tools \ | 88 | ${PN}-tools \ |
46 | ${PN}-firmware \ | 89 | ${PN}-firmware \ |
47 | ${PN} \ | 90 | ${PN} \ |
@@ -94,9 +137,6 @@ FILES:${PN}-firmware = "${base_libdir}/firmware/*" | |||
94 | INSANE_SKIP:${PN}-firmware += "arch" | 137 | INSANE_SKIP:${PN}-firmware += "arch" |
95 | 138 | ||
96 | RRECOMMENDS:${PN} += " \ | 139 | RRECOMMENDS:${PN} += " \ |
97 | ${@bb.utils.contains("DISTRO_FEATURES", "opengl", "libgles1-rogue libgles2-rogue", "", d)} \ | ||
98 | ${@bb.utils.contains("DISTRO_FEATURES", "vulkan x11 wayland", "libvk-rogue", "", d)} \ | ||
99 | ${@bb.utils.contains("DISTRO_FEATURES", "opencl", "libopencl-rogue", "", d)} \ | ||
100 | ${PN}-tools \ | 140 | ${PN}-tools \ |
101 | " | 141 | " |
102 | 142 | ||