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 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 12 | PROVIDES += "virtual/libgles1 virtual/libgles2 virtual/egl virtual/libgbm" |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 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 \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 29 | file://wayland-egl.pc \ |
| 30 | file://gbm.pc \ |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 31 | " |
| 32 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 33 | SRC_URI[md5sum] = "4fd3456564ef8c818e21432221c9e1b7" |
| 34 | SRC_URI[sha256sum] = "26d473ae77c36104a215710beca55a22a712850dc26547dde950c7398210602c" |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 35 | |
| 36 | COMPATIBLE_MACHINE = "^$" |
| 37 | COMPATIBLE_MACHINE_zynqmpeg = "zynqmpeg" |
| 38 | COMPATIBLE_MACHINE_zynqmpev = "zynqmpev" |
| 39 | |
| 40 | PACKAGE_ARCH = "${SOC_FAMILY}${SOC_VARIANT}" |
| 41 | |
| 42 | |
| 43 | S = "${WORKDIR}/mali-400" |
| 44 | |
| 45 | X11RDEPENDS = "libxdamage libxext libx11 libdrm libxfixes" |
| 46 | X11DEPENDS = "libxdamage libxext virtual/libx11 libdrm libxfixes" |
| 47 | |
| 48 | RDEPENDS_${PN} = " \ |
| 49 | kernel-module-mali \ |
| 50 | ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '${X11RDEPENDS}', '', d)} \ |
| 51 | " |
| 52 | |
| 53 | DEPENDS = "\ |
| 54 | ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '${X11DEPENDS}', '', d)} \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 55 | ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland libdrm', '', d)} \ |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 56 | " |
| 57 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 58 | USE_X11 = "${@bb.utils.contains("DISTRO_FEATURES", "x11", "yes", "no", d)}" |
| 59 | USE_FB = "${@bb.utils.contains("DISTRO_FEATURES", "fbdev", "yes", "no", d)}" |
| 60 | USE_WL = "${@bb.utils.contains("DISTRO_FEATURES", "wayland", "yes", "no", d)}" |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 61 | |
| 62 | do_compile() { |
| 63 | # Extract the MALI binaries into workdir |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 64 | tar -xf ${WORKDIR}/mali/rel-v2018.3/r8p0-01rel0.tar -C ${S} |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 65 | } |
| 66 | |
| 67 | do_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 Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 78 | install -m 0644 ${S}/${PV}/glesHeaders/EGL/*.h ${D}${includedir}/EGL/ |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 79 | install -d -m 0655 ${D}${includedir}/GLES |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 80 | install -m 0644 ${S}/${PV}/glesHeaders/GLES/*.h ${D}${includedir}/GLES/ |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 81 | install -d -m 0655 ${D}${includedir}/GLES2 |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 82 | install -m 0644 ${S}/${PV}/glesHeaders/GLES2/*.h ${D}${includedir}/GLES2/ |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 83 | install -d -m 0655 ${D}${includedir}/KHR |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 84 | install -m 0644 ${S}/${PV}/glesHeaders/KHR/*.h ${D}${includedir}/KHR/ |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 85 | |
| 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 Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 93 | 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 Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 113 | |
| 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 |
| 121 | INHIBIT_PACKAGE_DEBUG_SPLIT = "1" |
| 122 | INHIBIT_PACKAGE_STRIP = "1" |
| 123 | INHIBIT_SYSROOT_STRIP = "1" |
| 124 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 125 | RREPLACES_${PN} = "libegl libgles1 libglesv1-cm1 libgles2 libglesv2-2 libgbm" |
| 126 | RPROVIDES_${PN} = "libegl libgles1 libglesv1-cm1 libgles2 libglesv2-2 libgbm" |
| 127 | RCONFLICTS_${PN} = "libegl libgles1 libglesv1-cm1 libgles2 libglesv2-2 libgbm" |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 128 | |
| 129 | # These libraries shouldn't get installed in world builds unless something |
| 130 | # explicitly depends upon them. |
| 131 | EXCLUDE_FROM_WORLD = "1" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 132 | FILES_${PN} += "${libdir}/*" |