blob: 3e675d9da30013d2e27d5b7a5c1e1628735b7714 [file] [log] [blame]
Brad Bishop286d45c2018-10-02 15:21:57 -04001DESCRIPTION = "libGLES for ZynqMP with Mali 400"
2
3LICENSE = "Proprietary"
4LICENSE_FLAGS = "xilinx"
5LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Proprietary;md5=0557f9d92cf58f2ccdd50f62f8ac0b28"
6
7inherit distro_features_check
8inherit xilinx-fetch-restricted
9
10ANY_OF_DISTRO_FEATURES = "fbdev x11"
11
12PROVIDES += "virtual/libgles1 virtual/libgles2 virtual/egl"
13
14FILESEXTRAPATHS_append := " \
15 ${THISDIR}/files: \
16 ${THISDIR}/r8p0-00rel0: "
17
18
19# Fetch the MALI 400 binaries from here
20# https://www.xilinx.com/member/forms/download/mali-driver-license.html?filename=mali-400-userspace.tar
21
22PV = "r8p0-01rel0"
23SRC_URI = " \
24 https://www.xilinx.com/member/forms/download/mali-driver-license.html?filename=mali-400-userspace.tar;downloadfilename=mali-400-userspace.tar \
25 file://egl.pc \
26 file://glesv1_cm.pc \
27 file://glesv1.pc \
28 file://glesv2.pc \
29 "
30
31SRC_URI[md5sum] = "e75b147c8b4ee96616e24572cdc9c21f"
32SRC_URI[sha256sum] = "7b179ec2df54ee05a886cca1535c0bdc6cba77a646e22742adedc79bfc2b3017"
33
34COMPATIBLE_MACHINE = "^$"
35COMPATIBLE_MACHINE_zynqmpeg = "zynqmpeg"
36COMPATIBLE_MACHINE_zynqmpev = "zynqmpev"
37
38PACKAGE_ARCH = "${SOC_FAMILY}${SOC_VARIANT}"
39
40
41S = "${WORKDIR}/mali-400"
42
43X11RDEPENDS = "libxdamage libxext libx11 libdrm libxfixes"
44X11DEPENDS = "libxdamage libxext virtual/libx11 libdrm libxfixes"
45
46RDEPENDS_${PN} = " \
47 kernel-module-mali \
48 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '${X11RDEPENDS}', '', d)} \
49 "
50
51DEPENDS = "\
52 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '${X11DEPENDS}', '', d)} \
53 "
54
55EGL_TYPE = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', \
56 bb.utils.contains('DISTRO_FEATURES', 'fbdev', 'fbdev', '', d), d)}"
57
58do_compile() {
59 # Extract the MALI binaries into workdir
60 tar -xf ${WORKDIR}/mali/rel-v2018.1/r8p0-01rel0.tar -C ${S}
61}
62
63do_install() {
64 #Identify the ARCH type
65 ${TARGET_PREFIX}gcc --version > ARCH_PLATFORM
66 if grep -q aarch64 "ARCH_PLATFORM"; then
67 ARCH_PLATFORM_DIR=aarch64-linux-gnu
68 else
69 ARCH_PLATFORM_DIR=arm-linux-gnueabihf
70 fi
71
72 # install headers
73 install -d -m 0655 ${D}${includedir}/EGL
74 install -m 0644 ${S}/${PV}/${ARCH_PLATFORM_DIR}/${EGL_TYPE}/usr/include/EGL/*.h ${D}${includedir}/EGL/
75 install -d -m 0655 ${D}${includedir}/GLES
76 install -m 0644 ${S}/${PV}/${ARCH_PLATFORM_DIR}/${EGL_TYPE}/usr/include/GLES/*.h ${D}${includedir}/GLES/
77 install -d -m 0655 ${D}${includedir}/GLES2
78 install -m 0644 ${S}/${PV}/${ARCH_PLATFORM_DIR}/${EGL_TYPE}/usr/include/GLES2/*.h ${D}${includedir}/GLES2/
79 install -d -m 0655 ${D}${includedir}/KHR
80 install -m 0644 ${S}/${PV}/${ARCH_PLATFORM_DIR}/${EGL_TYPE}/usr/include/KHR/*.h ${D}${includedir}/KHR/
81
82 install -d ${D}${libdir}/pkgconfig
83 install -m 0644 ${WORKDIR}/egl.pc ${D}${libdir}/pkgconfig/egl.pc
84 install -m 0644 ${WORKDIR}/glesv2.pc ${D}${libdir}/pkgconfig/glesv2.pc
85 install -m 0644 ${WORKDIR}/glesv1.pc ${D}${libdir}/pkgconfig/glesv1.pc
86 install -m 0644 ${WORKDIR}/glesv1_cm.pc ${D}${libdir}/pkgconfig/glesv1_cm.pc
87
88 install -d ${D}${libdir}
89 cp -a --no-preserve=ownership ${S}/${PV}/${ARCH_PLATFORM_DIR}/${EGL_TYPE}/usr/lib/*.so* ${D}${libdir}
90
91 if ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'false', 'true', d)}; then
92 sed -i -e 's/^#if defined(MESA_EGL_NO_X11_HEADERS)$/#if (1)/' ${D}${includedir}/EGL/eglplatform.h
93 fi
94}
95
96
97# Inhibit warnings about files being stripped
98INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
99INHIBIT_PACKAGE_STRIP = "1"
100INHIBIT_SYSROOT_STRIP = "1"
101
102RREPLACES_${PN} = "libegl libgles1 libglesv1-cm1 libgles2 libglesv2-2"
103RPROVIDES_${PN} = "libegl libgles1 libglesv1-cm1 libgles2 libglesv2-2"
104RCONFLICTS_${PN} = "libegl libgles1 libglesv1-cm1 libgles2 libglesv2-2"
105
106# These libraries shouldn't get installed in world builds unless something
107# explicitly depends upon them.
108EXCLUDE_FROM_WORLD = "1"