Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "A free implementation of the OpenGL API" |
| 2 | DESCRIPTION = "Mesa is an open-source implementation of the OpenGL specification - \ |
| 3 | a system for rendering interactive 3D graphics. \ |
| 4 | A variety of device drivers allows Mesa to be used in many different environments \ |
| 5 | ranging from software emulation to complete hardware acceleration for modern GPUs. \ |
| 6 | Mesa is used as part of the overall Direct Rendering Infrastructure and X.org \ |
| 7 | environment." |
| 8 | |
| 9 | HOMEPAGE = "http://mesa3d.org" |
| 10 | BUGTRACKER = "https://bugs.freedesktop.org" |
| 11 | SECTION = "x11" |
| 12 | LICENSE = "MIT" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 13 | LIC_FILES_CHKSUM = "file://docs/license.html;md5=899fbe7e42d494c7c8c159c7001693d5" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 14 | |
| 15 | PE = "2" |
| 16 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 17 | DEPENDS = "expat makedepend-native flex-native bison-native libxml2-native" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 18 | |
| 19 | PROVIDES = "virtual/libgl virtual/libgles1 virtual/libgles2 virtual/egl virtual/mesa" |
| 20 | |
| 21 | inherit autotools pkgconfig pythonnative gettext distro_features_check |
| 22 | |
| 23 | REQUIRED_DISTRO_FEATURES = "opengl" |
| 24 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 25 | export LLVM_CONFIG = "${STAGING_BINDIR_CROSS}/llvm-config" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 26 | EXTRA_OECONF = "--enable-shared-glapi" |
| 27 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 28 | PACKAGECONFIG ??= "gbm egl gles dri \ |
| 29 | ${@bb.utils.filter('DISTRO_FEATURES', 'wayland x11', d)} \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 30 | " |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 31 | PACKAGECONFIG[gbm] = "--enable-gbm,--disable-gbm" |
| 32 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 33 | X11_DEPS = "xf86driproto glproto virtual/libx11 libxext libxxf86vm libxdamage libxfixes" |
| 34 | PACKAGECONFIG[x11] = "--enable-glx-tls,--disable-glx,${X11_DEPS}" |
| 35 | PACKAGECONFIG[xvmc] = "--enable-xvmc,--disable-xvmc,libxvmc" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 36 | PACKAGECONFIG[wayland] = ",,wayland-native wayland" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 37 | |
| 38 | DRIDRIVERS = "swrast" |
| 39 | DRIDRIVERS_append_x86 = ",radeon,r200,nouveau,i965,i915" |
| 40 | DRIDRIVERS_append_x86-64 = ",radeon,r200,nouveau,i965,i915" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 41 | PACKAGECONFIG[dri] = "--enable-dri --with-dri-drivers=${DRIDRIVERS}, --disable-dri, dri2proto libdrm" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 42 | PACKAGECONFIG[dri3] = "--enable-dri3, --disable-dri3, dri3proto presentproto libxshmfence" |
| 43 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 44 | # Vulkan drivers need dri3 enabled |
| 45 | # radeon could be enabled as well but requires gallium-llvm with llvm >= 3.9 |
| 46 | PACKAGECONFIG[vulkan] = "--with-vulkan-drivers=intel, --without-vulkan-drivers" |
| 47 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 48 | PACKAGECONFIG[gles] = "--enable-gles1 --enable-gles2, --disable-gles1 --disable-gles2" |
| 49 | |
| 50 | EGL_PLATFORMS = "drm" |
| 51 | EGL_PLATFORMS .="${@bb.utils.contains('PACKAGECONFIG', 'x11', ',x11', '', d)}" |
| 52 | EGL_PLATFORMS .="${@bb.utils.contains('PACKAGECONFIG', 'wayland', ',wayland', '', d)}" |
| 53 | PACKAGECONFIG[egl] = "--enable-egl --with-egl-platforms=${EGL_PLATFORMS}, --disable-egl" |
| 54 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 55 | PACKAGECONFIG[etnaviv] = "" |
| 56 | PACKAGECONFIG[imx] = "" |
| 57 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 58 | GALLIUMDRIVERS = "swrast" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 59 | GALLIUMDRIVERS_append ="${@bb.utils.contains('PACKAGECONFIG', 'etnaviv', ',etnaviv', '', d)}" |
| 60 | GALLIUMDRIVERS_append ="${@bb.utils.contains('PACKAGECONFIG', 'imx', ',imx', '', d)}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 61 | GALLIUMDRIVERS_LLVM33 = "${@bb.utils.contains('PACKAGECONFIG', 'r600', 'radeonsi,r600', '', d)}" |
| 62 | PACKAGECONFIG[r600] = "" |
| 63 | GALLIUMDRIVERS_LLVM33_ENABLED = "${@base_version_less_or_equal('MESA_LLVM_RELEASE', '3.2', False, len('${GALLIUMDRIVERS_LLVM33}') > 0, d)}" |
| 64 | GALLIUMDRIVERS_LLVM = "r300,svga,nouveau${@',${GALLIUMDRIVERS_LLVM33}' if ${GALLIUMDRIVERS_LLVM33_ENABLED} else ''}" |
| 65 | GALLIUMDRIVERS_append_x86 = "${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', ',${GALLIUMDRIVERS_LLVM}', '', d)}" |
| 66 | GALLIUMDRIVERS_append_x86-64 = "${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', ',${GALLIUMDRIVERS_LLVM}', '', d)}" |
| 67 | # keep --with-gallium-drivers separate, because when only one of gallium versions is enabled, other 2 were adding --without-gallium-drivers |
| 68 | PACKAGECONFIG[gallium] = "--with-gallium-drivers=${GALLIUMDRIVERS}, --without-gallium-drivers" |
| 69 | MESA_LLVM_RELEASE ?= "3.3" |
| 70 | PACKAGECONFIG[gallium-llvm] = "--enable-gallium-llvm --enable-llvm-shared-libs, --disable-gallium-llvm, llvm${MESA_LLVM_RELEASE} \ |
| 71 | ${@'elfutils' if ${GALLIUMDRIVERS_LLVM33_ENABLED} else ''}" |
| 72 | export WANT_LLVM_RELEASE = "${MESA_LLVM_RELEASE}" |
| 73 | PACKAGECONFIG[xa] = "--enable-xa, --disable-xa" |
| 74 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 75 | OSMESA = "${@bb.utils.contains('PACKAGECONFIG', 'gallium', 'gallium-osmesa', 'osmesa', d)}" |
| 76 | PACKAGECONFIG[osmesa] = "--enable-${OSMESA},--disable-${OSMESA}" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 77 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 78 | # llvmpipe is slow if compiled with -fomit-frame-pointer (e.g. -O2) |
| 79 | FULL_OPTIMIZATION_append = " -fno-omit-frame-pointer" |
| 80 | |
| 81 | # Multiple virtual/gl providers being built breaks staging |
| 82 | EXCLUDE_FROM_WORLD = "1" |
| 83 | |
| 84 | # Remove the mesa dependency on mesa-dev, as mesa is empty |
| 85 | RDEPENDS_${PN}-dev = "" |
| 86 | |
Brad Bishop | 37a0e4d | 2017-12-04 01:01:44 -0500 | [diff] [blame] | 87 | # Add dependency so that GLES3 header don't need to be added manually |
| 88 | RDEPENDS_libgles2-mesa-dev += "libgles3-mesa-dev" |
| 89 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 90 | PACKAGES =+ "libegl-mesa libegl-mesa-dev \ |
| 91 | libosmesa libosmesa-dev \ |
| 92 | libgl-mesa libgl-mesa-dev \ |
| 93 | libglapi libglapi-dev \ |
| 94 | libgbm libgbm-dev \ |
| 95 | libgles1-mesa libgles1-mesa-dev \ |
| 96 | libgles2-mesa libgles2-mesa-dev \ |
| 97 | libgles3-mesa libgles3-mesa-dev \ |
| 98 | libwayland-egl libwayland-egl-dev \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 99 | libxatracker libxatracker-dev \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 100 | mesa-megadriver mesa-vulkan-drivers \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 101 | " |
| 102 | |
| 103 | do_install_append () { |
| 104 | # Drivers never need libtool .la files |
| 105 | rm -f ${D}${libdir}/dri/*.la |
| 106 | rm -f ${D}${libdir}/egl/*.la |
| 107 | rm -f ${D}${libdir}/gallium-pipe/*.la |
| 108 | rm -f ${D}${libdir}/gbm/*.la |
| 109 | |
| 110 | # it was packaged in libdricore9.1.3-1 and preventing upgrades when debian.bbclass was used |
| 111 | rm -f ${D}${sysconfdir}/drirc |
| 112 | } |
| 113 | |
| 114 | # For the packages that make up the OpenGL interfaces, inject variables so that |
| 115 | # they don't get Debian-renamed (which would remove the -mesa suffix), and |
| 116 | # RPROVIDEs/RCONFLICTs on the generic libgl name. |
| 117 | python __anonymous() { |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 118 | pkgconfig = (d.getVar('PACKAGECONFIG') or "").split() |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 119 | for p in (("egl", "libegl", "libegl1"), |
| 120 | ("dri", "libgl", "libgl1"), |
| 121 | ("gles", "libgles1", "libglesv1-cm1"), |
| 122 | ("gles", "libgles2", "libglesv2-2"), |
| 123 | ("gles", "libgles3",)): |
| 124 | if not p[0] in pkgconfig: |
| 125 | continue |
| 126 | fullp = p[1] + "-mesa" |
| 127 | pkgs = " ".join(p[1:]) |
| 128 | d.setVar("DEBIAN_NOAUTONAME_" + fullp, "1") |
| 129 | d.appendVar("RREPLACES_" + fullp, pkgs) |
| 130 | d.appendVar("RPROVIDES_" + fullp, pkgs) |
| 131 | d.appendVar("RCONFLICTS_" + fullp, pkgs) |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 132 | |
| 133 | d.appendVar("RRECOMMENDS_" + fullp, " mesa-megadriver") |
| 134 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 135 | # For -dev, the first element is both the Debian and original name |
| 136 | fullp += "-dev" |
| 137 | pkgs = p[1] + "-dev" |
| 138 | d.setVar("DEBIAN_NOAUTONAME_" + fullp, "1") |
| 139 | d.appendVar("RREPLACES_" + fullp, pkgs) |
| 140 | d.appendVar("RPROVIDES_" + fullp, pkgs) |
| 141 | d.appendVar("RCONFLICTS_" + fullp, pkgs) |
| 142 | } |
| 143 | |
| 144 | python mesa_populate_packages() { |
| 145 | pkgs = ['mesa', 'mesa-dev', 'mesa-dbg'] |
| 146 | for pkg in pkgs: |
| 147 | d.setVar("RPROVIDES_%s" % pkg, pkg.replace("mesa", "mesa-dri", 1)) |
| 148 | d.setVar("RCONFLICTS_%s" % pkg, pkg.replace("mesa", "mesa-dri", 1)) |
| 149 | d.setVar("RREPLACES_%s" % pkg, pkg.replace("mesa", "mesa-dri", 1)) |
| 150 | |
| 151 | import re |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 152 | dri_drivers_root = oe.path.join(d.getVar('PKGD'), d.getVar('libdir'), "dri") |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 153 | if os.path.isdir(dri_drivers_root): |
| 154 | dri_pkgs = os.listdir(dri_drivers_root) |
| 155 | lib_name = d.expand("${MLPREFIX}mesa-megadriver") |
| 156 | for p in dri_pkgs: |
| 157 | m = re.match('^(.*)_dri\.so$', p) |
| 158 | if m: |
| 159 | pkg_name = " ${MLPREFIX}mesa-driver-%s" % legitimize_package_name(m.group(1)) |
| 160 | d.appendVar("RPROVIDES_%s" % lib_name, pkg_name) |
| 161 | d.appendVar("RCONFLICTS_%s" % lib_name, pkg_name) |
| 162 | d.appendVar("RREPLACES_%s" % lib_name, pkg_name) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 163 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 164 | pipe_drivers_root = os.path.join(d.getVar('libdir'), "gallium-pipe") |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 165 | do_split_packages(d, pipe_drivers_root, '^pipe_(.*)\.so$', 'mesa-driver-pipe-%s', 'Mesa %s pipe driver', extra_depends='') |
| 166 | } |
| 167 | |
| 168 | PACKAGESPLITFUNCS_prepend = "mesa_populate_packages " |
| 169 | |
| 170 | PACKAGES_DYNAMIC += "^mesa-driver-.*" |
| 171 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 172 | FILES_${PN} += "${sysconfdir}/drirc" |
| 173 | FILES_mesa-megadriver = "${libdir}/dri/*" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 174 | FILES_mesa-vulkan-drivers = "${libdir}/libvulkan_*.so ${datadir}/vulkan" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 175 | FILES_libegl-mesa = "${libdir}/libEGL.so.*" |
| 176 | FILES_libgbm = "${libdir}/libgbm.so.*" |
| 177 | FILES_libgles1-mesa = "${libdir}/libGLESv1*.so.*" |
| 178 | FILES_libgles2-mesa = "${libdir}/libGLESv2.so.*" |
| 179 | FILES_libgl-mesa = "${libdir}/libGL.so.*" |
| 180 | FILES_libglapi = "${libdir}/libglapi.so.*" |
| 181 | FILES_libosmesa = "${libdir}/libOSMesa.so.*" |
| 182 | FILES_libwayland-egl = "${libdir}/libwayland-egl.so.*" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 183 | FILES_libxatracker = "${libdir}/libxatracker.so.*" |
| 184 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 185 | FILES_${PN}-dev = "${libdir}/pkgconfig/dri.pc ${includedir}/vulkan" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 186 | FILES_libegl-mesa-dev = "${libdir}/libEGL.* ${includedir}/EGL ${includedir}/KHR ${libdir}/pkgconfig/egl.pc" |
| 187 | FILES_libgbm-dev = "${libdir}/libgbm.* ${libdir}/pkgconfig/gbm.pc ${includedir}/gbm.h" |
| 188 | FILES_libgl-mesa-dev = "${libdir}/libGL.* ${includedir}/GL ${libdir}/pkgconfig/gl.pc" |
| 189 | FILES_libglapi-dev = "${libdir}/libglapi.*" |
| 190 | FILES_libgles1-mesa-dev = "${libdir}/libGLESv1*.* ${includedir}/GLES ${libdir}/pkgconfig/glesv1*.pc" |
| 191 | FILES_libgles2-mesa-dev = "${libdir}/libGLESv2.* ${includedir}/GLES2 ${libdir}/pkgconfig/glesv2.pc" |
| 192 | FILES_libgles3-mesa-dev = "${includedir}/GLES3" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 193 | FILES_libosmesa-dev = "${libdir}/libOSMesa.* ${includedir}/GL/osmesa.h ${libdir}/pkgconfig/osmesa.pc" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 194 | FILES_libwayland-egl-dev = "${libdir}/pkgconfig/wayland-egl.pc ${libdir}/libwayland-egl.*" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 195 | FILES_libxatracker-dev = "${libdir}/libxatracker.so ${libdir}/libxatracker.la \ |
| 196 | ${includedir}/xa_tracker.h ${includedir}/xa_composite.h ${includedir}/xa_context.h \ |
| 197 | ${libdir}/pkgconfig/xatracker.pc" |