blob: 442479ae62cdd87c253b3d98076b524957215475 [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
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050027PACKAGECONFIG ??= "egl gles dri ${MESA_CRYPTO} \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050028 ${@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"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050035PACKAGECONFIG[wayland] = ",,wayland-native wayland"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050036
37DRIDRIVERS = "swrast"
38DRIDRIVERS_append_x86 = ",radeon,r200,nouveau,i965,i915"
39DRIDRIVERS_append_x86-64 = ",radeon,r200,nouveau,i965,i915"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050040PACKAGECONFIG[dri] = "--enable-dri --with-dri-drivers=${DRIDRIVERS} --enable-gbm, --disable-dri, dri2proto libdrm"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050041PACKAGECONFIG[dri3] = "--enable-dri3, --disable-dri3, dri3proto presentproto libxshmfence"
42
Patrick Williamsc124f4f2015-09-15 14:41:29 -050043PACKAGECONFIG[gles] = "--enable-gles1 --enable-gles2, --disable-gles1 --disable-gles2"
44
45EGL_PLATFORMS = "drm"
46EGL_PLATFORMS .="${@bb.utils.contains('PACKAGECONFIG', 'x11', ',x11', '', d)}"
47EGL_PLATFORMS .="${@bb.utils.contains('PACKAGECONFIG', 'wayland', ',wayland', '', d)}"
48PACKAGECONFIG[egl] = "--enable-egl --with-egl-platforms=${EGL_PLATFORMS}, --disable-egl"
49
50GALLIUMDRIVERS = "swrast"
51GALLIUMDRIVERS_LLVM33 = "${@bb.utils.contains('PACKAGECONFIG', 'r600', 'radeonsi,r600', '', d)}"
52PACKAGECONFIG[r600] = ""
53GALLIUMDRIVERS_LLVM33_ENABLED = "${@base_version_less_or_equal('MESA_LLVM_RELEASE', '3.2', False, len('${GALLIUMDRIVERS_LLVM33}') > 0, d)}"
54GALLIUMDRIVERS_LLVM = "r300,svga,nouveau${@',${GALLIUMDRIVERS_LLVM33}' if ${GALLIUMDRIVERS_LLVM33_ENABLED} else ''}"
55GALLIUMDRIVERS_append_x86 = "${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', ',${GALLIUMDRIVERS_LLVM}', '', d)}"
56GALLIUMDRIVERS_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
58PACKAGECONFIG[gallium] = "--with-gallium-drivers=${GALLIUMDRIVERS}, --without-gallium-drivers"
59MESA_LLVM_RELEASE ?= "3.3"
60PACKAGECONFIG[gallium-llvm] = "--enable-gallium-llvm --enable-llvm-shared-libs, --disable-gallium-llvm, llvm${MESA_LLVM_RELEASE} \
61 ${@'elfutils' if ${GALLIUMDRIVERS_LLVM33_ENABLED} else ''}"
62export WANT_LLVM_RELEASE = "${MESA_LLVM_RELEASE}"
63PACKAGECONFIG[xa] = "--enable-xa, --disable-xa"
64
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050065# Mesa requires one of the following crypto implementation, pick one of them
66MESA_CRYPTO ??= "openssl"
67PACKAGECONFIG[openssl] = "--with-sha1=libcrypto,,openssl"
68PACKAGECONFIG[nettle] = "--with-sha1=libnettle,,nettle"
69PACKAGECONFIG[gcrypt] = "--with-sha1=libgcrypt,,libgcrypt"
70
Patrick Williamsc124f4f2015-09-15 14:41:29 -050071# llvmpipe is slow if compiled with -fomit-frame-pointer (e.g. -O2)
72FULL_OPTIMIZATION_append = " -fno-omit-frame-pointer"
73
74# Multiple virtual/gl providers being built breaks staging
75EXCLUDE_FROM_WORLD = "1"
76
77# Remove the mesa dependency on mesa-dev, as mesa is empty
78RDEPENDS_${PN}-dev = ""
79
80PACKAGES =+ "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
94do_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.
108python __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 Williamsd8c66bc2016-06-20 12:57:21 -0500123
124 d.appendVar("RRECOMMENDS_" + fullp, " mesa-megadriver")
125
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500126 # 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
135python 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
158PACKAGESPLITFUNCS_prepend = "mesa_populate_packages "
159
160PACKAGES_DYNAMIC += "^mesa-driver-.*"
161
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500162FILES_${PN} += "${sysconfdir}/drirc"
163FILES_mesa-megadriver = "${libdir}/dri/*"
164FILES_libegl-mesa = "${libdir}/libEGL.so.*"
165FILES_libgbm = "${libdir}/libgbm.so.*"
166FILES_libgles1-mesa = "${libdir}/libGLESv1*.so.*"
167FILES_libgles2-mesa = "${libdir}/libGLESv2.so.*"
168FILES_libgl-mesa = "${libdir}/libGL.so.*"
169FILES_libglapi = "${libdir}/libglapi.so.*"
170FILES_libosmesa = "${libdir}/libOSMesa.so.*"
171FILES_libwayland-egl = "${libdir}/libwayland-egl.so.*"
172FILES_libxvmcsoftpipe = "${libdir}/libXvMCsoftpipe.so.*"
173FILES_libxatracker = "${libdir}/libxatracker.so.*"
174
175FILES_${PN}-dev = "${libdir}/pkgconfig/dri.pc"
176FILES_libegl-mesa-dev = "${libdir}/libEGL.* ${includedir}/EGL ${includedir}/KHR ${libdir}/pkgconfig/egl.pc"
177FILES_libgbm-dev = "${libdir}/libgbm.* ${libdir}/pkgconfig/gbm.pc ${includedir}/gbm.h"
178FILES_libgl-mesa-dev = "${libdir}/libGL.* ${includedir}/GL ${libdir}/pkgconfig/gl.pc"
179FILES_libglapi-dev = "${libdir}/libglapi.*"
180FILES_libgles1-mesa-dev = "${libdir}/libGLESv1*.* ${includedir}/GLES ${libdir}/pkgconfig/glesv1*.pc"
181FILES_libgles2-mesa-dev = "${libdir}/libGLESv2.* ${includedir}/GLES2 ${libdir}/pkgconfig/glesv2.pc"
182FILES_libgles3-mesa-dev = "${includedir}/GLES3"
183FILES_libosmesa-dev = "${libdir}/libOSMesa.* ${includedir}/osmesa.h ${libdir}/pkgconfig/osmesa.pc"
184FILES_libwayland-egl-dev = "${libdir}/pkgconfig/wayland-egl.pc ${libdir}/libwayland-egl.*"
185FILES_libxvmcsoftpipe-dev = "${libdir}/libXvMCsoftpipe.so ${libdir}/libXvMCsoftpipe.la"
186FILES_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"