blob: 8c6ab3e9fd9f2fb19dfb653f4a0f1019de0c2ee5 [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
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080012PROVIDES += "virtual/libgles1 virtual/libgles2 virtual/egl virtual/libgbm"
Brad Bishop286d45c2018-10-02 15:21:57 -040013
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 \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080029 file://wayland-egl.pc \
30 file://gbm.pc \
Brad Bishop286d45c2018-10-02 15:21:57 -040031 "
32
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080033SRC_URI[md5sum] = "4fd3456564ef8c818e21432221c9e1b7"
34SRC_URI[sha256sum] = "26d473ae77c36104a215710beca55a22a712850dc26547dde950c7398210602c"
Brad Bishop286d45c2018-10-02 15:21:57 -040035
36COMPATIBLE_MACHINE = "^$"
37COMPATIBLE_MACHINE_zynqmpeg = "zynqmpeg"
38COMPATIBLE_MACHINE_zynqmpev = "zynqmpev"
39
40PACKAGE_ARCH = "${SOC_FAMILY}${SOC_VARIANT}"
41
42
43S = "${WORKDIR}/mali-400"
44
45X11RDEPENDS = "libxdamage libxext libx11 libdrm libxfixes"
46X11DEPENDS = "libxdamage libxext virtual/libx11 libdrm libxfixes"
47
48RDEPENDS_${PN} = " \
49 kernel-module-mali \
50 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '${X11RDEPENDS}', '', d)} \
51 "
52
53DEPENDS = "\
54 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '${X11DEPENDS}', '', d)} \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080055 ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland libdrm', '', d)} \
Brad Bishop286d45c2018-10-02 15:21:57 -040056 "
57
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080058USE_X11 = "${@bb.utils.contains("DISTRO_FEATURES", "x11", "yes", "no", d)}"
59USE_FB = "${@bb.utils.contains("DISTRO_FEATURES", "fbdev", "yes", "no", d)}"
60USE_WL = "${@bb.utils.contains("DISTRO_FEATURES", "wayland", "yes", "no", d)}"
Brad Bishop286d45c2018-10-02 15:21:57 -040061
62do_compile() {
63 # Extract the MALI binaries into workdir
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080064 tar -xf ${WORKDIR}/mali/rel-v2018.3/r8p0-01rel0.tar -C ${S}
Brad Bishop286d45c2018-10-02 15:21:57 -040065}
66
67do_install() {
68 #Identify the ARCH type
69 ${TARGET_PREFIX}gcc --version > ARCH_PLATFORM
70 if grep -q aarch64 "ARCH_PLATFORM"; then
71 ARCH_PLATFORM_DIR=aarch64-linux-gnu
72 else
73 ARCH_PLATFORM_DIR=arm-linux-gnueabihf
74 fi
75
76 # install headers
77 install -d -m 0655 ${D}${includedir}/EGL
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080078 install -m 0644 ${S}/${PV}/glesHeaders/EGL/*.h ${D}${includedir}/EGL/
Brad Bishop286d45c2018-10-02 15:21:57 -040079 install -d -m 0655 ${D}${includedir}/GLES
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080080 install -m 0644 ${S}/${PV}/glesHeaders/GLES/*.h ${D}${includedir}/GLES/
Brad Bishop286d45c2018-10-02 15:21:57 -040081 install -d -m 0655 ${D}${includedir}/GLES2
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080082 install -m 0644 ${S}/${PV}/glesHeaders/GLES2/*.h ${D}${includedir}/GLES2/
Brad Bishop286d45c2018-10-02 15:21:57 -040083 install -d -m 0655 ${D}${includedir}/KHR
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080084 install -m 0644 ${S}/${PV}/glesHeaders/KHR/*.h ${D}${includedir}/KHR/
Brad Bishop286d45c2018-10-02 15:21:57 -040085
86 install -d ${D}${libdir}/pkgconfig
87 install -m 0644 ${WORKDIR}/egl.pc ${D}${libdir}/pkgconfig/egl.pc
88 install -m 0644 ${WORKDIR}/glesv2.pc ${D}${libdir}/pkgconfig/glesv2.pc
89 install -m 0644 ${WORKDIR}/glesv1.pc ${D}${libdir}/pkgconfig/glesv1.pc
90 install -m 0644 ${WORKDIR}/glesv1_cm.pc ${D}${libdir}/pkgconfig/glesv1_cm.pc
91
92 install -d ${D}${libdir}
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080093 install -d ${D}${includedir}
94
95 cp -a --no-preserve=ownership ${S}/${PV}/${ARCH_PLATFORM_DIR}/common/*.so* ${D}${libdir}
96
97 if [ "${USE_WL}" = "yes" ]; then
98 install -m 0644 ${S}/${PV}/glesHeaders/GBM/gbm.h ${D}${includedir}/
99 install -m 0644 ${WORKDIR}/gbm.pc ${D}${libdir}/pkgconfig/gbm.pc
100 install -m 0644 ${WORKDIR}/wayland-egl.pc ${D}${libdir}/pkgconfig/wayland-egl.pc
101 install -Dm 0644 ${S}/${PV}/${ARCH_PLATFORM_DIR}/wayland/libMali.so.8.0 ${D}${libdir}/wayland/libMali.so.8.0
102 ln -snf wayland/libMali.so.8.0 ${D}${libdir}/libMali.so.8.0
103 elif [ "${USE_X11}" = "yes" ]; then
104 install -Dm 0644 ${S}/${PV}/${ARCH_PLATFORM_DIR}/x11/libMali.so.8.0 ${D}${libdir}/x11/libMali.so.8.0
105 ln -snf x11/libMali.so.8.0 ${D}${libdir}/libMali.so.8.0
106 elif [ "${USE_FB}" = "yes" ]; then
107 install -Dm 0644 ${S}/${PV}/${ARCH_PLATFORM_DIR}/fbdev/libMali.so.8.0 ${D}${libdir}/fbdev/libMali.so.8.0
108 ln -snf fbdev/libMali.so.8.0 ${D}${libdir}/libMali.so.8.0
109 else
110 install -Dm 0644 ${S}/${PV}/${ARCH_PLATFORM_DIR}/headless/libMali.so.8.0 ${D}${libdir}/headless/libMali.so.8.0
111 ln -snf headless/libMali.so.8.0 ${D}${libdir}/libMali.so.8.0
112 fi
Brad Bishop286d45c2018-10-02 15:21:57 -0400113
114 if ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'false', 'true', d)}; then
115 sed -i -e 's/^#if defined(MESA_EGL_NO_X11_HEADERS)$/#if (1)/' ${D}${includedir}/EGL/eglplatform.h
116 fi
117}
118
119
120# Inhibit warnings about files being stripped
121INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
122INHIBIT_PACKAGE_STRIP = "1"
123INHIBIT_SYSROOT_STRIP = "1"
124
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800125RREPLACES_${PN} = "libegl libgles1 libglesv1-cm1 libgles2 libglesv2-2 libgbm"
126RPROVIDES_${PN} = "libegl libgles1 libglesv1-cm1 libgles2 libglesv2-2 libgbm"
127RCONFLICTS_${PN} = "libegl libgles1 libglesv1-cm1 libgles2 libglesv2-2 libgbm"
Brad Bishop286d45c2018-10-02 15:21:57 -0400128
129# These libraries shouldn't get installed in world builds unless something
130# explicitly depends upon them.
131EXCLUDE_FROM_WORLD = "1"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800132FILES_${PN} += "${libdir}/*"