diff --git a/classes/archiver_stm32mp_clean.bbclass b/classes/archiver_stm32mp_clean.bbclass index 64e085b..e1e0de0 100644 --- a/classes/archiver_stm32mp_clean.bbclass +++ b/classes/archiver_stm32mp_clean.bbclass @@ -43,7 +43,9 @@ archiver_git_uri() { ARCHIVER_ST_REVISION="${SRCREV}" fi - sed -i -e "s|##LINUX_TARNAME##|${LINUX_TARNAME}|g" -e "s|##ARCHIVER_COMMUNITY_BRANCH##|${ARCHIVER_COMMUNITY_BRANCH}|g" -e "s|##ARCHIVER_COMMUNITY_REVISION##|${ARCHIVER_COMMUNITY_REVISION}|g" -e "s|##ARCHIVER_ST_BRANCH##|${ARCHIVER_ST_BRANCH}|g" -e "s|##ARCHIVER_ST_REVISION##|${ARCHIVER_ST_REVISION}|g" -e "s|##BP##|${BP}|g" -e "s|##PV##|${PV}|g" -e "s|##PR##|${PR}|g" ${ARCHIVER_OUTDIR}/${ARCHIVER_README} + if [ -e "${ARCHIVER_OUTDIR}/${ARCHIVER_README}" ]; then + sed -i -e "s|##LINUX_TARNAME##|${LINUX_TARNAME}|g" -e "s|##GCNANO_TARNAME##|${GCNANO_TARNAME}|g" -e "s|##ARCHIVER_COMMUNITY_BRANCH##|${ARCHIVER_COMMUNITY_BRANCH}|g" -e "s|##ARCHIVER_COMMUNITY_REVISION##|${ARCHIVER_COMMUNITY_REVISION}|g" -e "s|##ARCHIVER_ST_BRANCH##|${ARCHIVER_ST_BRANCH}|g" -e "s|##ARCHIVER_ST_REVISION##|${ARCHIVER_ST_REVISION}|g" -e "s|##BP##|${BP}|g" -e "s|##PV##|${PV}|g" -e "s|##PR##|${PR}|g" "${ARCHIVER_OUTDIR}/${ARCHIVER_README}" + fi } do_ar_original[postfuncs] =+ "archiver_git_uri" diff --git a/conf/machine/include/st-machine-common-stm32mp.inc b/conf/machine/include/st-machine-common-stm32mp.inc index cbc2f2b..ceaa450 100644 --- a/conf/machine/include/st-machine-common-stm32mp.inc +++ b/conf/machine/include/st-machine-common-stm32mp.inc @@ -652,6 +652,5 @@ M4_PACKAGE_4USERFS = "${@bb.utils.contains('ST_USERFS','1','1','0',d)}" # ========================================================================= # GCNANO userland configuration # ========================================================================= -# Variable for using vendor directory instead of usr -GCNANO_USERLAND_USE_VENDOR_DIR = "${@bb.utils.contains('ST_VENDORFS','1','1','0',d)}" -GCNANO_USERLAND_VENDOR_DIR = "${STM32MP_VENDORFS_MOUNTPOINT}" +# Configure use of vendorfs if enable to install gcnano libs +GCNANO_USERLAND_OUTPUT_LIBDIR = "${@bb.utils.contains('ST_VENDORFS', '1', '${STM32MP_VENDORFS_MOUNTPOINT}/lib', '${libdir}', d)}" diff --git a/recipes-bsp/drivers/gcnano-driver-stm32mp-archiver.inc b/recipes-bsp/drivers/gcnano-driver-stm32mp-archiver.inc new file mode 100644 index 0000000..1a26986 --- /dev/null +++ b/recipes-bsp/drivers/gcnano-driver-stm32mp-archiver.inc @@ -0,0 +1,13 @@ +SRC_URI:append = " file://README.HOW_TO.txt " + +inherit archiver +ARCHIVER_MODE[src] = "original" + +# Override generated tarball for original with gcnano-driver-stm32mp source tarball +do_set_archiver_tarball() { + rm -f ${ARCHIVER_OUTDIR}/${PF}*.tar.* + cp ${WORKDIR}/git/${GCNANO_DRIVER_TARBALL} ${ARCHIVER_OUTDIR}/${PF}.tar.xz +} +do_ar_original[postfuncs] =+ "do_set_archiver_tarball" + +inherit archiver_stm32mp_clean diff --git a/recipes-bsp/drivers/gcnano-driver-stm32mp.inc b/recipes-bsp/drivers/gcnano-driver-stm32mp.inc index 1aaa9d9..a4fb071 100644 --- a/recipes-bsp/drivers/gcnano-driver-stm32mp.inc +++ b/recipes-bsp/drivers/gcnano-driver-stm32mp.inc @@ -1,8 +1,5 @@ COMPATIBLE_MACHINE = "(stm32mpcommon)" -# To share stm32mp1 patches between layers -FILESEXTRAPATHS:prepend := "${THISDIR}/gcnano-driver-stm32mp:" - inherit module # todo manage android build (sync) diff --git a/recipes-bsp/drivers/gcnano-driver-stm32mp/README.HOW_TO.txt b/recipes-bsp/drivers/gcnano-driver-stm32mp/README.HOW_TO.txt new file mode 100644 index 0000000..f89fb8d --- /dev/null +++ b/recipes-bsp/drivers/gcnano-driver-stm32mp/README.HOW_TO.txt @@ -0,0 +1,39 @@ +Compilation of the gcnano kernel module: +1. Pre-requisite +2. Compile the gcnano kernel module +3. Update software on board + +---------------- +1. Pre-requisite +---------------- + - OpenSTLinux SDK must be installed. + - Linux Kernel source must be installed and built + +---------------- +2. Compile the gcnano kernel module +---------------- +OpenSTLinux SDK must be installed. + +* Compile and install the gcnano kernel module + $> tar xf ##BP##-##PR##.tar.xz + $> cd ##GCNANO_TARNAME## + $> KERNEL_BUILDDIR="../../kernel/kernel-sources" + * Build kernel module + $> make ARCH=arm SOC_PLATFORM=st-st DEBUG=0 O="${KERNEL_BUILDDIR}" M="${PWD}" AQROOT="${PWD}" -C ${KERNEL_BUILDDIR} + +--------------------------- +3. Update software on board +--------------------------- + +3.1 Update via network +---------------------- + Copy kernel modules: + $ scp galcore.ko root@:/lib/modules//extra + + Generate a list of module dependencies (modules.dep) and a list of symbols + provided by modules (modules.symbols): + $ ssh root@ /sbin/depmod -a + Synchronize data on disk with memory + $ ssh root@ sync + Reboot the board in order to take update into account + $ ssh root@ reboot diff --git a/recipes-bsp/drivers/gcnano-driver-stm32mp_6.4.3.bb b/recipes-bsp/drivers/gcnano-driver-stm32mp_6.4.3.bb deleted file mode 100644 index c8960a8..0000000 --- a/recipes-bsp/drivers/gcnano-driver-stm32mp_6.4.3.bb +++ /dev/null @@ -1,32 +0,0 @@ -SUMMARY = "GCNano kernel drivers" -LICENSE = "GPL-1.0-only & MIT" -# Note get md5sum with: $ head -n 53 Makefile | md5sum -LIC_FILES_CHKSUM = "file://Makefile;endline=53;md5=3ad4e99418a2e0f339ecdc29ac648351" - -SRC_URI = "git://github.com/STMicroelectronics/gcnano-binaries;protocol=https;branch=gcnano-6.4.3-binaries" -SRCREV = "1534c3eaabb5ae545a8f97e95f853531365a13fc" - -GCNANO_VERSION = "6.4.3" - -PV = "${GCNANO_VERSION}-tar.${SRCPV}" - -S = "${WORKDIR}/gcnano-driver-${GCNANO_VERSION}" - -include gcnano-driver-stm32mp.inc - -GCNANO_DRIVER_TARBALL = "gcnano-driver-${GCNANO_VERSION}.tar.xz" - -DEPENDS += "xz-native" -do_unpack[depends] += "xz-native:do_populate_sysroot" - -python () { - externalsrc = d.getVar('EXTERNALSRC') - if not externalsrc: - d.prependVarFlag('do_unpack', 'postfuncs', " do_patch_extract_tarball ") -} - -# add to do_patch for untar the tarball -do_patch_extract_tarball() { - bbnote "tar xfJ ${WORKDIR}/git/${GCNANO_DRIVER_TARBALL} -C ${WORKDIR}" - tar xfJ ${WORKDIR}/git/${GCNANO_DRIVER_TARBALL} -C ${WORKDIR} -} diff --git a/recipes-bsp/drivers/gcnano-driver-stm32mp_6.4.7.bb b/recipes-bsp/drivers/gcnano-driver-stm32mp_6.4.7.bb new file mode 100644 index 0000000..a52dd9c --- /dev/null +++ b/recipes-bsp/drivers/gcnano-driver-stm32mp_6.4.7.bb @@ -0,0 +1,41 @@ +SUMMARY = "GCNano kernel drivers" +LICENSE = "GPL-1.0-only & MIT" +# Note get md5sum with: $ head -n 53 Makefile | md5sum +LIC_FILES_CHKSUM = "file://Makefile;endline=53;md5=ec60a845a9f75c1c29ffe3007e9d2cb5" + +SRC_URI = "git://github.com/STMicroelectronics/gcnano-binaries;protocol=https;branch=gcnano-${GCNANO_VERSION}-binaries" +SRCREV = "a20611434ef048d3d0c04f55b6cd7d75a2156d43" + +GCNANO_TARNAME = "gcnano-driver-${GCNANO_VERSION}" + +GCNANO_VERSION = "6.4.7" +GCNANO_SUBVERSION = "stm32mp" +GCNANO_RELEASE = "r1" + +PV = "${GCNANO_VERSION}-${GCNANO_SUBVERSION}-${GCNANO_RELEASE}" + +S = "${WORKDIR}/gcnano-driver-${GCNANO_VERSION}" + +include gcnano-driver-stm32mp.inc + +GCNANO_DRIVER_TARBALL = "${GCNANO_TARNAME}.tar.xz" + +DEPENDS += "xz-native" +do_unpack[depends] += "xz-native:do_populate_sysroot" + +python () { + externalsrc = d.getVar('EXTERNALSRC') + if not externalsrc: + d.prependVarFlag('do_unpack', 'postfuncs', " do_patch_extract_tarball ") +} + +# add to do_patch for untar the tarball +do_patch_extract_tarball() { + bbnote "tar xf ${WORKDIR}/git/${GCNANO_DRIVER_TARBALL} -C ${WORKDIR}" + tar xf ${WORKDIR}/git/${GCNANO_DRIVER_TARBALL} -C ${WORKDIR} +} + +# --------------------------------- +# Configure archiver use +# --------------------------------- +include ${@oe.utils.ifelse(d.getVar('ST_ARCHIVER_ENABLE') == '1', 'gcnano-driver-stm32mp-archiver.inc','')} diff --git a/recipes-graphics/gcnano-userland/gcnano-userland-binary.inc b/recipes-graphics/gcnano-userland/gcnano-userland-binary.inc index eed32ab..85518ba 100644 --- a/recipes-graphics/gcnano-userland/gcnano-userland-binary.inc +++ b/recipes-graphics/gcnano-userland/gcnano-userland-binary.inc @@ -1,39 +1,42 @@ -DESCRIPTION = "STMicrolectronics port of the EGL, GLESv1_CM and GLES_v2 libraries from Vivante for the gcnano 3D core." +require gcnano-userland.inc + LICENSE = "Proprietary" -LIC_FILES_CHKSUM = "file://${TAR_FILENAME}/LICENSE;md5=dd36864f287701862a189a69fc50f1d8" +LIC_FILES_CHKSUM = "file://${GCNANO_TAR_FILENAME}/LICENSE;md5=dd36864f287701862a189a69fc50f1d8" -PACKAGE_ARCH = "${MACHINE_ARCH}" +DEPENDS += " libdrm wayland " -PROVIDES += "gcnano-userland virtual/libgles1 virtual/libgles2 virtual/egl virtual/libvg virtual/libgbm" +SRC_URI = "git://github.com/STMicroelectronics/gcnano-binaries;protocol=https;branch=gcnano-${GCNANO_VERSION}-binaries" +SRCREV = "a20611434ef048d3d0c04f55b6cd7d75a2156d43" -TAR_FILENAME = "gcnano-userland-${BACKEND}-${PV}-${GCNANO_USERLAND_FB_TARBALL_DATE}" +PV = "${GCNANO_VERSION}+${GCNANO_DATE}" -SRC_URI = "git://github.com/STMicroelectronics/gcnano-binaries;protocol=https;branch=gcnano-6.4.3-binaries" -SRCREV = "969d11518529bb70a132909b02ddcc5736c92d91" - -PV = "6.4.3" - -GCNANO_USERLAND_FB_TARBALL_DATE = "20210726" +GCNANO_VERSION = "6.4.7" +GCNANO_DATE = "20220524" S = "${WORKDIR}/git" - -# Variable for using vendor directory instead of usr -GCNANO_USERLAND_USE_VENDOR_DIR ?= "1" -GCNANO_USERLAND_VENDOR_DIR ?= "/vendor" -GCNANO_USERLAND_OUTPUT_LIBDIR = "${@'${GCNANO_USERLAND_VENDOR_DIR}/lib' if d.getVar('GCNANO_USERLAND_USE_VENDOR_DIR') == '1' else '${libdir}'}" - -# Action stubbed -do_configure[noexec] = "1" -do_compile[noexec] = "1" +B = "${S}/${GCNANO_TAR_FILENAME}" #------------------------------------------ # Overwrite of do_unpack to untar the tarball -do_unpack[depends] += "xz-native:do_populate_sysroot" -gcnano_userland_binaries_unpack() { - cd ${S} - sh ${TAR_FILENAME}.bin --auto-accept +python() { + # Make sure that we're dealing with recipe that enables externalsrc class + if bb.data.inherits_class('externalsrc', d): + bb.build.addtask('gcnano_userland_binaries_unpack', 'do_populate_lic', None, d) + bb.build.addtask('gcnano_userland_binaries_unpack', 'do_configure', None, d) } +do_gcnano_userland_binaries_unpack[depends] += "xz-native:do_populate_sysroot" +do_gcnano_userland_binaries_unpack() { + cd ${S} + rm -rf ${GCNANO_TAR_FILENAME} + if [ -f "${GCNANO_TAR_FILENAME}.bin" ]; then + sh ${GCNANO_TAR_FILENAME}.bin --auto-accept + else + bbfatal "Missing '${GCNANO_TAR_FILENAME}.bin' file in ${S} folder." + fi +} + +do_unpack[depends] += "xz-native:do_populate_sysroot" python do_unpack() { eula = d.getVar('ACCEPT_EULA_'+d.getVar('MACHINE')) eula_file = d.getVar('EULA_FILE_ST') @@ -52,142 +55,8 @@ python do_unpack() { externalsrc = d.getVar('EXTERNALSRC') if not externalsrc: bb.build.exec_func('base_do_unpack', d) - bb.build.exec_func('gcnano_userland_binaries_unpack', d) + bb.build.exec_func('do_gcnano_userland_binaries_unpack', d) except: raise } do_unpack[vardepsexclude] += "EULA_FILE_ST" - -#------------------------------------------ -# clean -# -clean_release_file() { - rm -f ${D}/vendor/lib/*.multi.release.so - rm -f ${D}${libdir}/*.multi.release.so -} -clean_debug_file() { - rm -f ${D}/vendor/lib/*.multi.debug.so - rm -f ${D}${libdir}/*.multi.debug.so -} - -#------------------------------------------ -# Do install -# -create_link() { - prefix=$1 - library_link=$2 - library_src_relative_path_to_dst=$3 - library_dst=$4 - LINK=`readlink $prefix/$library_dst/$library_src_relative_path_to_dst/$library_link` - if [ -L $prefix/$library_dst/$library_src_relative_path_to_dst/$LINK ]; - then - # point on a link, need to get the path of link - SUBLINK=$(readlink $prefix/$library_dst/$library_src_relative_path_to_dst/$LINK) - ln -sf $library_src_relative_path_to_dst/$SUBLINK $prefix/$library_dst/$library_link - else - ln -sf $library_src_relative_path_to_dst/$LINK $prefix/$library_dst/$library_link - fi -} -do_install() { - if [ ${GCNANO_USERLAND_USE_VENDOR_DIR} -eq 1 ]; - then - install -m 755 -d ${D}/${GCNANO_USERLAND_OUTPUT_LIBDIR}/ ${D}${libdir} - cp -R ${S}/${TAR_FILENAME}/usr ${D}/ - mv ${D}${libdir}/*.so* ${D}/${GCNANO_USERLAND_OUTPUT_LIBDIR}/ - - cd ${D}${libdir}/ - if [ -e ${D}/${GCNANO_USERLAND_OUTPUT_LIBDIR}/gbm_viv.so ]; - then - ln -sf ../..${GCNANO_USERLAND_OUTPUT_LIBDIR}/gbm_viv.so ${D}${libdir}/gbm_viv.so - fi - if [ -e ${D}/${GCNANO_USERLAND_OUTPUT_LIBDIR}/libgbm_viv.so ]; - then - ln -sf ../..${GCNANO_USERLAND_OUTPUT_LIBDIR}/libgbm_viv.so ${D}${libdir}/libgbm_viv.so - fi - for link in `find ${D}/${GCNANO_USERLAND_OUTPUT_LIBDIR} -type l`; - do - library_link=`basename $link` - create_link ${D} $library_link ../..${GCNANO_USERLAND_OUTPUT_LIBDIR} ${libdir} - done - - chown -R root.root ${D}/${GCNANO_USERLAND_OUTPUT_LIBDIR} ${D}${libdir}/ - else - install -m 755 -d ${D}/usr/ - cp -aR ${S}/${TAR_FILENAME}/usr ${D}/ - fi - - # remove remove libwayland-egl which are now provided by wayland - if test -f ${D}${GCNANO_USERLAND_OUTPUT_LIBDIR}/libwayland-egl.so ; - then - rm ${D}${GCNANO_USERLAND_OUTPUT_LIBDIR}/libwayland-egl.so* - fi - if test -L ${D}${libdir}/libwayland-egl.so ; - then - rm ${D}${libdir}/libwayland-egl.so* - fi - if test -f ${D}${libdir}/pkgconfig/wayland-egl.pc ; - then - rm ${D}${libdir}/pkgconfig/wayland-egl.pc - fi - - chown -R root.root ${D}/${GCNANO_USERLAND_OUTPUT_LIBDIR} ${D}${libdir}/ -} - -# Cannot split or strip last added firmwares -INHIBIT_PACKAGE_DEBUG_SPLIT = "1" -INHIBIT_PACKAGE_STRIP = "1" -INHIBIT_SYSROOT_STRIP = "1" - -# Avoid QA Issue: No GNU_HASH in the elf binary -INSANE_SKIP:${PN} += "ldflags" - -# Avoid QA Issue: non -dev/-dbg/nativesdk- package contains symlink .so -INSANE_SKIP:${PN} += "dev-so" -# Avoid QA Issue: file-rdeps -INSANE_SKIP:${PN} += "file-rdeps" -# Avoid QA Issue: debug-deps -INSANE_SKIP:${PN} += "debug-deps" - -INSANE_SKIP:${PN}-dev += "dev-elf dev-so ldflags file-rdeps" - -# Monolitic configuration -RPROVIDES:${PN} = "libegl libegl1 libgles1 libglesv1-cm1 libgles2 libglesv2-2 libvg libgbm gbm_viv" -RREPLACES:${PN} = "libegl libegl1 libgles1 libglesv1-cm1 libgles2 libglesv2-2 libvg libgbm gbm_viv" -RCONFLICTS:${PN} = "libegl libegl1 libgles1 libglesv1-cm1 libgles2 libglesv2-2 libvg libgbm gbm_viv" - -PACKAGES = "${PN} ${PN}-dev " - -SUMMARY:${PN} = "${SUMMARY}" -FILES:${PN} = "${GCNANO_USERLAND_OUTPUT_LIBDIR}/libEGL.so* ${GCNANO_USERLAND_OUTPUT_LIBDIR}/libEGL.*.${GCNANO_TYPE}.so" -FILES:${PN} += "${GCNANO_USERLAND_OUTPUT_LIBDIR}/libGLESv1_CM.so ${GCNANO_USERLAND_OUTPUT_LIBDIR}/libGLESv1_CM.*.${GCNANO_TYPE}.so" -FILES:${PN} += "${GCNANO_USERLAND_OUTPUT_LIBDIR}/libGLESv2.so* ${GCNANO_USERLAND_OUTPUT_LIBDIR}/libGLESv2.*.${GCNANO_TYPE}.so" -FILES:${PN} += "${GCNANO_USERLAND_OUTPUT_LIBDIR}/libOpenVG.so ${GCNANO_USERLAND_OUTPUT_LIBDIR}/libOpenVG.*.${GCNANO_TYPE}.so" -FILES:${PN} += "${GCNANO_USERLAND_OUTPUT_LIBDIR}/libGAL.so ${GCNANO_USERLAND_OUTPUT_LIBDIR}/libGAL.*.${GCNANO_TYPE}.so" -FILES:${PN} += "${GCNANO_USERLAND_OUTPUT_LIBDIR}/libVSC.so ${GCNANO_USERLAND_OUTPUT_LIBDIR}/libVSC.*.${GCNANO_TYPE}.so" -FILES:${PN} += "${GCNANO_USERLAND_OUTPUT_LIBDIR}/libGLSLC.so ${GCNANO_USERLAND_OUTPUT_LIBDIR}/libGLSLC.*.${GCNANO_TYPE}.so" -FILES:${PN} += "${GCNANO_USERLAND_OUTPUT_LIBDIR}/libgbm.so* ${GCNANO_USERLAND_OUTPUT_LIBDIR}/libgbm.*.${GCNANO_TYPE}.so*" -FILES:${PN} += "${GCNANO_USERLAND_OUTPUT_LIBDIR}/libwayland-viv*.so*" -FILES:${PN} += "${GCNANO_USERLAND_OUTPUT_LIBDIR}/gbm_viv.so ${GCNANO_USERLAND_OUTPUT_LIBDIR}/gbm_viv.*.${GCNANO_TYPE}.so" -FILES:${PN} += "${GCNANO_USERLAND_OUTPUT_LIBDIR}/libgbm_viv.so ${GCNANO_USERLAND_OUTPUT_LIBDIR}/libgbm_viv.*.${GCNANO_TYPE}.so" - -FILES:${PN} += "${libdir}/lib*.so ${libdir}/lib*${SOLIBS} ${libdir}/gbm*" - -SUMMARY:${PN}-dev = "${SUMMARY_${PN}} - Development files" -FILES:${PN}-dev = "${includedir} ${libdir}/pkgconfig/ ${libdir}/" - -gcnano_sysroot() { - if [ ${GCNANO_USERLAND_USE_VENDOR_DIR} -eq 1 ]; - then - # put all lthe library for on a same directory - # clean usr and ${GCNANO_USERLAND_OUTPUT_LIBDIR} - rm -rf ${SYSROOT_DESTDIR}/${libdir} ${SYSROOT_DESTDIR}/${GCNANO_USERLAND_OUTPUT_LIBDIR} - #copy from tarball - cp -aR ${S}/${TAR_FILENAME}/usr ${SYSROOT_DESTDIR}/ - if test -f ${SYSROOT_DESTDIR}/${libdir}/libwayland-egl.so ; - then - rm ${SYSROOT_DESTDIR}${libdir}/libwayland-egl.so* - rm ${SYSROOT_DESTDIR}${libdir}/pkgconfig/wayland-egl.pc - fi - fi -} -SYSROOT_PREPROCESS_FUNCS =+ "gcnano_sysroot" diff --git a/recipes-graphics/gcnano-userland/gcnano-userland-multi-binary-debug-stm32mp.bb b/recipes-graphics/gcnano-userland/gcnano-userland-multi-binary-debug-stm32mp.bb index d3b6c02..45adc76 100644 --- a/recipes-graphics/gcnano-userland/gcnano-userland-multi-binary-debug-stm32mp.bb +++ b/recipes-graphics/gcnano-userland/gcnano-userland-multi-binary-debug-stm32mp.bb @@ -1,17 +1,11 @@ -# Recipe for installing gcnano-userland binaries (gbm backend) +require gcnano-userland-binary.inc + SUMMARY = "[DEBUG] Vivante libraries OpenGL ES, OpenVG and EGL (multi backend)" LICENSE = "Proprietary" -BACKEND = "multi" +GCNANO_PACKAGECONFIG = "egl glesv1 glesv2 vg gbm" -DEPENDS += " libdrm wayland " - -GCNANO_TYPE = "debug" - -do_install:append() { - clean_release_file -} - -include gcnano-userland-binary.inc +GCNANO_BACKEND = "multi" +GCNANO_FLAVOUR = "debug" PROVIDES:remove = "gcnano-userland" diff --git a/recipes-graphics/gcnano-userland/gcnano-userland-multi-binary-stm32mp.bb b/recipes-graphics/gcnano-userland/gcnano-userland-multi-binary-stm32mp.bb index fef1aaa..f674e8c 100644 --- a/recipes-graphics/gcnano-userland/gcnano-userland-multi-binary-stm32mp.bb +++ b/recipes-graphics/gcnano-userland/gcnano-userland-multi-binary-stm32mp.bb @@ -1,15 +1,9 @@ -# Recipe for installing gcnano-userland binaries (gbm backend) +require gcnano-userland-binary.inc + SUMMARY = "Vivante libraries OpenGL ES, OpenVG and EGL (multi backend)" LICENSE = "Proprietary" -BACKEND = "multi" +GCNANO_PACKAGECONFIG = "egl gbm glesv1 glesv2 vg" -DEPENDS += " libdrm wayland " - -GCNANO_TYPE = "release" - -do_install:append() { - clean_debug_file -} - -include gcnano-userland-binary.inc +GCNANO_BACKEND = "multi" +GCNANO_FLAVOUR = "release" diff --git a/recipes-graphics/gcnano-userland/gcnano-userland.inc b/recipes-graphics/gcnano-userland/gcnano-userland.inc new file mode 100644 index 0000000..b5bf14d --- /dev/null +++ b/recipes-graphics/gcnano-userland/gcnano-userland.inc @@ -0,0 +1,247 @@ +PACKAGE_ARCH = "${MACHINE_ARCH}" + +GCNANO_PACKAGECONFIG ??= "" + +PROVIDES = "\ + gcnano-userland \ + ${@bb.utils.contains('GCNANO_PACKAGECONFIG', 'egl', 'virtual/egl', '', d)} \ + ${@bb.utils.contains('GCNANO_PACKAGECONFIG', 'gbm', 'virtual/libgbm', '', d)} \ + ${@bb.utils.contains('GCNANO_PACKAGECONFIG', 'glesv1', 'virtual/libgles1', '', d)} \ + ${@bb.utils.contains('GCNANO_PACKAGECONFIG', 'glesv2', 'virtual/libgles2', '', d)} \ + ${@bb.utils.contains('GCNANO_PACKAGECONFIG', 'vg', 'virtual/libopenvg', '', d)} \ + " + +PACKAGES += "\ + gcnano-ldconf \ + libgal-gcnano libgal-gcnano-dev \ + ${@bb.utils.contains('GCNANO_PACKAGECONFIG', 'egl', 'libegl-gcnano libegl-gcnano-dev', '', d)} \ + ${@bb.utils.contains('GCNANO_PACKAGECONFIG', 'gbm', 'libgbm-gcnano libgbm-gcnano-dev', '', d)} \ + ${@bb.utils.contains('GCNANO_PACKAGECONFIG', 'glesv1', 'libgles1-gcnano libgles1-gcnano-dev', '', d)} \ + ${@bb.utils.contains('GCNANO_PACKAGECONFIG', 'glesv2', 'libgles2-gcnano libgles2-gcnano-dev', '', d)} \ + ${@bb.utils.contains('GCNANO_PACKAGECONFIG', 'vg', 'libopenvg-gcnano libopenvg-gcnano-dev', '', d)} \ + " + +GCNANO_BACKEND ??= "multi" +GCNANO_VERSION ??= "6" +GCNANO_DATE ??= "" + +# Init the gcnano library version +GCNANO_LIBVERSION ?= "${GCNANO_VERSION}.${GCNANO_BACKEND}" + +# Init the gcnano build type +GCNANO_FLAVOUR ??= "release" + +# Init the gcnano tarball file name +GCNANO_TAR_FILENAME ?= "gcnano-userland-${GCNANO_BACKEND}-${GCNANO_VERSION}-${GCNANO_DATE}" + +# Configure gcnano output library dir +GCNANO_USERLAND_OUTPUT_LIBDIR ??= "${libdir}" + +GCNANO_USERLAND_LDCONF ?= "gcnano.conf" + +# Configure the pkgconfig settings +PKGCONFIG_DV ??= "21.1.1" +PKGCONFIG_PREFIX ??= "${exec_prefix}" + +do_compile:append() { + # Generate specific conf file if required + if [ "${GCNANO_USERLAND_OUTPUT_LIBDIR}" = "${libdir}" ]; then + bbnote "gcnano-userland output libdir is default one (${libdir})" + else + bbnote "gcnano-userland output libdir set to ${GCNANO_USERLAND_OUTPUT_LIBDIR}: generate specific conf file for ldconfig" + echo ${GCNANO_USERLAND_OUTPUT_LIBDIR} > ${B}/${GCNANO_USERLAND_LDCONF} + fi +} + +# Install utility for gcano-userland: +# gcnano_install_lib \ +# \ +# +gcnano_install_lib() { + # Init for lib dir install + gcnano_libdir=$1 + gcnano_libdir_install=$2 + # Init for include dir install + gcnano_incdir=$3 + gcnano_incdir_install=$4 + # Init for package config install + gcnano_pkgdir=$5 + gcnano_pkgdir_install=$6 + + # Install libraries + install -m 0755 -d ${gcnano_libdir_install} + + # Install libraries + install -m 0555 ${gcnano_libdir}/libGAL.so ${gcnano_libdir_install}/ + install -m 0555 ${gcnano_libdir}/libVSC.so ${gcnano_libdir_install}/ + # Install includes + install -m 0755 -d ${gcnano_incdir_install}/KHR + install -m 0644 ${gcnano_incdir}/KHR/* ${gcnano_incdir_install}/KHR + + for lib in ${GCNANO_PACKAGECONFIG}; do + case ${lib} in + "egl") + # Install libraries + find ${gcnano_libdir}/* -type f -name libEGL.so* -exec install -m 0555 '{}' ${gcnano_libdir_install}/ \; + find ${gcnano_libdir}/* -type l -name libEGL.so* -exec cp -d '{}' ${gcnano_libdir_install}/ \; + # Install includes + install -m 0755 -d ${gcnano_incdir_install}/EGL + install -m 0644 ${gcnano_incdir}/EGL/* ${gcnano_incdir_install}/EGL + # Install pkgconfig + install -m 0755 -d ${gcnano_pkgdir_install} + install -m 0644 ${gcnano_pkgdir}/egl.pc ${gcnano_pkgdir_install}/ + ;; + "gbm") + # Install libraries + find ${gcnano_libdir}/* -type f -name libgbm.so* -exec install -m 0555 '{}' ${gcnano_libdir_install}/ \; + find ${gcnano_libdir}/* -type l -name libgbm.so* -exec cp -d '{}' ${gcnano_libdir_install}/ \; + install -m 0755 ${gcnano_libdir}/libgbm_viv.so ${gcnano_libdir_install}/ + # Install includes + install -m 0755 -d ${gcnano_incdir_install} + if [ -e "${gcnano_incdir}/gbm/gbm.h" ]; then + install -m 0644 ${gcnano_incdir}/gbm/gbm.h ${gcnano_incdir_install}/ + else + install -m 0644 ${gcnano_incdir}/gbm.h ${gcnano_incdir_install}/ + fi + # Install pkgconfig + install -m 0755 -d ${gcnano_pkgdir_install} + install -m 644 ${gcnano_pkgdir}/gbm.pc ${gcnano_pkgdir_install}/ + ;; + "glesv1") + # Install libraries + install -m 0555 ${gcnano_libdir}/libGLESv1_CM.so ${gcnano_libdir_install}/ + # Install includes + install -m 0755 -d ${gcnano_incdir_install}/GLES + install -m 0644 ${gcnano_incdir}/GLES/* ${gcnano_incdir_install}/GLES + # Install pkgconfig + install -m 0755 -d ${gcnano_pkgdir_install} + install -m 644 ${gcnano_pkgdir}/glesv1_cm.pc ${gcnano_pkgdir_install}/ + ;; + "glesv2") + # Install libraries + install -m 0555 ${gcnano_libdir}/libGLSLC.so ${gcnano_libdir_install}/ + find ${gcnano_libdir}/* -type f -name libGLESv2.so* -exec install -m 0555 '{}' ${gcnano_libdir_install}/ \; + find ${gcnano_libdir}/* -type l -name libGLESv2.so* -exec cp -d '{}' ${gcnano_libdir_install}/ \; + # Install includes + install -m 0755 -d ${gcnano_incdir_install}/GLES2 + install -m 0644 ${gcnano_incdir}/GLES2/* ${gcnano_incdir_install}/GLES2 + # Install pkgconfig + install -m 0755 -d ${gcnano_pkgdir_install} + install -m 644 ${gcnano_pkgdir}/glesv2.pc ${gcnano_pkgdir_install}/ + ;; + "vg") + # Install libraries + find ${gcnano_libdir}/* -type f -name libOpenVG*.so* -exec install -m 0555 '{}' ${gcnano_libdir_install}/ \; + find ${gcnano_libdir}/* -type l -name libOpenVG*.so* -exec cp -d '{}' ${gcnano_libdir_install}/ \; + # Install includes + install -m 0755 -d ${gcnano_incdir_install}/VG + install -m 0644 ${gcnano_incdir}/VG/* ${gcnano_incdir_install}/VG + # Install pkgconfig + install -m 0755 -d ${gcnano_pkgdir_install} + install -m 644 ${gcnano_pkgdir}/vg.pc ${gcnano_pkgdir_install}/ + ;; + esac + done +} + +do_install() { + # Update pkgconfig files info + for pkg_file in $(find ${B}/pkgconfig/* -type f -name *.pc); do + sed -e "s;#PREFIX#;${PKGCONFIG_PREFIX};g" -e "s;#VERSION#;${PKGCONFIG_DV};g" -i ${pkg_file} + done + + # Install gcnano libraries + gcnano_install_lib "${B}/${GCNANO_FLAVOUR}/drivers" "${D}${GCNANO_USERLAND_OUTPUT_LIBDIR}" \ + "${B}/${GCNANO_FLAVOUR}/include" "${D}${includedir}" \ + "${B}/pkgconfig" "${D}${libdir}/pkgconfig" + + if [ -s "${B}/${GCNANO_USERLAND_LDCONF}" ]; then + install -d ${D}${sysconfdir}/ld.so.conf.d/ + install -m 0644 "${B}/${GCNANO_USERLAND_LDCONF}" ${D}${sysconfdir}/ld.so.conf.d/ + fi +} + +# Manage install for gcnano-userland libs into specific folder for sysroot as well +gcnano_sysroot() { + if [ "${GCNANO_USERLAND_OUTPUT_LIBDIR}" != "${libdir}" ]; then + install -d ${SYSROOT_DESTDIR}${libdir} + cp -aR ${D}${GCNANO_USERLAND_OUTPUT_LIBDIR}/* ${SYSROOT_DESTDIR}${libdir}/ + fi +} +SYSROOT_PREPROCESS_FUNCS =+ "gcnano_sysroot" + +# For the packages that make up the OpenGL interfaces, inject variables so that +# they don't get Debian-renamed (which would remove the -gcnano suffix), and +# RPROVIDEs/RCONFLICTs on the generic libgl name. +python __anonymous() { + pkgconfig = (d.getVar('GCNANO_PACKAGECONFIG') or "").split() + for p in (("gbm", "libgbm", "libgbm"), + ("egl", "libegl", "libegl1"), + ("gles", "libgles1", "libglesv1-cm1"), + ("gles", "libgles2", "libglesv2-2"), + ("vg", "libopenvg", "libopenvg")): + if not p[0] in pkgconfig: + continue + fullp = p[1] + "-gcnano" + pkgs = " ".join(p[1:]) + d.setVar("DEBIAN_NOAUTONAME_" + fullp, "1") + d.appendVar("RREPLACES:" + fullp, pkgs) + d.appendVar("RPROVIDES:" + fullp, pkgs) + d.appendVar("RCONFLICTS:" + fullp, pkgs) + + if d.getVar("GCNANO_USERLAND_OUTPUT_LIBDIR") != d.getVar("libdir"): + d.appendVar("RDEPENDS:" + fullp, " gcnano-ldconf") + + # For -dev, the first element is both the Debian and original name + fullp += "-dev" + pkgs = p[1] + "-dev" + d.setVar("DEBIAN_NOAUTONAME_" + fullp, "1") + d.appendVar("RREPLACES:" + fullp, pkgs) + d.appendVar("RPROVIDES:" + fullp, pkgs) + d.appendVar("RCONFLICTS:" + fullp, pkgs) +} + +FILES:${PN} = "" +FILES:gcnano-ldconf = "${sysconfdir}/" +FILES:libgal-gcnano = "${GCNANO_USERLAND_OUTPUT_LIBDIR}/libGAL.so" +FILES:libgal-gcnano += "${GCNANO_USERLAND_OUTPUT_LIBDIR}/libVSC.so" +FILES:libegl-gcnano = "${GCNANO_USERLAND_OUTPUT_LIBDIR}/libEGL.so*" +FILES:libgbm-gcnano = "${GCNANO_USERLAND_OUTPUT_LIBDIR}/libgbm.so*" +FILES:libgbm-gcnano += "${GCNANO_USERLAND_OUTPUT_LIBDIR}/libgbm_viv.so" +FILES:libgles1-gcnano = "${GCNANO_USERLAND_OUTPUT_LIBDIR}/libGLESv1*.so" +FILES:libgles2-gcnano = "${GCNANO_USERLAND_OUTPUT_LIBDIR}/libGLESv2.so" +FILES:libgles2-gcnano += "${GCNANO_USERLAND_OUTPUT_LIBDIR}/libGLSLC.so" +FILES:libopenvg-gcnano = "${GCNANO_USERLAND_OUTPUT_LIBDIR}/libOpenVG*.so*" + +FILES:${PN}-dev = "" +FILES:libegl-gcnano-dev = "${includedir}/EGL ${includedir}/KHR ${libdir}/pkgconfig/egl.pc" +FILES:libgbm-gcnano-dev = "${includedir}/gbm.h ${libdir}/pkgconfig/gbm.pc" +FILES:libgles1-gcnano-dev = "${includedir}/GLES ${libdir}/pkgconfig/glesv1*.pc" +FILES:libgles2-gcnano-dev = "${includedir}/GLES2 ${libdir}/pkgconfig/glesv2.pc" +FILES:libopenvg-gcnano-dev = "${includedir}/VG ${libdir}/pkgconfig/vg.pc" + +# Set gcnano-userland package with runtime dependencies on all packages +RDEPENDS:${PN} += "\ + libgal-gcnano \ + ${@bb.utils.contains('GCNANO_PACKAGECONFIG', 'egl', 'libegl-gcnano', '', d)} \ + ${@bb.utils.contains('GCNANO_PACKAGECONFIG', 'gbm', 'libgbm-gcnano', '', d)} \ + ${@bb.utils.contains('GCNANO_PACKAGECONFIG', 'glesv1', 'libgles1-gcnano', '', d)} \ + ${@bb.utils.contains('GCNANO_PACKAGECONFIG', 'glesv2', 'libgles2-gcnano', '', d)} \ + ${@bb.utils.contains('GCNANO_PACKAGECONFIG', 'vg', 'libopenvg-gcnano', '', d)} \ + " + +# Generate empty gcnano-userland package to install all dependencies +ALLOW_EMPTY:${PN} = "1" + +# Avoid QA Issue: No GNU_HASH in the elf binary +INSANE_SKIP:libgal-gcnano += "ldflags" +INSANE_SKIP:libegl-gcnano += "ldflags" +INSANE_SKIP:libgbm-gcnano += "ldflags" +INSANE_SKIP:libgles1-gcnano += "ldflags" +INSANE_SKIP:libgles2-gcnano += "ldflags" +INSANE_SKIP:libopenvg-gcnano += "ldflags" + +# Avoid QA Issue: non -dev/-dbg/nativesdk- package contains symlink .so +INSANE_SKIP:libegl-gcnano += "dev-so" +INSANE_SKIP:libgbm-gcnano += "dev-so" +INSANE_SKIP:libopenvg-gcnano += "dev-so"