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