opencl: make use of the 'opencl' DISTRO_FEATURE

Currently packages like Mesa list 'opengl' and 'vulkan' as required
DISTRO_FEATURES, disabling GPU support for non-graphics-enabled cases.
However in the modern world it's a perfectly fine usecase to have a
headless box with GPU being used by OpenCL only. The OE-Core has added
the 'opencl' DISTRO_FEATURE, making it possible to specify whether
OpenCL is enabled or not and also making it possible to enable GPU
packages if only OpenCL is required.

Follow the example of GLVND and vulkan-loader and disable OpenCL ICD
packages if corresponding feature is not enabled.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Dmitry Baryshkov 2025-09-18 06:04:50 +03:00 committed by Khem Raj
parent 97b28934e8
commit f65ae714d8
5 changed files with 14 additions and 4 deletions

View File

@ -8,7 +8,8 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
SRCREV = "b2e647ffb8f42aa22ce4b0194d6ef6d16d5002b0"
inherit cmake features_check
inherit cmake
REQUIRED_DISTRO_FEATURES = "opencl"
DEPENDS += "opencl-clhpp virtual/libopencl1"

View File

@ -9,8 +9,9 @@ SRC_URI = "git://github.com/OCL-dev/ocl-icd.git;protocol=https;branch=master"
SRCREV = "fdde6677b21329432db8b481e2637cd10f7d3cb2"
inherit autotools features_check
inherit autotools
REQUIRED_DISTRO_FEATURES = "opencl"
DEPENDS = "ruby-native"
PROVIDES = "virtual/libopencl1"

View File

@ -3,7 +3,9 @@ DESCRIPTION = "OpenCL CTS test suite"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=3b83ef96387f14655fc854ddc3c6bd57"
inherit pkgconfig cmake
inherit pkgconfig cmake features_check
REQUIRED_DISTRO_FEATURES = "opencl"
DEPENDS += "opencl-headers virtual/libopencl1"
RDEPENDS:${PN} += "python3-core python3-io"

View File

@ -4,7 +4,9 @@ LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
SECTION = "base"
inherit pkgconfig cmake
inherit pkgconfig cmake features_check
REQUIRED_DISTRO_FEATURES = "opencl"
DEPENDS += "opencl-headers"

View File

@ -7,6 +7,10 @@ HOMEPAGE = "https://github.com/Oblomov/clinfo"
LICENSE = "CC0-1.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=fd8857f774dfb0eefe1e80c8f9240a7e"
inherit features_check
REQUIRED_DISTRO_FEATURES = "opencl"
SRC_URI = "git://github.com/Oblomov/clinfo.git;protocol=https;branch=master"
SRCREV = "748c3930a9b9cb826e631d77439e2cb8f84f5bcf"