Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 1 | DESCRIPTION = "libGLES for ZynqMP with Mali 400" |
| 2 | |
| 3 | LICENSE = "Proprietary" |
| 4 | LICENSE_FLAGS = "xilinx" |
| 5 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Proprietary;md5=0557f9d92cf58f2ccdd50f62f8ac0b28" |
| 6 | |
| 7 | inherit distro_features_check |
| 8 | inherit xilinx-fetch-restricted |
| 9 | |
| 10 | ANY_OF_DISTRO_FEATURES = "fbdev x11" |
| 11 | |
| 12 | PROVIDES += "virtual/libgles1 virtual/libgles2 virtual/egl" |
| 13 | |
| 14 | FILESEXTRAPATHS_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 | |
| 22 | PV = "r8p0-01rel0" |
| 23 | SRC_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 | |
| 31 | SRC_URI[md5sum] = "e75b147c8b4ee96616e24572cdc9c21f" |
| 32 | SRC_URI[sha256sum] = "7b179ec2df54ee05a886cca1535c0bdc6cba77a646e22742adedc79bfc2b3017" |
| 33 | |
| 34 | COMPATIBLE_MACHINE = "^$" |
| 35 | COMPATIBLE_MACHINE_zynqmpeg = "zynqmpeg" |
| 36 | COMPATIBLE_MACHINE_zynqmpev = "zynqmpev" |
| 37 | |
| 38 | PACKAGE_ARCH = "${SOC_FAMILY}${SOC_VARIANT}" |
| 39 | |
| 40 | |
| 41 | S = "${WORKDIR}/mali-400" |
| 42 | |
| 43 | X11RDEPENDS = "libxdamage libxext libx11 libdrm libxfixes" |
| 44 | X11DEPENDS = "libxdamage libxext virtual/libx11 libdrm libxfixes" |
| 45 | |
| 46 | RDEPENDS_${PN} = " \ |
| 47 | kernel-module-mali \ |
| 48 | ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '${X11RDEPENDS}', '', d)} \ |
| 49 | " |
| 50 | |
| 51 | DEPENDS = "\ |
| 52 | ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '${X11DEPENDS}', '', d)} \ |
| 53 | " |
| 54 | |
| 55 | EGL_TYPE = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', \ |
| 56 | bb.utils.contains('DISTRO_FEATURES', 'fbdev', 'fbdev', '', d), d)}" |
| 57 | |
| 58 | do_compile() { |
| 59 | # Extract the MALI binaries into workdir |
| 60 | tar -xf ${WORKDIR}/mali/rel-v2018.1/r8p0-01rel0.tar -C ${S} |
| 61 | } |
| 62 | |
| 63 | do_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 |
| 98 | INHIBIT_PACKAGE_DEBUG_SPLIT = "1" |
| 99 | INHIBIT_PACKAGE_STRIP = "1" |
| 100 | INHIBIT_SYSROOT_STRIP = "1" |
| 101 | |
| 102 | RREPLACES_${PN} = "libegl libgles1 libglesv1-cm1 libgles2 libglesv2-2" |
| 103 | RPROVIDES_${PN} = "libegl libgles1 libglesv1-cm1 libgles2 libglesv2-2" |
| 104 | RCONFLICTS_${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. |
| 108 | EXCLUDE_FROM_WORLD = "1" |