diff options
Diffstat (limited to 'meta/recipes-graphics/mesa/mesa.inc')
-rw-r--r-- | meta/recipes-graphics/mesa/mesa.inc | 189 |
1 files changed, 189 insertions, 0 deletions
diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc new file mode 100644 index 0000000000..1857f3c220 --- /dev/null +++ b/meta/recipes-graphics/mesa/mesa.inc | |||
@@ -0,0 +1,189 @@ | |||
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 | |||
27 | PACKAGECONFIG ??= "egl gles dri \ | ||
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" | ||
35 | PACKAGECONFIG[wayland] = ",,wayland" | ||
36 | |||
37 | DRIDRIVERS = "swrast" | ||
38 | DRIDRIVERS_append_x86 = ",radeon,r200,nouveau,i965,i915" | ||
39 | DRIDRIVERS_append_x86-64 = ",radeon,r200,nouveau,i965,i915" | ||
40 | PACKAGECONFIG[dri] = "--enable-dri --with-dri-drivers=${DRIDRIVERS}, --disable-dri, dri2proto libdrm" | ||
41 | PACKAGECONFIG[dri3] = "--enable-dri3, --disable-dri3, dri3proto presentproto libxshmfence" | ||
42 | |||
43 | EXTRA_OECONF += "--enable-gbm" | ||
44 | |||
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 | PACKAGECONFIG[openvg] = "--enable-openvg, --disable-openvg" | ||
53 | |||
54 | GALLIUMDRIVERS = "swrast" | ||
55 | GALLIUMDRIVERS_LLVM33 = "${@bb.utils.contains('PACKAGECONFIG', 'r600', 'radeonsi,r600', '', d)}" | ||
56 | GALLIUMDRIVERS_LLVM33_ENABLED = "${@base_version_less_or_equal('MESA_LLVM_RELEASE', '3.2', False, len('${GALLIUMDRIVERS_LLVM33}') > 0, d)}" | ||
57 | GALLIUMDRIVERS_LLVM = "r300,svga,nouveau${@',${GALLIUMDRIVERS_LLVM33}' if ${GALLIUMDRIVERS_LLVM33_ENABLED} else ''}" | ||
58 | GALLIUMDRIVERS_append_x86 = "${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', ',${GALLIUMDRIVERS_LLVM}', '', d)}" | ||
59 | GALLIUMDRIVERS_append_x86-64 = "${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', ',${GALLIUMDRIVERS_LLVM}', '', d)}" | ||
60 | # keep --with-gallium-drivers separate, because when only one of gallium versions is enabled, other 2 were adding --without-gallium-drivers | ||
61 | PACKAGECONFIG[gallium] = "--with-gallium-drivers=${GALLIUMDRIVERS}, --without-gallium-drivers" | ||
62 | PACKAGECONFIG[gallium-egl] = "--enable-gallium-egl, --disable-gallium-egl" | ||
63 | PACKAGECONFIG[gallium-gbm] = "--enable-gallium-gbm, --disable-gallium-gbm" | ||
64 | MESA_LLVM_RELEASE ?= "3.3" | ||
65 | PACKAGECONFIG[gallium-llvm] = "--enable-gallium-llvm --with-llvm-shared-libs, --disable-gallium-llvm, llvm${MESA_LLVM_RELEASE} \ | ||
66 | ${@'elfutils' if ${GALLIUMDRIVERS_LLVM33_ENABLED} else ''}" | ||
67 | export WANT_LLVM_RELEASE = "${MESA_LLVM_RELEASE}" | ||
68 | |||
69 | # llvmpipe is slow if compiled with -fomit-frame-pointer (e.g. -O2) | ||
70 | FULL_OPTIMIZATION_append = " -fno-omit-frame-pointer" | ||
71 | |||
72 | # Multiple virtual/gl providers being built breaks staging | ||
73 | EXCLUDE_FROM_WORLD = "1" | ||
74 | |||
75 | # Remove the mesa dependency on mesa-dev, as mesa is empty | ||
76 | RDEPENDS_${PN}-dev = "" | ||
77 | |||
78 | PACKAGES =+ "libegl-mesa libegl-mesa-dev \ | ||
79 | libosmesa libosmesa-dev \ | ||
80 | libgl-mesa libgl-mesa-dev \ | ||
81 | libglapi libglapi-dev \ | ||
82 | libgbm libgbm-dev \ | ||
83 | libgles1-mesa libgles1-mesa-dev \ | ||
84 | libgles2-mesa libgles2-mesa-dev \ | ||
85 | libgles3-mesa libgles3-mesa-dev \ | ||
86 | libwayland-egl libwayland-egl-dev \ | ||
87 | libegl-gallium libgbm-gallium \ | ||
88 | libopenvg libopenvg-dev \ | ||
89 | libxvmcsoftpipe libxvmcsoftpipe-dev \ | ||
90 | mesa-megadriver \ | ||
91 | " | ||
92 | |||
93 | do_install_append () { | ||
94 | # Drivers never need libtool .la files | ||
95 | rm -f ${D}${libdir}/dri/*.la | ||
96 | rm -f ${D}${libdir}/egl/*.la | ||
97 | rm -f ${D}${libdir}/gallium-pipe/*.la | ||
98 | rm -f ${D}${libdir}/gbm/*.la | ||
99 | |||
100 | # it was packaged in libdricore9.1.3-1 and preventing upgrades when debian.bbclass was used | ||
101 | rm -f ${D}${sysconfdir}/drirc | ||
102 | } | ||
103 | |||
104 | # For the packages that make up the OpenGL interfaces, inject variables so that | ||
105 | # they don't get Debian-renamed (which would remove the -mesa suffix), and | ||
106 | # RPROVIDEs/RCONFLICTs on the generic libgl name. | ||
107 | python __anonymous() { | ||
108 | pkgconfig = (d.getVar('PACKAGECONFIG', True) or "").split() | ||
109 | for p in (("egl", "libegl", "libegl1"), | ||
110 | ("dri", "libgl", "libgl1"), | ||
111 | ("gles", "libgles1", "libglesv1-cm1"), | ||
112 | ("gles", "libgles2", "libglesv2-2"), | ||
113 | ("gles", "libgles3",)): | ||
114 | if not p[0] in pkgconfig: | ||
115 | continue | ||
116 | fullp = p[1] + "-mesa" | ||
117 | pkgs = " ".join(p[1:]) | ||
118 | d.setVar("DEBIAN_NOAUTONAME_" + fullp, "1") | ||
119 | d.appendVar("RREPLACES_" + fullp, pkgs) | ||
120 | d.appendVar("RPROVIDES_" + fullp, pkgs) | ||
121 | d.appendVar("RCONFLICTS_" + fullp, pkgs) | ||
122 | |||
123 | # For -dev, the first element is both the Debian and original name | ||
124 | fullp += "-dev" | ||
125 | pkgs = p[1] + "-dev" | ||
126 | d.setVar("DEBIAN_NOAUTONAME_" + fullp, "1") | ||
127 | d.appendVar("RREPLACES_" + fullp, pkgs) | ||
128 | d.appendVar("RPROVIDES_" + fullp, pkgs) | ||
129 | d.appendVar("RCONFLICTS_" + fullp, pkgs) | ||
130 | } | ||
131 | |||
132 | python mesa_populate_packages() { | ||
133 | pkgs = ['mesa', 'mesa-dev', 'mesa-dbg'] | ||
134 | for pkg in pkgs: | ||
135 | d.setVar("RPROVIDES_%s" % pkg, pkg.replace("mesa", "mesa-dri", 1)) | ||
136 | d.setVar("RCONFLICTS_%s" % pkg, pkg.replace("mesa", "mesa-dri", 1)) | ||
137 | d.setVar("RREPLACES_%s" % pkg, pkg.replace("mesa", "mesa-dri", 1)) | ||
138 | |||
139 | import re | ||
140 | dri_drivers_root = os.path.join(d.getVar('libdir', True), "dri") | ||
141 | dri_pkgs = os.listdir(d.getVar('PKGD', True) + dri_drivers_root) | ||
142 | lib_name = d.expand("${MLPREFIX}mesa-megadriver") | ||
143 | for p in dri_pkgs: | ||
144 | m = re.match('^(.*)_dri\.so$', p) | ||
145 | if m: | ||
146 | pkg_name = " ${MLPREFIX}mesa-driver-%s" % legitimize_package_name(m.group(1)) | ||
147 | d.appendVar("RPROVIDES_%s" % lib_name, pkg_name) | ||
148 | d.appendVar("RCONFLICTS_%s" % lib_name, pkg_name) | ||
149 | d.appendVar("RREPLACES_%s" % lib_name, pkg_name) | ||
150 | |||
151 | pipe_drivers_root = os.path.join(d.getVar('libdir', True), "gallium-pipe") | ||
152 | do_split_packages(d, pipe_drivers_root, '^pipe_(.*)\.so$', 'mesa-driver-pipe-%s', 'Mesa %s pipe driver', extra_depends='') | ||
153 | } | ||
154 | |||
155 | PACKAGESPLITFUNCS_prepend = "mesa_populate_packages " | ||
156 | |||
157 | PACKAGES_DYNAMIC += "^mesa-driver-.*" | ||
158 | |||
159 | FILES_${PN}-dbg += "${libdir}/dri/.debug/*" | ||
160 | FILES_${PN} += "${sysconfdir}/drirc" | ||
161 | FILES_mesa-megadriver = "${libdir}/dri/*" | ||
162 | FILES_libegl-mesa = "${libdir}/libEGL.so.*" | ||
163 | FILES_libgbm = "${libdir}/libgbm.so.*" | ||
164 | FILES_libgles1-mesa = "${libdir}/libGLESv1*.so.*" | ||
165 | FILES_libgles2-mesa = "${libdir}/libGLESv2.so.*" | ||
166 | FILES_libgl-mesa = "${libdir}/libGL.so.*" | ||
167 | FILES_libglapi = "${libdir}/libglapi.so.*" | ||
168 | FILES_libosmesa = "${libdir}/libOSMesa.so.*" | ||
169 | FILES_libwayland-egl = "${libdir}/libwayland-egl.so.*" | ||
170 | FILES_libegl-gallium = "${libdir}/egl/egl_gallium.so*" | ||
171 | FILES_libgbm-gallium = "${libdir}/gbm/gbm_gallium_drm.so*" | ||
172 | FILES_libopenvg = "${libdir}/libOpenVG.so.*" | ||
173 | FILES_libxvmcsoftpipe = "${libdir}/libXvMCsoftpipe.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_libopenvg-dev = "${libdir}/libOpenVG.so ${libdir}/libOpenVG.la* \ | ||
186 | ${includedir}/VG ${libdir}/pkgconfig/vg.pc" | ||
187 | FILES_libxvmcsoftpipe-dev = "${libdir}/libXvMCsoftpipe.so ${libdir}/libXvMCsoftpipe.la" | ||
188 | |||
189 | FILES_${PN}-dbg += "${libdir}/dri/.debug/* ${libdir}/egl/.debug/* ${libdir}/gbm/.debug/* ${libdir}/gallium-pipe/.debug" | ||