diff --git a/.oebuild/features/k8s.yaml b/.oebuild/features/k8s.yaml new file mode 100644 index 0000000000000000000000000000000000000000..fbfd922ddf1df8501f61fa7407746d04aca11d4e --- /dev/null +++ b/.oebuild/features/k8s.yaml @@ -0,0 +1,10 @@ +type: feature + +repos: +- yocto-meta-virtualization + +layers: +- yocto-meta-virtualization + +local_conf: | + DISTRO_FEATURES:append = " k8s virtualization" diff --git a/.oebuild/manifest.yaml b/.oebuild/manifest.yaml index 8660290774344f381c538a412d2d8949a7958834..91b4927ea2d2730e098872b42f8aa4cf4d7eab72 100644 --- a/.oebuild/manifest.yaml +++ b/.oebuild/manifest.yaml @@ -1130,7 +1130,7 @@ manifest_list: version: e4948f34fe11783f8a586bc3ea889394d36eae60 mesa: remote_url: https://gitee.com/src-openeuler/mesa.git - version: b58c5e25dc5550e9a76c21a0804c03f71cb15076 + version: a3c50c4c730c0b059ea2a58df8833205d6142d9a meson: remote_url: https://gitee.com/src-openeuler/meson.git version: eb7ddaa9d616edd9213967d1edf2e76c4830b057 @@ -1248,6 +1248,9 @@ manifest_list: oee_archive: remote_url: https://gitee.com/openeuler/oee_archive.git version: 47a7c941bad0100b291352db561ff880b66927ef + oedeploy: + remote_url: https://gitee.com/src-openeuler/oeDeploy.git + version: 1613af12e65533c32bfba2e5f3a6d77ff94657fb ompl: remote_url: https://gitee.com/src-openeuler/ompl.git version: 42759f06c9a8d712a5ba86f1f3b22a569ec81232 @@ -1460,7 +1463,7 @@ manifest_list: version: 11c4347339cb998201af161ea3146014a508c47f python-attrs: remote_url: https://gitee.com/src-openeuler/python-attrs.git - version: 4f3b44809131fca392bc1daedda76a21ebc66944 + version: cd3b0ed93480eeb78b496dadc563ff8c165a20f7 python-asn1crypto: remote_url: https://gitee.com/src-openeuler/python-asn1crypto.git version: 59c9fa5ffb80473812a0174c8ab671ac83090505 @@ -1644,9 +1647,6 @@ manifest_list: python-zipp: remote_url: https://gitee.com/src-openeuler/python-zipp.git version: 55051c2e64b9ecb67fd9fa154ec412f7875e3787 - python-attrs: - remote_url: https://gitee.com/src-openeuler/python-attrs.git - version: cd3b0ed93480eeb78b496dadc563ff8c165a20f7 python3: remote_url: https://gitee.com/src-openeuler/python3.git version: 2437090cb22413f516fd3a5a7ef5d5d26385057d @@ -2226,6 +2226,9 @@ manifest_list: yocto-meta-sunxi: remote_url: https://github.com/linux-sunxi/meta-sunxi.git version: c475a1851a877bf700d6d9748be7336b2eadd3b2 + yocto-meta-virtualization: + remote_url: https://gitee.com/openeuler/yocto-meta-virtualization.git + version: 9c01aebc5cf3de71135f8324ec7f9d32a2291319 yocto-opkg-utils: remote_url: https://gitee.com/src-openeuler/yocto-opkg-utils.git version: 1d04472046d0225e013dd7e18c62dddf82025969 diff --git a/.oebuild/samples/aarch64/kp920-industry-kernel6.yaml b/.oebuild/samples/aarch64/kp920-industry-kernel6.yaml index e51342db8b76a57473b8b46428aaf449ee268271..c20543c4cc6699d3ab27f6ae5ffe7b756e8d9b99 100644 --- a/.oebuild/samples/aarch64/kp920-industry-kernel6.yaml +++ b/.oebuild/samples/aarch64/kp920-industry-kernel6.yaml @@ -1,4 +1,4 @@ -# Features: systemd, hmi, kernel6, xen, mcs, isulad +# Features: systemd, hmi, kernel6, xen, mcs, isulad, epkg, k8s, rt build_in: docker machine: kp920 toolchain_type: EXTERNAL_TOOLCHAIN:aarch64 @@ -7,6 +7,7 @@ repos: - yocto-poky - yocto-meta-openembedded - yocto-meta-qt5 +- yocto-meta-virtualization local_conf: |+ MCS_FEATURES ?= "openamp" DISTRO_FEATURES:append = " mcs" @@ -30,11 +31,17 @@ local_conf: |+ INIT_MANAGER = "systemd" DISTRO_FEATURES:append = " epkg" + DISTRO_FEATURES:append = " k8s virtualization" + + PREFERRED_PROVIDER_virtual/kernel = "linux-openeuler-rt" + DISTRO_FEATURES:append = " preempt-rt " + layers: - yocto-meta-openeuler/bsp/meta-kunpeng - yocto-meta-openembedded/meta-oe - yocto-meta-qt5 - yocto-meta-openeuler/rtos/meta-openeuler-rtos +- yocto-meta-virtualization docker_param: image: swr.cn-north-4.myhuaweicloud.com/openeuler-embedded/openeuler-container:latest parameters: -itd --network host diff --git a/.oebuild/samples/aarch64/kp920-industry.yaml b/.oebuild/samples/aarch64/kp920-industry.yaml index 9549a2ed46afdebb60309a7adc73ac59081dc880..9191133c410508bfb2cb80ea2eb0ea5cc390d8ec 100644 --- a/.oebuild/samples/aarch64/kp920-industry.yaml +++ b/.oebuild/samples/aarch64/kp920-industry.yaml @@ -7,6 +7,7 @@ repos: - yocto-poky - yocto-meta-openembedded - yocto-meta-qt5 +- yocto-meta-virtualization local_conf: |+ MCS_FEATURES ?= "openamp" DISTRO_FEATURES:append = " mcs" @@ -26,11 +27,14 @@ local_conf: |+ INIT_MANAGER = "systemd" DISTRO_FEATURES:append = " epkg" + DISTRO_FEATURES:append = " k8s virtualization" + layers: - yocto-meta-openeuler/bsp/meta-kunpeng - yocto-meta-openembedded/meta-oe - yocto-meta-qt5 - yocto-meta-openeuler/rtos/meta-openeuler-rtos +- yocto-meta-virtualization docker_param: image: swr.cn-north-4.myhuaweicloud.com/openeuler-embedded/openeuler-container:latest parameters: -itd --network host diff --git a/bsp/meta-kunpeng/recipes-core/images/image-kp920.inc b/bsp/meta-kunpeng/recipes-core/images/image-kp920.inc index 926da8e76a791c27d28a635f7d6224705c8f3ada..8236d051f48ed882d14ab4f33cfa3de3ecf6a86a 100644 --- a/bsp/meta-kunpeng/recipes-core/images/image-kp920.inc +++ b/bsp/meta-kunpeng/recipes-core/images/image-kp920.inc @@ -9,4 +9,13 @@ IMAGE_INSTALL += " \ libmodbus \ openjpeg \ opencv \ + oedeploy \ + ${@bb.utils.contains("DISTRO_FEATURES", "k8s", " \ + packagegroup-kubernetes-base \ + packagegroup-k8s-host \ + packagegroup-k8s-node \ + packagegroup-docker \ + packagegroup-oci \ + packagegroup-containerd \ + ", "", d)} \ " diff --git a/bsp/meta-kunpeng/recipes-core/packagegroups/packagegroup-container.bbappend b/bsp/meta-kunpeng/recipes-core/packagegroups/packagegroup-container.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..361e337fd6bfd214106fdea9451fc7e389b4c786 --- /dev/null +++ b/bsp/meta-kunpeng/recipes-core/packagegroups/packagegroup-container.bbappend @@ -0,0 +1,6 @@ +PACKAGES:remove = "\ + packagegroup-container \ + packagegroup-lxc \ + ${@bb.utils.contains('DISTRO_FEATURES', 'seccomp ipv6', \ + 'packagegroup-podman', '', d)} \ + " diff --git a/bsp/meta-kunpeng/recipes-core/packagegroups/packagegroup-kubernetes.bbappend b/bsp/meta-kunpeng/recipes-core/packagegroups/packagegroup-kubernetes.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..e8f78f4006f273c4389d40881b8af0aa85fd1b05 --- /dev/null +++ b/bsp/meta-kunpeng/recipes-core/packagegroups/packagegroup-kubernetes.bbappend @@ -0,0 +1,4 @@ +PACKAGES:remove = "\ + packagegroup-k3s-host \ + packagegroup-k3s-node \ + " diff --git a/bsp/meta-kunpeng/recipes-extended/libvirt/libvirt_%.bbappend b/bsp/meta-kunpeng/recipes-extended/libvirt/libvirt_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..1bb92371804b3c441f7f923cac723b90e364696d --- /dev/null +++ b/bsp/meta-kunpeng/recipes-extended/libvirt/libvirt_%.bbappend @@ -0,0 +1,6 @@ +PACKAGECONFIG = "gnutls qemu yajl openvz vbox esx test remote \ + libvirtd netcf udev python fuse firewalld libpcap \ + ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux audit libcap-ng', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'xen', 'libxl', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'polkit', 'polkit', '', d)} \ + " diff --git a/bsp/meta-kunpeng/recipes-kernel/linux/linux-kp920.inc b/bsp/meta-kunpeng/recipes-kernel/linux/linux-kp920.inc index faf83b19b0f30b2adeac7d9d5513fba673c8e0ec..4f558a6d051060aae58f427610ca0fae770a5cdb 100644 --- a/bsp/meta-kunpeng/recipes-kernel/linux/linux-kp920.inc +++ b/bsp/meta-kunpeng/recipes-kernel/linux/linux-kp920.inc @@ -16,6 +16,9 @@ SRC_URI:append = " \ file://config/cfg-fragments/common-pc-drivers.cfg \ " +# The kp920 kernel configuration now supports k8s and does not require a separate configuration file. +SRC_URI:remove = "${@bb.utils.contains('DISTRO_FEATURES', 'k8s', ' file://kubernetes.scc', '', d)}" + OPENEULER_KERNEL_CONFIG = "" KBUILD_DEFCONFIG = "openeuler_defconfig" diff --git a/meta-openeuler/recipes-bsp/gnu-efi/gnu-efi_%.bbappend b/meta-openeuler/recipes-bsp/gnu-efi/gnu-efi_%.bbappend index 756a63512ef6fb0bf36fcf014f44e442ce3942a5..0a63e55cf2901ae14a0c2bfc502e896ed9bcc9ae 100644 --- a/meta-openeuler/recipes-bsp/gnu-efi/gnu-efi_%.bbappend +++ b/meta-openeuler/recipes-bsp/gnu-efi/gnu-efi_%.bbappend @@ -16,7 +16,6 @@ SRC_URI:append = " \ file://0001-riscv64-adjust-type-definitions.patch \ file://0001-riscv64-ignore-unknown-relocs.patch \ file://no-werror.patch \ - file://fix-build-error-on-loongarch64.patch \ " # patches unneeded for version 3.0.17 diff --git a/meta-openeuler/recipes-core/packagegroups/packagegroup-preempt-rt.bb b/meta-openeuler/recipes-core/packagegroups/packagegroup-preempt-rt.bb index 468fa6ad10c9d5203c7aaafea90750c4a7a82f0d..f88ddd1ce1f9cf582536633918533174fb665a60 100644 --- a/meta-openeuler/recipes-core/packagegroups/packagegroup-preempt-rt.bb +++ b/meta-openeuler/recipes-core/packagegroups/packagegroup-preempt-rt.bb @@ -10,4 +10,6 @@ PACKAGES = "${PN}" RDEPENDS:${PN} = " \ rt-tests \ hwlatdetect \ + stress-ng \ + screen \ " diff --git a/meta-openeuler/recipes-extended/oedeploy/oedeploy_1.1.0.bb b/meta-openeuler/recipes-extended/oedeploy/oedeploy_1.1.0.bb new file mode 100644 index 0000000000000000000000000000000000000000..a1c86c6cc37e1eee15b26d93202a188cbee5a315 --- /dev/null +++ b/meta-openeuler/recipes-extended/oedeploy/oedeploy_1.1.0.bb @@ -0,0 +1,43 @@ +SUMMARY = "Tool suite for app installation and deployment" +DESCRIPTION = "oeDeploy" +HOMEPAGE = "https://gitee.com/openeuler/oeDeploy" + +PV = "1.1.0" + +SRC_URI += " \ + file://oedp-${PV}.tar.gz \ + " + +do_compile[noexec] = "1" + +LICENSE = "MulanPSL-2.0" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/MulanPSL-2.0;md5=74b1b7a7ee537a16390ed514498bf23c" + +RDEPENDS:${PN} += "python3 python3-ansible python3-prettytable python3-netaddr" + +S = "${WORKDIR}/oedp-${PV}" + +do_install() { + install -d ${D}${nonarch_libdir}/oedp/ + install -d ${D}${datadir}/applications + install -d ${D}${sysconfdir}/oedp/config/ + install -d ${D}${bindir} + + cp -rdpf ${S}/src ${D}${nonarch_libdir}/oedp/ + + chown -R root:root ${D}${nonarch_libdir}/oedp/ + chmod -R 700 ${D}${nonarch_libdir}/oedp/ + + mv -f ${D}${nonarch_libdir}/oedp/src/config/* ${D}${sysconfdir}/oedp/config/ + install -d ${D}${sysconfdir}/oedp/config/repo/cache + install -c -m 0400 ${S}/static/* ${D}${datadir}/applications/ + install -c -m 0500 ${S}/oedp.py ${D}${bindir}/oedp + + install -d ${D}${localstatedir}/oedp/log + install -d ${D}${localstatedir}/oedp/plugin + install -d ${D}${localstatedir}/oedp/python + install -d ${D}${localstatedir}/oedp/python/venv +} + +FILES:${PN} += "${nonarch_libdir}/oedp/ ${datadir}/applications ${sysconfdir}/oedp ${bindir}" +# INSANE_SKIP:${PN} += "already-stripped" diff --git a/meta-openeuler/recipes-graphics/mesa/files/0001-Revert-meson-do-not-pull-in-clc-for-clover.patch b/meta-openeuler/recipes-graphics/mesa/files/0001-Revert-meson-do-not-pull-in-clc-for-clover.patch new file mode 100644 index 0000000000000000000000000000000000000000..1711e22585a72d1909473e4d9716c4734d4c5eee --- /dev/null +++ b/meta-openeuler/recipes-graphics/mesa/files/0001-Revert-meson-do-not-pull-in-clc-for-clover.patch @@ -0,0 +1,53 @@ +From 051f41beda540f0ae77b341db01a6de83c9e938a Mon Sep 17 00:00:00 2001 +From: Markus Volk +Date: Fri, 8 Mar 2024 15:53:11 +0100 +Subject: [PATCH] Revert "meson: do not pull in clc for clover" + +This reverts commit 815a6647eb1383e9dc704ffcc266d85f3b13338a. +Upstream-Status: Inappropriate [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27783/diffs?commit_id=a976f2c9f0c07f9e06cc9affd9124b45bc60c2bd] + +Once the merge request above was added, it will only be possible to provide opencl spir-v with gallium-rusticl=true. This is not yet supported in the mesa recipe. +For now reverting this commit allows to still use clover with opencl-spirv, which would otherwise be broken starting from mesa 24.0.2. + +After it was merged, this patch needs to be removed and rusticl support will be required + +Signed-off-by: Markus Volk +--- + meson.build | 3 ++- + src/compiler/meson.build | 2 +- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/meson.build b/meson.build +index 2db6185..741b5d1 100644 +--- a/meson.build ++++ b/meson.build +@@ -813,6 +813,7 @@ if _opencl != 'disabled' + error('The Clover OpenCL state tracker requires rtti') + endif + ++ with_clc = true + with_gallium_opencl = true + with_opencl_icd = _opencl == 'icd' + else +@@ -837,7 +838,7 @@ if with_gallium_rusticl + endif + + dep_clc = null_dep +-if with_gallium_opencl or with_clc ++if with_clc + dep_clc = dependency('libclc') + endif + +diff --git a/src/compiler/meson.build b/src/compiler/meson.build +index 8d73544..1dae56d 100644 +--- a/src/compiler/meson.build ++++ b/src/compiler/meson.build +@@ -79,7 +79,7 @@ subdir('nir') + + subdir('spirv') + +-if with_clc ++if with_opencl_spirv + subdir('clc') + endif + if with_gallium diff --git a/meta-openeuler/recipes-graphics/mesa/files/0001-drisw-fix-build-without-dri3.patch b/meta-openeuler/recipes-graphics/mesa/files/0001-drisw-fix-build-without-dri3.patch new file mode 100644 index 0000000000000000000000000000000000000000..ab1615209063fb0b7bee74f3b49843790801e40a --- /dev/null +++ b/meta-openeuler/recipes-graphics/mesa/files/0001-drisw-fix-build-without-dri3.patch @@ -0,0 +1,58 @@ +From 4bd15a419e892da843489c374c58c5b29c40b5d6 Mon Sep 17 00:00:00 2001 +From: Romain Naour +Date: Tue, 6 Feb 2024 09:47:09 +0100 +Subject: [PATCH 1/2] drisw: fix build without dri3 + +commit 1887368df41 ("glx/sw: check for modifier support in the kopper path") +added dri3_priv.h header and dri3_check_multibuffer() function in drisw that +can be build without dri3. + + i686-buildroot-linux-gnu/bin/ld: src/glx/libglx.a.p/drisw_glx.c.o: in function `driswCreateScreenDriver': + drisw_glx.c:(.text.driswCreateScreenDriver+0x3a0): undefined reference to `dri3_check_multibuffer' + collect2: error: ld returned 1 exit status + +Add HAVE_DRI3 guard around dri3_priv.h header and the zink code using +dri3_check_multibuffer(). + +Fixes: 1887368df41 ("glx/sw: check for modifier support in the kopper path") + +Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27478] +Signed-off-by: Romain Naour +Signed-off-by: Khem Raj +--- + src/glx/drisw_glx.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c +index 3d3f752..4b19e2d 100644 +--- a/src/glx/drisw_glx.c ++++ b/src/glx/drisw_glx.c +@@ -32,7 +32,9 @@ + #include + #include "dri_common.h" + #include "drisw_priv.h" ++#ifdef HAVE_DRI3 + #include "dri3_priv.h" ++#endif + #include + #include + #include +@@ -995,6 +997,7 @@ driswCreateScreenDriver(int screen, struct glx_display *priv, + goto handle_error; + } + ++#ifdef HAVE_DRI3 + if (pdpyp->zink) { + bool err; + psc->has_multibuffer = dri3_check_multibuffer(priv->dpy, &err); +@@ -1005,6 +1008,7 @@ driswCreateScreenDriver(int screen, struct glx_display *priv, + goto handle_error; + } + } ++#endif + + glx_config_destroy_list(psc->base.configs); + psc->base.configs = configs; +-- +2.44.0 + diff --git a/meta-openeuler/recipes-graphics/mesa/files/0001-gallium-Fix-build-with-llvm-17.patch b/meta-openeuler/recipes-graphics/mesa/files/0001-gallium-Fix-build-with-llvm-17.patch deleted file mode 100644 index 237f940f0bfe0c94124f694800a1a3021d4d7944..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-graphics/mesa/files/0001-gallium-Fix-build-with-llvm-17.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 6d07f6aa7f92f40d78a2db645f16f0f3e7d3c2e8 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Fri, 23 Jun 2023 01:20:38 -0700 -Subject: [PATCH] gallium: Fix build with llvm 17 - -These headers are not available for C files in llvm 17+ -and they seem to be not needed to compile after all with llvm 17 -so add conditions to exclude them for llvm >= 17 - -Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23827] -Signed-off-by: Khem Raj - ---- - src/gallium/auxiliary/gallivm/lp_bld_init.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c -index cd2108f..b1a4d03 100644 ---- a/src/gallium/auxiliary/gallivm/lp_bld_init.c -+++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c -@@ -46,15 +46,19 @@ - #if GALLIVM_USE_NEW_PASS == 1 - #include - #elif GALLIVM_HAVE_CORO == 1 -+#if LLVM_VERSION_MAJOR < 17 - #include --#if LLVM_VERSION_MAJOR >= 7 -+#endif -+#if LLVM_VERSION_MAJOR >= 7 && LLVM_VERSION_MAJOR < 17 - #include - #endif - #if LLVM_VERSION_MAJOR <= 8 && (DETECT_ARCH_AARCH64 || DETECT_ARCH_ARM || DETECT_ARCH_S390 || DETECT_ARCH_MIPS64) - #include - #endif -+#if LLVM_VERSION_MAJOR < 17 - #include - #endif -+#endif - - unsigned gallivm_perf = 0; - diff --git a/meta-openeuler/recipes-graphics/mesa/files/0001-meson.build-check-for-all-linux-host_os-combinations.patch b/meta-openeuler/recipes-graphics/mesa/files/0001-meson.build-check-for-all-linux-host_os-combinations.patch index a555c5f865ceb1acc1e0951e96b0a0fbf8a7b3bc..7be7d81eeb72d2d8c7962a3647bbae724ff19014 100644 --- a/meta-openeuler/recipes-graphics/mesa/files/0001-meson.build-check-for-all-linux-host_os-combinations.patch +++ b/meta-openeuler/recipes-graphics/mesa/files/0001-meson.build-check-for-all-linux-host_os-combinations.patch @@ -1,4 +1,4 @@ -From b251af67df5a6840d2e9cc06edae2c387f8778f1 Mon Sep 17 00:00:00 2001 +From e8ec6b1cc5e401ba719095722d8b317d755ae613 Mon Sep 17 00:00:00 2001 From: Alistair Francis Date: Thu, 14 Nov 2019 13:04:49 -0800 Subject: [PATCH] meson.build: check for all linux host_os combinations @@ -14,30 +14,29 @@ Signed-off-by: Anuj Mittal Signed-off-by: Fabio Berton Signed-off-by: Otavio Salvador Signed-off-by: Alistair Francis - --- meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build -index 22385d8..15f48a6 100644 +index 133fd9a..817861e 100644 --- a/meson.build +++ b/meson.build -@@ -121,7 +121,7 @@ with_any_opengl = with_opengl or with_gles1 or with_gles2 +@@ -128,7 +128,7 @@ with_any_opengl = with_opengl or with_gles1 or with_gles2 # Only build shared_glapi if at least one OpenGL API is enabled with_shared_glapi = with_shared_glapi and with_any_opengl --system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'gnu/kfreebsd', 'dragonfly', 'linux', 'sunos', 'android'].contains(host_machine.system()) -+system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'gnu/kfreebsd', 'dragonfly', 'linux', 'sunos', 'android'].contains(host_machine.system()) or host_machine.system().startswith('linux') +-system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'gnu/kfreebsd', 'dragonfly', 'linux', 'sunos', 'android', 'managarm'].contains(host_machine.system()) ++system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'gnu/kfreebsd', 'dragonfly', 'linux', 'sunos', 'android', 'managarm'].contains(host_machine.system()) or host_machine.system().startswith('linux') gallium_drivers = get_option('gallium-drivers') if gallium_drivers.contains('auto') -@@ -909,7 +909,7 @@ if cc.has_function('fmemopen') +@@ -997,7 +997,7 @@ if cc.has_function('fmemopen') endif # TODO: this is very incomplete --if ['linux', 'cygwin', 'gnu', 'freebsd', 'gnu/kfreebsd', 'haiku', 'android'].contains(host_machine.system()) -+if ['linux', 'cygwin', 'gnu', 'freebsd', 'gnu/kfreebsd', 'haiku'].contains(host_machine.system()) or host_machine.system().startswith('linux') +-if ['linux', 'cygwin', 'gnu', 'freebsd', 'gnu/kfreebsd', 'haiku', 'android', 'managarm'].contains(host_machine.system()) ++if ['linux', 'cygwin', 'gnu', 'freebsd', 'gnu/kfreebsd', 'haiku', 'android', 'managarm'].contains(host_machine.system()) or host_machine.system().startswith('linux') pre_args += '-D_GNU_SOURCE' elif host_machine.system() == 'sunos' pre_args += '-D__EXTENSIONS__' diff --git a/meta-openeuler/recipes-graphics/mesa/files/0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch b/meta-openeuler/recipes-graphics/mesa/files/0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch new file mode 100644 index 0000000000000000000000000000000000000000..036a0b494539243e7850ba3ea24669e0749e2dd2 --- /dev/null +++ b/meta-openeuler/recipes-graphics/mesa/files/0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch @@ -0,0 +1,42 @@ +From 62495ebb977866c52d5bed8499a547c49f0d9bc1 Mon Sep 17 00:00:00 2001 +From: Romain Naour +Date: Tue, 6 Feb 2024 09:47:10 +0100 +Subject: [PATCH 2/2] glxext: don't try zink if not enabled in mesa + +Commit 7d9ea77b459 ("glx: add automatic zink fallback loading between hw and sw drivers") +added an automatic zink fallback even when the zink gallium is not +enabled at build time. + +It leads to unexpected error log while loading drisw driver and +zink is not installed on the rootfs: + + MESA-LOADER: failed to open zink: /usr/lib/dri/zink_dri.so + +Fixes: 7d9ea77b459 ("glx: add automatic zink fallback loading between hw and sw drivers") + +Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27478] +Signed-off-by: Romain Naour +Signed-off-by: Khem Raj +--- + src/glx/glxext.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/glx/glxext.c b/src/glx/glxext.c +index 05c825a..7a06aa9 100644 +--- a/src/glx/glxext.c ++++ b/src/glx/glxext.c +@@ -908,9 +908,11 @@ __glXInitialize(Display * dpy) + #endif /* HAVE_DRI3 */ + if (!debug_get_bool_option("LIBGL_DRI2_DISABLE", false)) + dpyPriv->dri2Display = dri2CreateDisplay(dpy); ++#if defined(HAVE_ZINK) + if (!dpyPriv->dri3Display && !dpyPriv->dri2Display) + try_zink = !debug_get_bool_option("LIBGL_KOPPER_DISABLE", false) && + !getenv("GALLIUM_DRIVER"); ++#endif /* HAVE_ZINK */ + } + #endif /* GLX_USE_DRM */ + if (glx_direct) +-- +2.44.0 + diff --git a/meta-openeuler/recipes-graphics/mesa/mesa-src.inc b/meta-openeuler/recipes-graphics/mesa/mesa-src.inc index f4225f314a018f44fd47750fda61f1ebc31df3ce..463b847d756fb134823c7d93589367be14b07cf4 100644 --- a/meta-openeuler/recipes-graphics/mesa/mesa-src.inc +++ b/meta-openeuler/recipes-graphics/mesa/mesa-src.inc @@ -1,10 +1,11 @@ OPENEULER_LOCAL_NAME = "mesa" -PV = "23.3.1" +PV = "24.0.3" SRC_URI:prepend = "file://mesa-${PV}.tar.xz \ file://backport-fix-build-err-on-arm.patch \ file://0001-changed_by_upstream_26018_orcjit_patch.patch \ file://0001-llvmpipe-add-loongarch64-basic-support.patch \ file://0002-llvmpipe-support-loongarch64-orcjit.patch \ + file://backport-pass-priv-instead-NULL-to-radeon_bo_can_reclaim.patch \ " diff --git a/meta-openeuler/recipes-graphics/mesa/mesa_23.3.1.bb b/meta-openeuler/recipes-graphics/mesa/mesa_23.3.1.bb deleted file mode 100644 index d17d9eb04bcd438702b1092456c1943ca7a7cc5f..0000000000000000000000000000000000000000 --- a/meta-openeuler/recipes-graphics/mesa/mesa_23.3.1.bb +++ /dev/null @@ -1 +0,0 @@ -require ${BPN}.inc diff --git a/meta-openeuler/recipes-graphics/mesa/mesa_24.0.3.bb b/meta-openeuler/recipes-graphics/mesa/mesa_24.0.3.bb new file mode 100644 index 0000000000000000000000000000000000000000..1c9fa66c72934848effea27f051d62b391a63e6e --- /dev/null +++ b/meta-openeuler/recipes-graphics/mesa/mesa_24.0.3.bb @@ -0,0 +1,368 @@ +SUMMARY = "A free implementation of the OpenGL API" +DESCRIPTION = "Mesa is an open-source implementation of the OpenGL specification - \ +a system for rendering interactive 3D graphics. \ +A variety of device drivers allows Mesa to be used in many different environments \ +ranging from software emulation to complete hardware acceleration for modern GPUs. \ +Mesa is used as part of the overall Direct Rendering Infrastructure and X.org \ +environment." + +HOMEPAGE = "http://mesa3d.org" +BUGTRACKER = "https://bugs.freedesktop.org" +SECTION = "x11" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://docs/license.rst;md5=63779ec98d78d823a9dc533a0735ef10" + +PE = "2" + +SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \ + file://0001-meson.build-check-for-all-linux-host_os-combinations.patch \ + file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \ + file://0001-drisw-fix-build-without-dri3.patch \ + file://0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch \ + file://0001-Revert-meson-do-not-pull-in-clc-for-clover.patch \ +" + +SRC_URI[sha256sum] = "77aec9a2a37b7d3596ea1640b3cc53d0b5d9b3b52abed89de07e3717e91bfdbe" + +UPSTREAM_CHECK_GITTAGREGEX = "mesa-(?P\d+(\.\d+)+)" + +#because we cannot rely on the fact that all apps will use pkgconfig, +#make eglplatform.h independent of MESA_EGL_NO_X11_HEADER +do_install:append() { + # sed can't find EGL/eglplatform.h as it doesn't get installed when glvnd enabled. + # So, check if EGL/eglplatform.h exists before running sed. + if ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'true', 'false', d)} && [ -f ${D}${includedir}/EGL/eglplatform.h ]; then + sed -i -e 's/^#elif defined(__unix__) && defined(EGL_NO_X11)$/#elif defined(__unix__) \&\& defined(EGL_NO_X11) || ${@bb.utils.contains('PACKAGECONFIG', 'x11', '0', '1', d)}/' ${D}${includedir}/EGL/eglplatform.h + fi +} + +DEPENDS = "expat makedepend-native flex-native bison-native libxml2-native zlib chrpath-replacement-native python3-mako-native gettext-native" +DEPENDS:append:class-target = " ${@bb.utils.contains('PACKAGECONFIG', 'opencl', 'mesa-native', '', d)}" +EXTRANATIVEPATH += "chrpath-native" +PROVIDES = " \ + ${@bb.utils.contains('PACKAGECONFIG', 'opengl', 'virtual/libgl', '', d)} \ + ${@bb.utils.contains('PACKAGECONFIG', 'glvnd', 'virtual/libglx', '', d)} \ + ${@bb.utils.contains('PACKAGECONFIG', 'gles', 'virtual/libgles1 virtual/libgles2 virtual/libgles3', '', d)} \ + ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'virtual/egl', '', d)} \ + ${@bb.utils.contains('PACKAGECONFIG', 'gbm', 'virtual/libgbm', '', d)} \ + virtual/mesa \ + " + +inherit meson pkgconfig python3native gettext features_check + +BBCLASSEXTEND = "native nativesdk" + +ANY_OF_DISTRO_FEATURES = "opengl vulkan" + +PLATFORMS ??= "${@bb.utils.filter('PACKAGECONFIG', 'x11 wayland', d)}" + +# set the MESA_BUILD_TYPE to either 'release' (default) or 'debug' +# by default the upstream mesa sources build a debug release +# here we assume the user will want a release build by default +MESA_BUILD_TYPE ?= "release" +def check_buildtype(d): + _buildtype = d.getVar('MESA_BUILD_TYPE') + if _buildtype not in ['release', 'debug']: + bb.fatal("unknown build type (%s), please set MESA_BUILD_TYPE to either 'release' or 'debug'" % _buildtype) + if _buildtype == 'debug': + return 'debugoptimized' + return 'plain' +MESON_BUILDTYPE = "${@check_buildtype(d)}" + +EXTRA_OEMESON = " \ + -Dshared-glapi=enabled \ + -Dglx-read-only-text=true \ + -Dplatforms='${@",".join("${PLATFORMS}".split())}' \ +" + +EXTRA_OEMESON:append:class-target = " ${@bb.utils.contains('PACKAGECONFIG', 'opencl', '-Dintel-clc=system', '', d)}" +EXTRA_OEMESON:append:class-native = " ${@bb.utils.contains('PACKAGECONFIG', 'opencl', '-Dintel-clc=enabled', '', d)}" + +def strip_comma(s): + return s.strip(',') + +PACKAGECONFIG = " \ + gallium \ + video-codecs \ + ${@bb.utils.filter('DISTRO_FEATURES', 'x11 vulkan wayland', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'opengl egl gles gbm virgl', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'dri3', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'x11 vulkan', 'dri3', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'vulkan', 'zink', '', d)} \ +" + +PACKAGECONFIG:append:class-native = "gallium-llvm r600" + +# "gbm" requires "opengl" +PACKAGECONFIG[gbm] = "-Dgbm=enabled,-Dgbm=disabled" + +X11_DEPS = "xorgproto virtual/libx11 libxext libxxf86vm libxdamage libxfixes xrandr" +# "x11" requires "opengl" +PACKAGECONFIG[x11] = ",-Dglx=disabled,${X11_DEPS}" +PACKAGECONFIG[wayland] = ",,wayland-native wayland libdrm wayland-protocols" + +PACKAGECONFIG[dri3] = "-Ddri3=enabled, -Ddri3=disabled, xorgproto libxshmfence" + +# Vulkan drivers need dri3 enabled +# amd could be enabled as well but requires gallium-llvm with llvm >= 3.9 +VULKAN_DRIVERS = "" +VULKAN_DRIVERS:append:x86 = ",intel,amd" +VULKAN_DRIVERS:append:x86-64 = ",intel,amd" +# i686 is a 32 bit override for mesa-native +VULKAN_DRIVERS:append:i686 = ",intel,amd" +VULKAN_DRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'freedreno', ',freedreno', '', d)}" +VULKAN_DRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'broadcom', ',broadcom', '', d)}" +VULKAN_DRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', ',swrast', '', d)}" +VULKAN_DRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'imagination', ',imagination-experimental', '', d)}" +PACKAGECONFIG[vulkan] = "-Dvulkan-drivers=${@strip_comma('${VULKAN_DRIVERS}')}, -Dvulkan-drivers='',glslang-native vulkan-loader vulkan-headers" + +# mesa development and testing tools support, per driver +TOOLS = "" +TOOLS_DEPS = "" +TOOLS:append = "${@bb.utils.contains('PACKAGECONFIG', 'etnaviv', ',etnaviv', '', d)}" +TOOLS:append = "${@bb.utils.contains('PACKAGECONFIG', 'freedreno', ',freedreno', '', d)}" +TOOLS:append = "${@bb.utils.contains('PACKAGECONFIG', 'lima', ',lima', '', d)}" +TOOLS:append = "${@bb.utils.contains('PACKAGECONFIG', 'panfrost', ',panfrost', '', d)}" +TOOLS:append = "${@bb.utils.contains('PACKAGECONFIG', 'imagination', ',imagination', '', d)}" + +# dependencies for tools. +TOOLS_DEPS:append = "${@bb.utils.contains('PACKAGECONFIG', 'freedreno', ' ncurses libxml2 ', '', d)}" + +# the fdperf tool requires libconfig (a part of meta-oe) so it needs special +# treatment in addition to the usual 'freedreno tools'. +PACKAGECONFIG[freedreno-fdperf] = ",,libconfig" + +PACKAGECONFIG[tools] = "-Dtools=${@strip_comma('${TOOLS}')}, -Dtools='', ${TOOLS_DEPS}" + +PACKAGECONFIG[opengl] = "-Dopengl=true, -Dopengl=false" +PACKAGECONFIG[glvnd] = "-Dglvnd=true, -Dglvnd=false, libglvnd" + +# "gles" requires "opengl" +PACKAGECONFIG[gles] = "-Dgles1=enabled -Dgles2=enabled, -Dgles1=disabled -Dgles2=disabled" + +# "egl" requires "opengl" +PACKAGECONFIG[egl] = "-Degl=enabled, -Degl=disabled" + +# "opencl" requires libclc from meta-clang and spirv-tools from OE-Core +OPENCL_NATIVE = "${@bb.utils.contains('PACKAGECONFIG', 'freedreno', '-Dopencl-native=true', '', d)}" +PACKAGECONFIG[opencl] = "-Dgallium-opencl=icd -Dopencl-spirv=true ${OPENCL_NATIVE},-Dgallium-opencl=disabled -Dopencl-spirv=false,libclc spirv-tools python3-ply-native" + +PACKAGECONFIG[broadcom] = "" +PACKAGECONFIG[etnaviv] = "" +PACKAGECONFIG[freedreno] = "" +PACKAGECONFIG[kmsro] = "" +PACKAGECONFIG[vc4] = "" +PACKAGECONFIG[v3d] = "" +PACKAGECONFIG[zink] = "" + +GALLIUMDRIVERS = "swrast" +# gallium swrast was found to crash Xorg on startup in x32 qemu +GALLIUMDRIVERS:x86-x32 = "" +GALLIUMDRIVERS:append:x86 = ",i915,iris,crocus" +GALLIUMDRIVERS:append:x86-64 = ",i915,iris,crocus" +# i686 is a 32 bit override for mesa-native +GALLIUMDRIVERS:append:i686 = ",i915,iris,crocus" + +GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'etnaviv', ',etnaviv', '', d)}" +GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'freedreno', ',freedreno', '', d)}" +GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'kmsro', ',kmsro', '', d)}" +GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'vc4', ',vc4', '', d)}" +GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'v3d', ',v3d', '', d)}" +GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'zink', ',zink', '', d)}" + +# radeonsi requires LLVM +GALLIUMDRIVERS_RADEONSI = "${@bb.utils.contains('PACKAGECONFIG', 'r600', ',radeonsi', '', d)}" +GALLIUMDRIVERS_LLVM = ",r300,nouveau${GALLIUMDRIVERS_RADEONSI}" +GALLIUMDRIVERS_LLVM:append:x86 = ",svga" +GALLIUMDRIVERS_LLVM:append:x86-64 = ",svga" +# i686 is a 32 bit override for mesa-native +GALLIUMDRIVERS_LLVM:append:i686 = ",svga" + +PACKAGECONFIG[r600] = "" +PACKAGECONFIG[virgl] = "" + +GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', '${GALLIUMDRIVERS_LLVM}', '', d)}" +GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'r600', ',r600', '', d)}" +GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'virgl', ',virgl', '', d)}" + +PACKAGECONFIG[gallium] = "-Dgallium-drivers=${@strip_comma('${GALLIUMDRIVERS}')}, -Dgallium-drivers='', libdrm" +PACKAGECONFIG[gallium-llvm] = "-Dllvm=enabled -Dshared-llvm=enabled, -Dllvm=disabled, llvm llvm-native elfutils" +PACKAGECONFIG[xa] = "-Dgallium-xa=enabled, -Dgallium-xa=disabled" +PACKAGECONFIG[va] = "-Dgallium-va=enabled,-Dgallium-va=disabled,libva-initial" +PACKAGECONFIG[vdpau] = "-Dgallium-vdpau=enabled,-Dgallium-vdpau=disabled,libvdpau" + +PACKAGECONFIG[imagination] = "-Dimagination-srv=true,-Dimagination-srv=false" + +PACKAGECONFIG[lima] = "" +GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'lima', ',lima', '', d)}" + +PACKAGECONFIG[panfrost] = "" +GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'panfrost', ',panfrost', '', d)}" + +PACKAGECONFIG[vulkan-beta] = "-Dvulkan-beta=true,-Dvulkan-beta=false" + +PACKAGECONFIG[osmesa] = "-Dosmesa=true,-Dosmesa=false" + +PACKAGECONFIG[perfetto] = "-Dperfetto=true,-Dperfetto=false,libperfetto" + +PACKAGECONFIG[unwind] = "-Dlibunwind=enabled,-Dlibunwind=disabled,libunwind" + +PACKAGECONFIG[lmsensors] = "-Dlmsensors=enabled,-Dlmsensors=disabled,lmsensors" + +VIDEO_CODECS ?= "${@bb.utils.contains('LICENSE_FLAGS_ACCEPTED', 'commercial', 'all', 'all_free', d)}" +PACKAGECONFIG[video-codecs] = "-Dvideo-codecs=${VIDEO_CODECS}, -Dvideo-codecs=''" + +# llvmpipe is slow if compiled with -fomit-frame-pointer (e.g. -O2) +FULL_OPTIMIZATION:append = " -fno-omit-frame-pointer" + +CFLAGS:append:armv5 = " -DMISSING_64BIT_ATOMICS" +CFLAGS:append:armv6 = " -DMISSING_64BIT_ATOMICS" + +# Remove the mesa dependency on mesa-dev, as mesa is empty +DEV_PKG_DEPENDENCY = "" + +# Khronos documentation says that include/GLES2/gl2ext.h can be used for +# OpenGL ES 3 specification as well as for OpenGL ES 2. +# There can be applications including GLES2/gl2ext.h instead of GLES3/gl3ext.h +# meaning we should probably bring in GLES2/gl2ext.h if someone asks for +# development package of libgles3. +RDEPENDS:libgles3-mesa-dev += "libgles2-mesa-dev" + +RDEPENDS:libopencl-mesa += "${@bb.utils.contains('PACKAGECONFIG', 'opencl', 'libclc spirv-tools', '', d)}" + +PACKAGES =+ "libegl-mesa libegl-mesa-dev \ + libosmesa libosmesa-dev \ + libgl-mesa libgl-mesa-dev \ + libglx-mesa libglx-mesa-dev \ + libglapi libglapi-dev \ + libgbm libgbm-dev \ + libgles1-mesa libgles1-mesa-dev \ + libgles2-mesa libgles2-mesa-dev \ + libgles3-mesa libgles3-mesa-dev \ + libopencl-mesa libopencl-mesa-dev \ + libxatracker libxatracker-dev \ + mesa-megadriver mesa-vulkan-drivers \ + mesa-vdpau-drivers mesa-tools \ + " + +do_install:append () { + # Drivers never need libtool .la files + rm -f ${D}${libdir}/dri/*.la + rm -f ${D}${libdir}/egl/*.la + rm -f ${D}${libdir}/gallium-pipe/*.la + rm -f ${D}${libdir}/gbm/*.la + + # libwayland-egl has been moved to wayland 1.15+ + rm -f ${D}${libdir}/libwayland-egl* + rm -f ${D}${libdir}/pkgconfig/wayland-egl.pc +} + +do_install:append:class-native () { + if ${@bb.utils.contains('PACKAGECONFIG', 'opencl', 'true', 'false', d)}; then + install -d ${D}${bindir} + install -m0755 ${B}/src/intel/compiler/intel_clc ${D}${bindir} + fi +} + +# For the packages that make up the OpenGL interfaces, inject variables so that +# they don't get Debian-renamed (which would remove the -mesa suffix), and +# RPROVIDEs/RCONFLICTs on the generic libgl name. +python __anonymous() { + pkgconfig = (d.getVar('PACKAGECONFIG') or "").split() + suffix = "" + if "-native" in d.getVar("PN"): + suffix = "-native" + for p in (("egl", "libegl", "libegl1"), + ("opengl", "libgl", "libgl1"), + ("glvnd", "libglx",), + ("gles", "libgles1", "libglesv1-cm1"), + ("gles", "libgles2", "libglesv2-2"), + ("gles", "libgles3",), + ("opencl", "libopencl",)): + if not p[0] in pkgconfig: + continue + mlprefix = d.getVar("MLPREFIX") + fullp = mlprefix + p[1] + "-mesa" + suffix + mlprefix = d.getVar("MLPREFIX") + pkgs = " " + " ".join(mlprefix + x + suffix for x in p[1:]) + d.setVar("DEBIAN_NOAUTONAME:" + fullp, "1") + d.appendVar("RREPLACES:" + fullp, pkgs) + d.appendVar("RPROVIDES:" + fullp, pkgs) + d.appendVar("RCONFLICTS:" + fullp, pkgs) + + d.appendVar("RRECOMMENDS:" + fullp, " ${MLPREFIX}mesa-megadriver" + suffix) + + # For -dev, the first element is both the Debian and original name + fullp = mlprefix + p[1] + "-mesa-dev" + suffix + pkgs = " " + mlprefix + p[1] + "-dev" + suffix + d.setVar("DEBIAN_NOAUTONAME:" + fullp, "1") + d.appendVar("RREPLACES:" + fullp, pkgs) + d.appendVar("RPROVIDES:" + fullp, pkgs) + d.appendVar("RCONFLICTS:" + fullp, pkgs) +} + +python mesa_populate_packages() { + pkgs = ['mesa', 'mesa-dev', 'mesa-dbg'] + for pkg in pkgs: + d.setVar("RPROVIDES:%s" % pkg, pkg.replace("mesa", "mesa-dri", 1)) + d.setVar("RCONFLICTS:%s" % pkg, pkg.replace("mesa", "mesa-dri", 1)) + d.setVar("RREPLACES:%s" % pkg, pkg.replace("mesa", "mesa-dri", 1)) + + import re + dri_drivers_root = oe.path.join(d.getVar('PKGD'), d.getVar('libdir'), "dri") + if os.path.isdir(dri_drivers_root): + dri_pkgs = sorted(os.listdir(dri_drivers_root)) + lib_name = d.expand("${MLPREFIX}mesa-megadriver") + for p in dri_pkgs: + m = re.match(r'^(.*)_dri\.so$', p) + if m: + pkg_name = " ${MLPREFIX}mesa-driver-%s" % legitimize_package_name(m.group(1)) + d.appendVar("RPROVIDES:%s" % lib_name, pkg_name) + d.appendVar("RCONFLICTS:%s" % lib_name, pkg_name) + d.appendVar("RREPLACES:%s" % lib_name, pkg_name) + + pipe_drivers_root = os.path.join(d.getVar('libdir'), "gallium-pipe") + do_split_packages(d, pipe_drivers_root, r'^pipe_(.*)\.so$', 'mesa-driver-pipe-%s', 'Mesa %s pipe driver', extra_depends='') +} + +PACKAGESPLITFUNCS =+ "mesa_populate_packages" + +PACKAGES_DYNAMIC += "^mesa-driver-.*" +PACKAGES_DYNAMIC:class-native = "^mesa-driver-.*-native" + +FILES:mesa-megadriver = "${libdir}/dri/* ${datadir}/drirc.d" +FILES:mesa-vulkan-drivers = "${libdir}/libvulkan_*.so ${libdir}/libpowervr_rogue.so ${datadir}/vulkan" +FILES:${PN}-vdpau-drivers = "${libdir}/vdpau/*.so.*" +FILES:libegl-mesa = "${libdir}/libEGL*.so.* ${datadir}/glvnd/egl_vendor.d" +FILES:libgbm = "${libdir}/libgbm.so.*" +FILES:libgles1-mesa = "${libdir}/libGLESv1*.so.*" +FILES:libgles2-mesa = "${libdir}/libGLESv2.so.*" +FILES:libgl-mesa = "${libdir}/libGL.so.*" +FILES:libglx-mesa = "${libdir}/libGLX*.so.*" +FILES:libopencl-mesa = "${libdir}/libMesaOpenCL.so.* ${libdir}/gallium-pipe/*.so ${sysconfdir}/OpenCL/vendors/mesa.icd" +FILES:libglapi = "${libdir}/libglapi.so.*" +FILES:libosmesa = "${libdir}/libOSMesa.so.*" +FILES:libxatracker = "${libdir}/libxatracker.so.*" + +FILES:${PN}-dev = "${libdir}/pkgconfig/dri.pc ${includedir}/vulkan ${libdir}/vdpau/*.so" +FILES:libegl-mesa-dev = "${libdir}/libEGL*.* ${includedir}/EGL ${includedir}/KHR ${libdir}/pkgconfig/egl.pc" +FILES:libgbm-dev = "${libdir}/libgbm.* ${libdir}/pkgconfig/gbm.pc ${includedir}/gbm.h" +FILES:libgl-mesa-dev = "${libdir}/libGL.* ${includedir}/GL ${libdir}/pkgconfig/gl.pc" +FILES:libglx-mesa-dev = "${libdir}/libGLX*.*" +FILES:libglapi-dev = "${libdir}/libglapi.*" +FILES:libgles1-mesa-dev = "${libdir}/libGLESv1*.* ${includedir}/GLES ${libdir}/pkgconfig/glesv1*.pc" +FILES:libgles2-mesa-dev = "${libdir}/libGLESv2.* ${includedir}/GLES2 ${libdir}/pkgconfig/glesv2.pc" +FILES:libgles3-mesa-dev = "${includedir}/GLES3" +FILES:libopencl-mesa-dev = "${libdir}/libMesaOpenCL.so" +FILES:libosmesa-dev = "${libdir}/libOSMesa.* ${includedir}/GL/osmesa.h ${libdir}/pkgconfig/osmesa.pc" +FILES:libxatracker-dev = "${libdir}/libxatracker.so ${libdir}/libxatracker.la \ + ${includedir}/xa_tracker.h ${includedir}/xa_composite.h ${includedir}/xa_context.h \ + ${libdir}/pkgconfig/xatracker.pc" +# catch all to get all the tools and data +FILES:${PN}-tools = "${bindir} ${datadir}" +ALLOW_EMPTY:${PN}-tools = "1" + +# Fix upgrade path from mesa to mesa-megadriver +RREPLACES:mesa-megadriver = "mesa" +RCONFLICTS:mesa-megadriver = "mesa" +RPROVIDES:mesa-megadriver = "mesa"