diff options
| author | Fabio Berton <fabio.berton@ossystems.com.br> | 2019-05-15 18:22:43 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-05-16 09:16:50 +0100 |
| commit | e47715708729fe3fed2c5bcafa06f5f1c84f302f (patch) | |
| tree | 708f428a746a6be67482f0b0bb2640a8b40d5b3a /meta/recipes-graphics/mesa/mesa.inc | |
| parent | 9095dc153a760a4336260419aa2298fad8d7d031 (diff) | |
| download | poky-e47715708729fe3fed2c5bcafa06f5f1c84f302f.tar.gz | |
mesa: Convert recipe to use meson build system
- Remove all non related meson patches
- Change radeon driver to r100
- Add python3-mako-native gettext-native to DEPENDS
Based on https://patchwork.openembedded.org/patch/158748/
Alex: added a patch to restore glx-tls option, which
addresses the musl runtime issue.
(From OE-Core rev: c72b6d46d392bfbcf54154f43663a7a8ada8c567)
Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-graphics/mesa/mesa.inc')
| -rw-r--r-- | meta/recipes-graphics/mesa/mesa.inc | 64 |
1 files changed, 31 insertions, 33 deletions
diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc index ece74974b5..c52adbbb21 100644 --- a/meta/recipes-graphics/mesa/mesa.inc +++ b/meta/recipes-graphics/mesa/mesa.inc | |||
| @@ -14,7 +14,7 @@ LIC_FILES_CHKSUM = "file://docs/license.html;md5=725f991a1cc322aa7a0cd3a2016621c | |||
| 14 | 14 | ||
| 15 | PE = "2" | 15 | PE = "2" |
| 16 | 16 | ||
| 17 | DEPENDS = "expat makedepend-native flex-native bison-native libxml2-native zlib chrpath-replacement-native" | 17 | DEPENDS = "expat makedepend-native flex-native bison-native libxml2-native zlib chrpath-replacement-native python3-mako-native gettext-native" |
| 18 | EXTRANATIVEPATH += "chrpath-native" | 18 | EXTRANATIVEPATH += "chrpath-native" |
| 19 | PROVIDES = " \ | 19 | PROVIDES = " \ |
| 20 | ${@bb.utils.contains('PACKAGECONFIG', 'opengl', 'virtual/libgl', '', d)} \ | 20 | ${@bb.utils.contains('PACKAGECONFIG', 'opengl', 'virtual/libgl', '', d)} \ |
| @@ -24,7 +24,7 @@ PROVIDES = " \ | |||
| 24 | virtual/mesa \ | 24 | virtual/mesa \ |
| 25 | " | 25 | " |
| 26 | 26 | ||
| 27 | inherit autotools pkgconfig python3native gettext distro_features_check | 27 | inherit meson pkgconfig python3native gettext distro_features_check |
| 28 | 28 | ||
| 29 | BBCLASSEXTEND = "native nativesdk" | 29 | BBCLASSEXTEND = "native nativesdk" |
| 30 | 30 | ||
| @@ -34,57 +34,59 @@ PLATFORMS ??= "${@bb.utils.filter('PACKAGECONFIG', 'x11 wayland', d)} \ | |||
| 34 | ${@bb.utils.contains('PACKAGECONFIG', 'gbm', 'drm', '', d)} \ | 34 | ${@bb.utils.contains('PACKAGECONFIG', 'gbm', 'drm', '', d)} \ |
| 35 | surfaceless" | 35 | surfaceless" |
| 36 | 36 | ||
| 37 | export LLVM_CONFIG = "${STAGING_BINDIR_NATIVE}/llvm-config${MESA_LLVM_RELEASE}" | ||
| 38 | export YOCTO_ALTERNATE_EXE_PATH = "${STAGING_LIBDIR}/llvm${MESA_LLVM_RELEASE}/llvm-config" | 37 | export YOCTO_ALTERNATE_EXE_PATH = "${STAGING_LIBDIR}/llvm${MESA_LLVM_RELEASE}/llvm-config" |
| 39 | export YOCTO_ALTERNATE_MULTILIB_NAME = "${base_libdir}" | 38 | export YOCTO_ALTERNATE_MULTILIB_NAME = "${base_libdir}" |
| 40 | EXTRA_OECONF = "--enable-shared-glapi \ | 39 | |
| 41 | --disable-opencl \ | 40 | EXTRA_OEMESON = " \ |
| 42 | --enable-glx-read-only-text \ | 41 | -Dshared-glapi=true \ |
| 43 | PYTHON2=python2 \ | 42 | -Dgallium-opencl=disabled \ |
| 44 | --with-llvm-prefix=${STAGING_LIBDIR}/llvm${MESA_LLVM_RELEASE} \ | 43 | -Dglx-read-only-text=true \ |
| 45 | --with-platforms='${PLATFORMS}' \ | 44 | -Dplatforms='${@",".join("${PLATFORMS}".split())}' \ |
| 46 | --enable-autotools \ | ||
| 47 | " | 45 | " |
| 48 | 46 | ||
| 49 | PACKAGECONFIG_class-target ??= "${@bb.utils.filter('DISTRO_FEATURES', 'wayland vulkan', d)} \ | 47 | PACKAGECONFIG_class-target ??= "${@bb.utils.filter('DISTRO_FEATURES', 'wayland vulkan', d)} \ |
| 50 | ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'opengl egl gles gbm dri gallium', '', d)} \ | 48 | ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'opengl egl gles gbm dri gallium', '', d)} \ |
| 51 | ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'x11 dri3', '', d)} \ | 49 | ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'x11 dri3', '', d)} \ |
| 52 | ${@bb.utils.contains('DISTRO_FEATURES', 'x11 vulkan', 'dri3', '', d)} \ | 50 | ${@bb.utils.contains('DISTRO_FEATURES', 'x11 vulkan', 'dri3', '', d)} \ |
| 51 | glx-tls \ | ||
| 53 | " | 52 | " |
| 54 | PACKAGECONFIG_class-native ?= "gbm dri egl opengl" | 53 | PACKAGECONFIG_class-native ?= "gbm dri egl opengl" |
| 55 | PACKAGECONFIG_class-nativesdk ?= "gbm dri egl opengl" | 54 | PACKAGECONFIG_class-nativesdk ?= "gbm dri egl opengl" |
| 56 | 55 | ||
| 56 | PACKAGECONFIG_remove_libc-musl = "glx-tls" | ||
| 57 | |||
| 57 | # "gbm" requires "dri", "opengl" | 58 | # "gbm" requires "dri", "opengl" |
| 58 | PACKAGECONFIG[gbm] = "--enable-gbm,--disable-gbm" | 59 | PACKAGECONFIG[gbm] = "-Dgbm=true,-Dgbm=false" |
| 59 | 60 | ||
| 60 | X11_DEPS = "xorgproto virtual/libx11 libxext libxxf86vm libxdamage libxfixes xrandr" | 61 | X11_DEPS = "xorgproto virtual/libx11 libxext libxxf86vm libxdamage libxfixes xrandr" |
| 61 | # "x11" requires "opengl" | 62 | # "x11" requires "opengl" |
| 62 | PACKAGECONFIG[x11] = "--enable-glx-tls,--disable-glx,${X11_DEPS}" | 63 | PACKAGECONFIG[x11] = ",-Dglx=disabled,${X11_DEPS}" |
| 63 | PACKAGECONFIG[xvmc] = "--enable-xvmc,--disable-xvmc,libxvmc" | 64 | PACKAGECONFIG[glx-tls] = "-Dglx-tls=true, -Dglx-tls=false" |
| 65 | PACKAGECONFIG[xvmc] = "-Dgallium-xvmc=true,-Dgallium-xvmc=false,libxvmc" | ||
| 64 | PACKAGECONFIG[wayland] = ",,wayland-native wayland libdrm wayland-protocols" | 66 | PACKAGECONFIG[wayland] = ",,wayland-native wayland libdrm wayland-protocols" |
| 65 | 67 | ||
| 66 | DRIDRIVERS_class-native = "swrast" | 68 | DRIDRIVERS_class-native = "swrast" |
| 67 | DRIDRIVERS_class-nativesdk = "swrast" | 69 | DRIDRIVERS_class-nativesdk = "swrast" |
| 68 | DRIDRIVERS_append_x86_class-target = ",radeon,r200,nouveau,i965,i915" | 70 | DRIDRIVERS_append_x86_class-target = ",r100,r200,nouveau,i965,i915" |
| 69 | DRIDRIVERS_append_x86-64_class-target = ",radeon,r200,nouveau,i965,i915" | 71 | DRIDRIVERS_append_x86-64_class-target = ",r100,r200,nouveau,i965,i915" |
| 70 | # "dri" requires "opengl" | 72 | # "dri" requires "opengl" |
| 71 | PACKAGECONFIG[dri] = "--enable-dri --with-dri-drivers=${DRIDRIVERS}, --disable-dri, xorgproto libdrm" | 73 | PACKAGECONFIG[dri] = "-Ddri-drivers=${DRIDRIVERS}, -Ddri-drivers='', xorgproto libdrm" |
| 72 | PACKAGECONFIG[dri3] = "--enable-dri3, --disable-dri3, xorgproto libxshmfence" | 74 | PACKAGECONFIG[dri3] = "-Ddri3=true, -Ddri3=false, xorgproto libxshmfence" |
| 73 | 75 | ||
| 74 | # Vulkan drivers need dri3 enabled | 76 | # Vulkan drivers need dri3 enabled |
| 75 | # radeon could be enabled as well but requires gallium-llvm with llvm >= 3.9 | 77 | # radeon could be enabled as well but requires gallium-llvm with llvm >= 3.9 |
| 76 | VULKAN_DRIVERS = "" | 78 | VULKAN_DRIVERS = "" |
| 77 | VULKAN_DRIVERS_append_x86_class-target = ",intel" | 79 | VULKAN_DRIVERS_append_x86_class-target = ",intel" |
| 78 | VULKAN_DRIVERS_append_x86-64_class-target = ",intel" | 80 | VULKAN_DRIVERS_append_x86-64_class-target = ",intel" |
| 79 | PACKAGECONFIG[vulkan] = "--with-vulkan-drivers=${VULKAN_DRIVERS}, --without-vulkan-drivers, python3-mako-native" | 81 | PACKAGECONFIG[vulkan] = "-Dvulkan-drivers=${VULKAN_DRIVERS}, -Dvulkan-drivers=''," |
| 80 | 82 | ||
| 81 | PACKAGECONFIG[opengl] = "--enable-opengl, --disable-opengl" | 83 | PACKAGECONFIG[opengl] = "-Dopengl=true, -Dopengl=false" |
| 82 | 84 | ||
| 83 | # "gles" requires "opengl" | 85 | # "gles" requires "opengl" |
| 84 | PACKAGECONFIG[gles] = "--enable-gles1 --enable-gles2, --disable-gles1 --disable-gles2" | 86 | PACKAGECONFIG[gles] = "-Dgles1=true -Dgles2=true, -Dgles1=false -Dgles2=false" |
| 85 | 87 | ||
| 86 | # "egl" requires "dri", "opengl" | 88 | # "egl" requires "dri", "opengl" |
| 87 | PACKAGECONFIG[egl] = "--enable-egl, --disable-egl" | 89 | PACKAGECONFIG[egl] = "-Degl=true, -Degl=false" |
| 88 | 90 | ||
| 89 | PACKAGECONFIG[etnaviv] = "" | 91 | PACKAGECONFIG[etnaviv] = "" |
| 90 | PACKAGECONFIG[imx] = "" | 92 | PACKAGECONFIG[imx] = "" |
| @@ -104,28 +106,25 @@ GALLIUMDRIVERS_append = "${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', ' | |||
| 104 | GALLIUMDRIVERS_append = "${@bb.utils.contains('PACKAGECONFIG', 'r600', ',r600', '', d)}" | 106 | GALLIUMDRIVERS_append = "${@bb.utils.contains('PACKAGECONFIG', 'r600', ',r600', '', d)}" |
| 105 | GALLIUMDRIVERS_append = ",virgl" | 107 | GALLIUMDRIVERS_append = ",virgl" |
| 106 | 108 | ||
| 107 | # keep --with-gallium-drivers separate, because when only one of gallium versions is enabled, other 2 were adding --without-gallium-drivers | 109 | PACKAGECONFIG[gallium] = "-Dgallium-drivers=${GALLIUMDRIVERS}, -Dgallium-drivers=''" |
| 108 | PACKAGECONFIG[gallium] = "--with-gallium-drivers=${GALLIUMDRIVERS}, --without-gallium-drivers" | ||
| 109 | MESA_LLVM_RELEASE ?= "8.0.0" | 110 | MESA_LLVM_RELEASE ?= "8.0.0" |
| 110 | PACKAGECONFIG[gallium-llvm] = "--enable-llvm --enable-llvm-shared-libs, --disable-llvm, llvm${MESA_LLVM_RELEASE} llvm-native \ | 111 | PACKAGECONFIG[gallium-llvm] = "-Dllvm=true -Dshared-llvm=true, -Dllvm=false, llvm${MESA_LLVM_RELEASE} llvm-native \ |
| 111 | ${@'elfutils' if ${GALLIUMDRIVERS_LLVM33_ENABLED} else ''}" | 112 | ${@'elfutils' if ${GALLIUMDRIVERS_LLVM33_ENABLED} else ''}" |
| 112 | export WANT_LLVM_RELEASE = "${MESA_LLVM_RELEASE}" | 113 | export WANT_LLVM_RELEASE = "${MESA_LLVM_RELEASE}" |
| 113 | PACKAGECONFIG[xa] = "--enable-xa, --disable-xa" | 114 | PACKAGECONFIG[xa] = "-Dgallium-xa=true, -Dgallium-xa=false" |
| 114 | 115 | ||
| 115 | OSMESA = "${@bb.utils.contains('PACKAGECONFIG', 'gallium', 'gallium-osmesa', 'osmesa', d)}" | 116 | OSMESA = "${@bb.utils.contains('PACKAGECONFIG', 'gallium', 'gallium', 'classic', d)}" |
| 116 | PACKAGECONFIG[osmesa] = "--enable-${OSMESA},--disable-${OSMESA}" | 117 | PACKAGECONFIG[osmesa] = "-Dosmesa=${OSMESA},-Dosmesa=none" |
| 117 | 118 | ||
| 118 | PACKAGECONFIG[unwind] = "--enable-libunwind,--disable-libunwind,libunwind" | 119 | PACKAGECONFIG[unwind] = "-Dlibunwind=true,-Dlibunwind=false,libunwind" |
| 119 | 120 | ||
| 120 | EXTRA_OECONF_remove_libc-musl = "--enable-glx-tls" | 121 | # mesa tries to run cross-built gen_matypes on build machine to get struct size information |
| 121 | EXTRA_OECONF_append_libc-musl = " --disable-glx-tls" | 122 | EXTRA_OEMESON_append = " -Dasm=false" |
| 122 | EXTRA_OECONF_append_libc-musl_x86 = " --disable-asm" | ||
| 123 | 123 | ||
| 124 | # llvmpipe is slow if compiled with -fomit-frame-pointer (e.g. -O2) | 124 | # llvmpipe is slow if compiled with -fomit-frame-pointer (e.g. -O2) |
| 125 | FULL_OPTIMIZATION_append = " -fno-omit-frame-pointer" | 125 | FULL_OPTIMIZATION_append = " -fno-omit-frame-pointer" |
| 126 | 126 | ||
| 127 | CFLAGS_append_armv5 = " -DMISSING_64BIT_ATOMICS" | 127 | CFLAGS_append_armv5 = " -DMISSING_64BIT_ATOMICS" |
| 128 | EXTRA_OEMAKE += "WAYLAND_PROTOCOLS_DATADIR=${STAGING_DATADIR}/wayland-protocols" | ||
| 129 | 128 | ||
| 130 | # Remove the mesa dependency on mesa-dev, as mesa is empty | 129 | # Remove the mesa dependency on mesa-dev, as mesa is empty |
| 131 | RDEPENDS_${PN}-dev = "" | 130 | RDEPENDS_${PN}-dev = "" |
| @@ -158,7 +157,6 @@ do_install_append () { | |||
| 158 | # libwayland-egl has been moved to wayland 1.15+ | 157 | # libwayland-egl has been moved to wayland 1.15+ |
| 159 | rm -f ${D}${libdir}/libwayland-egl* | 158 | rm -f ${D}${libdir}/libwayland-egl* |
| 160 | rm -f ${D}${libdir}/pkgconfig/wayland-egl.pc | 159 | rm -f ${D}${libdir}/pkgconfig/wayland-egl.pc |
| 161 | rmdir --ignore-fail-on-non-empty ${D}${libdir}/pkgconfig | ||
| 162 | } | 160 | } |
| 163 | 161 | ||
| 164 | # For the packages that make up the OpenGL interfaces, inject variables so that | 162 | # For the packages that make up the OpenGL interfaces, inject variables so that |
