diff options
Diffstat (limited to 'meta-intel-extras/recipes/mesa/mesa.inc')
-rw-r--r-- | meta-intel-extras/recipes/mesa/mesa.inc | 233 |
1 files changed, 0 insertions, 233 deletions
diff --git a/meta-intel-extras/recipes/mesa/mesa.inc b/meta-intel-extras/recipes/mesa/mesa.inc deleted file mode 100644 index 0219ded..0000000 --- a/meta-intel-extras/recipes/mesa/mesa.inc +++ /dev/null | |||
@@ -1,233 +0,0 @@ | |||
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=725f991a1cc322aa7a0cd3a2016621c4" | ||
14 | |||
15 | PE = "2" | ||
16 | |||
17 | DEPENDS = "expat makedepend-native flex-native bison-native libxml2-native zlib chrpath-replacement-native" | ||
18 | EXTRANATIVEPATH += "chrpath-native" | ||
19 | PROVIDES = " \ | ||
20 | ${@bb.utils.contains('PACKAGECONFIG', 'opengl', 'virtual/libgl', '', d)} \ | ||
21 | ${@bb.utils.contains('PACKAGECONFIG', 'gles', 'virtual/libgles1 virtual/libgles2', '', d)} \ | ||
22 | ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'virtual/egl', '', d)} \ | ||
23 | ${@bb.utils.contains('PACKAGECONFIG', 'gbm', 'virtual/libgbm', '', d)} \ | ||
24 | virtual/mesa \ | ||
25 | " | ||
26 | |||
27 | inherit autotools pkgconfig python3native gettext distro_features_check | ||
28 | |||
29 | ANY_OF_DISTRO_FEATURES = "opengl vulkan" | ||
30 | |||
31 | PLATFORMS ??= "${@bb.utils.filter('PACKAGECONFIG', 'x11 wayland', d)} \ | ||
32 | ${@bb.utils.contains('PACKAGECONFIG', 'gbm', 'drm', '', d)} \ | ||
33 | surfaceless" | ||
34 | |||
35 | export LLVM_CONFIG = "${STAGING_BINDIR_NATIVE}/llvm-config${MESA_LLVM_RELEASE}" | ||
36 | export YOCTO_ALTERNATE_EXE_PATH = "${STAGING_LIBDIR}/llvm${MESA_LLVM_RELEASE}/llvm-config" | ||
37 | export YOCTO_ALTERNATE_MULTILIB_NAME = "${base_libdir}" | ||
38 | EXTRA_OECONF = "--enable-shared-glapi \ | ||
39 | --disable-opencl \ | ||
40 | --enable-glx-read-only-text \ | ||
41 | PYTHON2=python2 \ | ||
42 | --with-llvm-prefix=${STAGING_LIBDIR}/llvm${MESA_LLVM_RELEASE} \ | ||
43 | --with-platforms='${PLATFORMS}'" | ||
44 | |||
45 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'wayland vulkan', d)} \ | ||
46 | ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'opengl egl gles gbm dri', '', d)} \ | ||
47 | ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'x11 dri3', '', d)} \ | ||
48 | ${@bb.utils.contains('DISTRO_FEATURES', 'x11 vulkan', 'dri3', '', d)} \ | ||
49 | " | ||
50 | |||
51 | # "gbm" requires "dri", "opengl" | ||
52 | PACKAGECONFIG[gbm] = "--enable-gbm,--disable-gbm" | ||
53 | |||
54 | X11_DEPS = "xf86driproto glproto virtual/libx11 libxext libxxf86vm libxdamage libxfixes" | ||
55 | # "x11" requires "opengl" | ||
56 | PACKAGECONFIG[x11] = "--enable-glx-tls,--disable-glx,${X11_DEPS}" | ||
57 | PACKAGECONFIG[xvmc] = "--enable-xvmc,--disable-xvmc,libxvmc" | ||
58 | PACKAGECONFIG[wayland] = ",,wayland-native wayland libdrm wayland-protocols" | ||
59 | |||
60 | DRIDRIVERS = "swrast" | ||
61 | DRIDRIVERS_append_x86 = ",radeon,r200,nouveau,i965,i915" | ||
62 | DRIDRIVERS_append_x86-64 = ",radeon,r200,nouveau,i965,i915" | ||
63 | # "dri" requires "opengl" | ||
64 | PACKAGECONFIG[dri] = "--enable-dri --with-dri-drivers=${DRIDRIVERS}, --disable-dri, dri2proto libdrm" | ||
65 | PACKAGECONFIG[dri3] = "--enable-dri3, --disable-dri3, dri3proto presentproto libxshmfence" | ||
66 | |||
67 | # Vulkan drivers need dri3 enabled | ||
68 | # radeon could be enabled as well but requires gallium-llvm with llvm >= 3.9 | ||
69 | VULKAN_DRIVERS = "" | ||
70 | VULKAN_DRIVERS_append_x86 = ",intel" | ||
71 | VULKAN_DRIVERS_append_x86-64 = ",intel" | ||
72 | PACKAGECONFIG[vulkan] = "--with-vulkan-drivers=${VULKAN_DRIVERS}, --without-vulkan-drivers, python3-mako-native" | ||
73 | |||
74 | PACKAGECONFIG[opengl] = "--enable-opengl, --disable-opengl" | ||
75 | |||
76 | # "gles" requires "opengl" | ||
77 | PACKAGECONFIG[gles] = "--enable-gles1 --enable-gles2, --disable-gles1 --disable-gles2" | ||
78 | |||
79 | # "egl" requires "dri", "opengl" | ||
80 | PACKAGECONFIG[egl] = "--enable-egl, --disable-egl" | ||
81 | |||
82 | PACKAGECONFIG[etnaviv] = "" | ||
83 | PACKAGECONFIG[imx] = "" | ||
84 | |||
85 | GALLIUMDRIVERS = "swrast" | ||
86 | GALLIUMDRIVERS_append ="${@bb.utils.contains('PACKAGECONFIG', 'etnaviv', ',etnaviv', '', d)}" | ||
87 | GALLIUMDRIVERS_append ="${@bb.utils.contains('PACKAGECONFIG', 'imx', ',imx', '', d)}" | ||
88 | GALLIUMDRIVERS_LLVM33 = "${@bb.utils.contains('PACKAGECONFIG', 'r600', 'radeonsi,r600', '', d)}" | ||
89 | PACKAGECONFIG[r600] = "" | ||
90 | GALLIUMDRIVERS_LLVM33_ENABLED = "${@oe.utils.version_less_or_equal('MESA_LLVM_RELEASE', '3.2', False, len('${GALLIUMDRIVERS_LLVM33}') > 0, d)}" | ||
91 | GALLIUMDRIVERS_LLVM = "r300,svga,nouveau${@',${GALLIUMDRIVERS_LLVM33}' if ${GALLIUMDRIVERS_LLVM33_ENABLED} else ''}" | ||
92 | GALLIUMDRIVERS_append_x86 = "${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', ',${GALLIUMDRIVERS_LLVM}', '', d)}" | ||
93 | GALLIUMDRIVERS_append_x86-64 = "${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', ',${GALLIUMDRIVERS_LLVM}', '', d)}" | ||
94 | GALLIUMDRIVERS_append_qemux86 = ",virgl" | ||
95 | GALLIUMDRIVERS_append_qemux86-64 = ",virgl" | ||
96 | # keep --with-gallium-drivers separate, because when only one of gallium versions is enabled, other 2 were adding --without-gallium-drivers | ||
97 | PACKAGECONFIG[gallium] = "--enable-texture-float --with-gallium-drivers=${GALLIUMDRIVERS}, --without-gallium-drivers" | ||
98 | MESA_LLVM_RELEASE ?= "6.0" | ||
99 | PACKAGECONFIG[gallium-llvm] = "--enable-llvm --enable-llvm-shared-libs, --disable-llvm, llvm${MESA_LLVM_RELEASE} llvm-native \ | ||
100 | ${@'elfutils' if ${GALLIUMDRIVERS_LLVM33_ENABLED} else ''}" | ||
101 | export WANT_LLVM_RELEASE = "${MESA_LLVM_RELEASE}" | ||
102 | PACKAGECONFIG[xa] = "--enable-xa, --disable-xa" | ||
103 | |||
104 | OSMESA = "${@bb.utils.contains('PACKAGECONFIG', 'gallium', 'gallium-osmesa', 'osmesa', d)}" | ||
105 | PACKAGECONFIG[osmesa] = "--enable-${OSMESA},--disable-${OSMESA}" | ||
106 | |||
107 | PACKAGECONFIG[unwind] = "--enable-libunwind,--disable-libunwind,libunwind" | ||
108 | |||
109 | EXTRA_OECONF_remove_libc-musl = "--enable-glx-tls" | ||
110 | EXTRA_OECONF_append_libc-musl = " --disable-glx-tls" | ||
111 | EXTRA_OECONF_append_libc-musl_x86 = " --disable-asm" | ||
112 | |||
113 | # llvmpipe is slow if compiled with -fomit-frame-pointer (e.g. -O2) | ||
114 | FULL_OPTIMIZATION_append = " -fno-omit-frame-pointer" | ||
115 | |||
116 | CFLAGS_append_armv5 = " -DMISSING_64BIT_ATOMICS" | ||
117 | EXTRA_OEMAKE += "WAYLAND_PROTOCOLS_DATADIR=${STAGING_DATADIR}/wayland-protocols" | ||
118 | |||
119 | # Remove the mesa dependency on mesa-dev, as mesa is empty | ||
120 | RDEPENDS_${PN}-dev = "" | ||
121 | |||
122 | # Add dependency so that GLES3 header don't need to be added manually | ||
123 | RDEPENDS_libgles2-mesa-dev += "libgles3-mesa-dev" | ||
124 | |||
125 | PACKAGES =+ "libegl-mesa libegl-mesa-dev \ | ||
126 | libosmesa libosmesa-dev \ | ||
127 | libgl-mesa libgl-mesa-dev \ | ||
128 | libglapi libglapi-dev \ | ||
129 | libgbm libgbm-dev \ | ||
130 | libgles1-mesa libgles1-mesa-dev \ | ||
131 | libgles2-mesa libgles2-mesa-dev \ | ||
132 | libgles3-mesa libgles3-mesa-dev \ | ||
133 | libwayland-egl libwayland-egl-dev \ | ||
134 | libxatracker libxatracker-dev \ | ||
135 | mesa-megadriver mesa-vulkan-drivers \ | ||
136 | " | ||
137 | |||
138 | do_install_append () { | ||
139 | # Drivers never need libtool .la files | ||
140 | rm -f ${D}${libdir}/dri/*.la | ||
141 | rm -f ${D}${libdir}/egl/*.la | ||
142 | rm -f ${D}${libdir}/gallium-pipe/*.la | ||
143 | rm -f ${D}${libdir}/gbm/*.la | ||
144 | |||
145 | # it was packaged in libdricore9.1.3-1 and preventing upgrades when debian.bbclass was used | ||
146 | rm -f ${D}${sysconfdir}/drirc | ||
147 | chrpath --delete ${D}${libdir}/dri/*_dri.so || true | ||
148 | } | ||
149 | |||
150 | # For the packages that make up the OpenGL interfaces, inject variables so that | ||
151 | # they don't get Debian-renamed (which would remove the -mesa suffix), and | ||
152 | # RPROVIDEs/RCONFLICTs on the generic libgl name. | ||
153 | python __anonymous() { | ||
154 | pkgconfig = (d.getVar('PACKAGECONFIG') or "").split() | ||
155 | for p in (("egl", "libegl", "libegl1"), | ||
156 | ("dri", "libgl", "libgl1"), | ||
157 | ("gles", "libgles1", "libglesv1-cm1"), | ||
158 | ("gles", "libgles2", "libglesv2-2"), | ||
159 | ("gles", "libgles3",)): | ||
160 | if not p[0] in pkgconfig: | ||
161 | continue | ||
162 | fullp = p[1] + "-mesa" | ||
163 | pkgs = " ".join(p[1:]) | ||
164 | d.setVar("DEBIAN_NOAUTONAME_" + fullp, "1") | ||
165 | d.appendVar("RREPLACES_" + fullp, pkgs) | ||
166 | d.appendVar("RPROVIDES_" + fullp, pkgs) | ||
167 | d.appendVar("RCONFLICTS_" + fullp, pkgs) | ||
168 | |||
169 | d.appendVar("RRECOMMENDS_" + fullp, " mesa-megadriver") | ||
170 | |||
171 | # For -dev, the first element is both the Debian and original name | ||
172 | fullp += "-dev" | ||
173 | pkgs = p[1] + "-dev" | ||
174 | d.setVar("DEBIAN_NOAUTONAME_" + fullp, "1") | ||
175 | d.appendVar("RREPLACES_" + fullp, pkgs) | ||
176 | d.appendVar("RPROVIDES_" + fullp, pkgs) | ||
177 | d.appendVar("RCONFLICTS_" + fullp, pkgs) | ||
178 | } | ||
179 | |||
180 | python mesa_populate_packages() { | ||
181 | pkgs = ['mesa', 'mesa-dev', 'mesa-dbg'] | ||
182 | for pkg in pkgs: | ||
183 | d.setVar("RPROVIDES_%s" % pkg, pkg.replace("mesa", "mesa-dri", 1)) | ||
184 | d.setVar("RCONFLICTS_%s" % pkg, pkg.replace("mesa", "mesa-dri", 1)) | ||
185 | d.setVar("RREPLACES_%s" % pkg, pkg.replace("mesa", "mesa-dri", 1)) | ||
186 | |||
187 | import re | ||
188 | dri_drivers_root = oe.path.join(d.getVar('PKGD'), d.getVar('libdir'), "dri") | ||
189 | if os.path.isdir(dri_drivers_root): | ||
190 | dri_pkgs = os.listdir(dri_drivers_root) | ||
191 | lib_name = d.expand("${MLPREFIX}mesa-megadriver") | ||
192 | for p in dri_pkgs: | ||
193 | m = re.match('^(.*)_dri\.so$', p) | ||
194 | if m: | ||
195 | pkg_name = " ${MLPREFIX}mesa-driver-%s" % legitimize_package_name(m.group(1)) | ||
196 | d.appendVar("RPROVIDES_%s" % lib_name, pkg_name) | ||
197 | d.appendVar("RCONFLICTS_%s" % lib_name, pkg_name) | ||
198 | d.appendVar("RREPLACES_%s" % lib_name, pkg_name) | ||
199 | |||
200 | pipe_drivers_root = os.path.join(d.getVar('libdir'), "gallium-pipe") | ||
201 | do_split_packages(d, pipe_drivers_root, '^pipe_(.*)\.so$', 'mesa-driver-pipe-%s', 'Mesa %s pipe driver', extra_depends='') | ||
202 | } | ||
203 | |||
204 | PACKAGESPLITFUNCS_prepend = "mesa_populate_packages " | ||
205 | |||
206 | PACKAGES_DYNAMIC += "^mesa-driver-.*" | ||
207 | |||
208 | FILES_${PN} += "${sysconfdir}/drirc" | ||
209 | FILES_mesa-megadriver = "${libdir}/dri/*" | ||
210 | FILES_mesa-vulkan-drivers = "${libdir}/libvulkan_*.so ${datadir}/vulkan" | ||
211 | FILES_libegl-mesa = "${libdir}/libEGL.so.*" | ||
212 | FILES_libgbm = "${libdir}/libgbm.so.*" | ||
213 | FILES_libgles1-mesa = "${libdir}/libGLESv1*.so.*" | ||
214 | FILES_libgles2-mesa = "${libdir}/libGLESv2.so.*" | ||
215 | FILES_libgl-mesa = "${libdir}/libGL.so.*" | ||
216 | FILES_libglapi = "${libdir}/libglapi.so.*" | ||
217 | FILES_libosmesa = "${libdir}/libOSMesa.so.*" | ||
218 | FILES_libwayland-egl = "${libdir}/libwayland-egl.so.*" | ||
219 | FILES_libxatracker = "${libdir}/libxatracker.so.*" | ||
220 | |||
221 | FILES_${PN}-dev = "${libdir}/pkgconfig/dri.pc ${includedir}/vulkan" | ||
222 | FILES_libegl-mesa-dev = "${libdir}/libEGL.* ${includedir}/EGL ${includedir}/KHR ${libdir}/pkgconfig/egl.pc" | ||
223 | FILES_libgbm-dev = "${libdir}/libgbm.* ${libdir}/pkgconfig/gbm.pc ${includedir}/gbm.h" | ||
224 | FILES_libgl-mesa-dev = "${libdir}/libGL.* ${includedir}/GL ${libdir}/pkgconfig/gl.pc" | ||
225 | FILES_libglapi-dev = "${libdir}/libglapi.*" | ||
226 | FILES_libgles1-mesa-dev = "${libdir}/libGLESv1*.* ${includedir}/GLES ${libdir}/pkgconfig/glesv1*.pc" | ||
227 | FILES_libgles2-mesa-dev = "${libdir}/libGLESv2.* ${includedir}/GLES2 ${libdir}/pkgconfig/glesv2.pc" | ||
228 | FILES_libgles3-mesa-dev = "${includedir}/GLES3" | ||
229 | FILES_libosmesa-dev = "${libdir}/libOSMesa.* ${includedir}/GL/osmesa.h ${libdir}/pkgconfig/osmesa.pc" | ||
230 | FILES_libwayland-egl-dev = "${libdir}/pkgconfig/wayland-egl.pc ${libdir}/libwayland-egl.*" | ||
231 | FILES_libxatracker-dev = "${libdir}/libxatracker.so ${libdir}/libxatracker.la \ | ||
232 | ${includedir}/xa_tracker.h ${includedir}/xa_composite.h ${includedir}/xa_context.h \ | ||
233 | ${libdir}/pkgconfig/xatracker.pc" | ||