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