<commit_before>DESCRIPTION = "libGLES for the A10/A13 Allwinner processor with Mali 400 (X11)"

LICENSE = "Proprietary"
LIC_FILES_CHKSUM = "file://README;md5=1b81a178e80ee888ee4571772699ab2c"

COMPATIBLE_MACHINE = "(sun4i|sun5i|sun7i|sun8i)"

# These libraries shouldn't get installed in world builds unless something
# explicitly depends upon them.
EXCLUDE_FROM_WORLD = "1"
PROVIDES = "virtual/libgles1 virtual/libgles2 virtual/egl"

# There's only hardfp version available
python __anonymous() {
    tunes = d.getVar("TUNE_FEATURES", True)
    if not tunes:
        return
    if "callconvention-hard" not in tunes:
        pkgn = d.getVar("PN", True)
        pkgv = d.getVar("PV", True)
        raise bb.parse.SkipPackage("%s-%s ONLY supports hardfp mode for now" % (pkgn, pkgv))
}

SRCREV = "d343311efc8db166d8371b28494f0f27b6a58724"
SRC_URI = "gitsm://github.com/linux-sunxi/sunxi-mali.git \
           file://0001-Add-EGLSyncKHR-EGLTimeKHR-and-GLChar-definition.patch \
           file://0002-Add-missing-GLchar-definition.patch \
           file://0003-Fix-sed-to-replace-by-the-correct-var.patch \
           file://0001-fix-test-build.patch \
           "

S = "${WORKDIR}/git"

DEPENDS = "libdrm xorgproto libump patchelf-native"

PACKAGECONFIG ??= "${@<EMAIL>.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} ${@<EMAIL>.contains('DISTRO_FEATURES', 'wayland', 'wayland', '', d)}"
PACKAGECONFIG[wayland] = "EGL_TYPE=framebuffer,,,"
PACKAGECONFIG[x11] = "EGL_TYPE=x11,,virtual/libx11 libxau libxdmcp libdri2,"

# Inhibit warnings about files being stripped, we can't do anything about it.
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
INHIBIT_PACKAGE_STRIP = "1"
INHIBIT_SYSROOT_STRIP = "1"

do_configure() {
         DESTDIR=${D}/ VERSION=r3p0 ABI=armhf make ${EXTRA_OEMAKE} config
}

do_install() {
    make -f Makefile.pc

    # install headers
    install -d -m 0755 ${D}${includedir}/EGL
    install -m 0755 ${S}/include/EGL/*.h ${D}${includedir}/EGL/
    install -d -m 0755 ${D}${includedir}/GLES<commit_msg>libgles: sunxi-mali: fix linter warnings<commit_after>DESCRIPTION = "libGLES for the A10/A13 Allwinner processor with Mali 400 (X11)"

LICENSE = "Proprietary"
LIC_FILES_CHKSUM = "file://README;md5=1b81a178e80ee888ee4571772699ab2c"

COMPATIBLE_MACHINE = "(sun4i|sun5i|sun7i|sun8i)"

# These libraries shouldn't get installed in world builds unless something
# explicitly depends upon them.
EXCLUDE_FROM_WORLD = "1"
PROVIDES = "virtual/libgles1 virtual/libgles2 virtual/egl"

# There's only hardfp version available
python __anonymous() {
    tunes = d.getVar("TUNE_FEATURES", True)
    if not tunes:
        return
    if "callconvention-hard" not in tunes:
        pkgn = d.getVar("PN", True)
        pkgv = d.getVar("PV", True)
        raise bb.parse.SkipPackage("%s-%s ONLY supports hardfp mode for now" % (pkgn, pkgv))
}

SRCREV = "d343311efc8db166d8371b28494f0f27b6a58724"
SRC_URI = "git://github.com/linux-sunxi/sunxi-mali.git;protocol=https;branch=master \
           file://0001-Add-EGLSyncKHR-EGLTimeKHR-and-GLChar-definition.patch \
           file://0002-Add-missing-GLchar-definition.patch \
           file://0003-Fix-sed-to-replace-by-the-correct-var.patch \
           file://0001-fix-test-build.patch \
           "

S = "${WORKDIR}/git"

DEPENDS = "libdrm xorgproto libump patchelf-native"

PACKAGECONFIG ??= "${@<EMAIL>.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', '', d)}"
PACKAGECONFIG[wayland] = "EGL_TYPE=framebuffer,,,"
PACKAGECONFIG[x11] = "EGL_TYPE=x11,,virtual/libx11 libxau libxdmcp libdri2,"

# Inhibit warnings about files being stripped, we can't do anything about it.
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
INHIBIT_PACKAGE_STRIP = "1"
INHIBIT_SYSROOT_STRIP = "1"

do_configure() {
         DESTDIR=${D}/ VERSION=r3p0 ABI=armhf make ${EXTRA_OEMAKE} config
}

do_install() {
    make -f Makefile.pc

    # install headers
    install -d -m 0755 ${D}${includedir}/EGL
    install -m 0755 ${S}/include/EGL/*.h ${D}${includedir}/EGL/
    install -d -m 0755 ${D}${includedir}/GLES
{'fraction_non_alphanumeric': 0.14275202354672553, 'fraction_numerical': 0.054451802796173655, 'mean_word_length': 3.9550425273390037, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7380336', 'n_tokens_mistral': 1695, 'n_tokens_neox': 1555, 'n_words': 301}