<commit_before>SUMMARY = "OPTEE AES Decryptor for Linaro OpenCDM"
DESCRIPTION = "OPTEE AES Decryptor for Linaro OpenCDM"

LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=22b593390e65f8d23beaa6ef10ed6392"
PR="r0"
PV="1.0+git"

DEPENDS = "optee-os optee-client"

PACKAGE_ARCH = "${MACHINE_ARCH}"

SRC_URI = "git://github.com/linaro-home/optee-clearkey-cdmi;protocol=https"
SRCREV = "${AUTOREV}"

S = "${WORKDIR}/git"
B = "${S}"

#stub
do_configure[noexec] = "1"

EXTRA_OEMAKE = ""
do_compile() {
    export TA_DEV_KIT_DIR=${STAGING_INCDIR}/optee/export-user_ta
    export TEEC_EXPORT=${STAGING_DIR_HOST}/usr

    oe_runmake -C ${S}/host LDFLAGS=""

    oe_runmake -C ${S}/ta LDFLAGS="" CROSS_COMPILE=${HOST_PREFIX}
}

do_install() {
    mkdir -p ${D}/usr/bin
    mkdir -p ${D}/lib/optee_armtz
    install -d ${D}/${libdir}
    install -m 0644 ${S}/host/*.a ${D}/${libdir}/

    install -d ${D}${includedir}
    install -m 0644 ${S}/host/*.h ${D}${includedir}/

    #ta part
    install -m 444 ${B}/ta/*.ta ${D}/lib/optee_armtz/
}


FILES_${PN} = "${libdir}/*.a  /usr/bin /lib/optee_armtz/"
FILES_${PN}-staticdev = "${libdir}/*.a"

INHIBIT_PACKAGE_STRIP = "1"
<commit_msg>optee-aes-decryptor.bb: Customize OP-TEE user TA directory for i.MX8M<commit_after>SUMMARY = "OPTEE AES Decryptor for Linaro OpenCDM"
DESCRIPTION = "OPTEE AES Decryptor for Linaro OpenCDM"

LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=22b593390e65f8d23beaa6ef10ed6392"
PR="r0"
PV="1.0+git"

DEPENDS = "optee-os optee-client"

PACKAGE_ARCH = "${MACHINE_ARCH}"

SRC_URI = "git://github.com/linaro-home/optee-clearkey-cdmi;protocol=https"
SRCREV = "${AUTOREV}"

S = "${WORKDIR}/git"
B = "${S}"

OPTEE_ARCH ?= "arm32"
OPTEE_ARCH_armv7a = "arm32"
OPTEE_ARCH_aarch64 = "arm64"

OPTEE_EXPORT_USERTA_DIR ?= "export-user_ta"
OPTEE_EXPORT_USERTA_DIR_mx8mq = "export-user_ta_${OPTEE_ARCH}"

#stub
do_configure[noexec] = "1"

EXTRA_OEMAKE = ""
do_compile() {
    export TA_DEV_KIT_DIR=${STAGING_INCDIR}/optee/${OPTEE_EXPORT_USERTA_DIR}
    export TEEC_EXPORT=${STAGING_DIR_HOST}/usr

    oe_runmake -C ${S}/host LDFLAGS=""

    oe_runmake -C ${S}/ta LDFLAGS="" CROSS_COMPILE=${HOST_PREFIX}
}

do_install() {
    mkdir -p ${D}/usr/bin
    mkdir -p ${D}/lib/optee_armtz
    install -d ${D}/${libdir}
    install -m 0644 ${S}/host/*.a ${D}/${libdir}/

    install -d ${D}${includedir}
    install -m 0644 ${S}/host/*.h ${D}${includedir}/

    #ta part
    install -m 444 ${B}/ta/*.ta ${D}/lib/optee_armtz/
}


FILES_${PN} = "${libdir}/*.a  /usr/bin /lib/optee_armtz/"
FILES_${PN}-staticdev = "${libdir}/*.a"

INHIBIT_PACKAGE_STRIP = "1"

{'fraction_non_alphanumeric': 0.18792971734148206, 'fraction_numerical': 0.032467532467532464, 'mean_word_length': 4.269617706237424, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '526752', 'n_tokens_mistral': 1241, 'n_tokens_neox': 1148, 'n_words': 195}