Qt5 env in yocto layer

Discussion in 'Yocto' started by modjo, Dec 7, 2016.

  1. modjo

    modjo Active Member

    Joined:
    Sep 29, 2014
    Messages:
    417
    Likes Received:
    127
    I have some questions about the script in qt5-layer in meta-udoo. In fact, they have a qt5-env.bb that make some tests to write or not some export QT var on qt5-env.sh (if i'm not wrong :rolleyes:) . I'm not sure that is working because if i define a LVDS7 in my local.conf i'm not sure that it modify the file qt5-env.sh ?

    For example, i have found to build qt5.7 it's needed to add fonts in yocto image. At first i have make a recipe that overlay the layer "dejavu" but i don't need to do that ! Just need to export this :

    export QT_QPA_FONTDIR=/usr/share/fonts/truetype/

    To enable this on the card i add it on the qt5-env.sh (+ another var env) :

    #export platforms
    export QT_QPA_PLATFORM=eglfs

    #with the new version of QT5.7, we need to re-define the path to the
    #font (no more delivred with this version)
    export QT_QPA_FONTDIR=/usr/share/fonts/truetype/

    #export size of lvds7 in milimeters
    export QT_QPA_EGLFS_PHYSICAL_HEIGHT=91
    export QT_QPA_EGLFS_PHYSICAL_WIDTH=152

    #export touchscreen event
    export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=/dev/input/event1:inverty

    It work fine on the card, but how we can add this to qt5-env.bb to have a working bb (that we can configure from local.conf)?
     
  2. cyrilf

    cyrilf Active Member

    Joined:
    Feb 19, 2015
    Messages:
    168
    Likes Received:
    47
    You're right. Personally, I edited this file to add the right variables.

    Code:
    SUMMARY = "Add Qt5 bin dir to PATH"
    
    LICENSE = "GPL-2.0"
    LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
    
    SRC_URI = "file://qt5-env.sh"
    
    S = "${WORKDIR}"
    
    HAS_X11 = "${@base_contains('DISTRO_FEATURES', 'x11', 1, 0, d)}"
    HAS_LVDS7 = "${@base_contains('VIDEO_OUTPUT', 'lvds7', 1, 0, d)}"
    
    do_install() {
        install -d ${D}${sysconfdir}/profile.d
        install -m 0755 qt5-env.sh ${D}${sysconfdir}/profile.d
    
        if test ${HAS_X11} -eq 0; then
                cat >> ${D}${sysconfdir}/profile.d/qt5-env.sh <<EOF
    
    
    # QT_QPA_PLATFORM There are multiple platform plugins that are
    # potentially usable on Embedded Linux systems: EGLFS, LinuxFB, KMS,
    # DirectFB, Wayland. The availability of these depend on the
    # configuration of Qt. The default platform plugin is also device
    # specific. For instance, on many boards eglfs will be chosen as the
    # default one. If the default is not suitable, the QT_QPA_PLATFORM
    # environment variable parameter can be used to request another plugin.
    # Alternatively, for quick tests, the -platform command-line can be
    # used with the same syntax.
    export QT_QPA_PLATFORM=eglfs
    EOF
        fi
    
        if test ${HAS_LVDS7} -eq 1; then
                cat >> ${D}${sysconfdir}/profile.d/qt5-env.sh <<EOF
    
    
    # QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT
    # - Physical screen width and height in millimeters. On platforms
    # where the framebuffer device /dev/fb0 is not available or the
    # query is not successful, the values are calculated based on a
    # default DPI of 100. This variable can be used to override any
    # such defaults.
    export QT_QPA_EGLFS_PHYSICAL_HEIGHT=91
    export QT_QPA_EGLFS_PHYSICAL_WIDTH=152
    export QT_QPA_EGLFS_TSLIB=1
    export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=/dev/input/event1:inverty
    export QT_EGLFS_IMX6_NO_FB_MULTI_BUFFER=1
    EOF
        fi
    
        cat >> ${D}${sysconfdir}/profile.d/qt5-env.sh <<EOF
    
    
    # Add fonts path to prevent warnings
    export QT_QPA_FONTDIR=/usr/share/fonts/truetype
    EOF
    
    }
    
    FILES_${PN} = "${sysconfdir}"
    I have an issue to make the touchscreen work with the UDOO Quad. When I start my Qt app, I get this error:
    Code:
    evdevtouch: Cannot open input device /dev/input/event1 (No such file or directory)
    The touchscreen event is in /dev/input/event0.
     
    Last edited: Dec 9, 2016
    modjo likes this.

Share This Page