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