My Setup
On Debian 7.8, I built my own Linux + Qt 5.4 + QtWebEngine + QML plugins distribution for Raspberry Pi 2 using Yocto Poky.
See excellentEmbarcados tutorial HERE
mkdir -p ~/yocto/dl
cd ~/yocto
git clone -b fido git://git.yoctoproject.org/poky poky
cd poky
git clone git://git.yoctoproject.org/meta-raspberrypi
git clone -b fido https://github.com/meta-qt5/meta-qt5.git
git clone -b fido git://git.openembedded.org/meta-openembedded
git clone -b fido https://bitbucket.org/embarcados/meta-embarcados.git
Config
otto@marvin:~/yocto/build$ vi ~/yocto/build/conf/bblayers.conf
# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
LCONF_VERSION = "6"
BBPATH = "${TOPDIR}"
BBFILES ?= ""
BBLAYERS ?= " \
${TOPDIR}/../poky/meta-embarcados \
${TOPDIR}/../poky/meta-embarcados/meta-rpi \
${TOPDIR}/../poky/meta-raspberrypi \
${TOPDIR}/../poky/meta-qt5 \
${TOPDIR}/../poky/meta-openembedded/meta-oe \
${TOPDIR}/../poky/meta-openembedded/meta-ruby \
/home/otto/yocto/poky/meta \
/home/otto/yocto/poky/meta-yocto \
/home/otto/yocto/poky/meta-yocto-bsp \
"
BBLAYERS_NON_REMOVABLE ?= " \
/home/otto/yocto/poky/meta \
/home/otto/yocto/poky/meta-yocto \
"
In the /home/otto/yocto/build/conf/local.conf
add MACHINE = "raspberrypi2"
Added QtWebEngine + QML plugins to image
vi ../poky/meta-embarcados/meta-rpi/recipes-core/images/qt5-image-demo.bbappend
IMAGE_INSTALL += "\
packagegroup-qt5-machine-related \
qtwebengine \ => /usr/lib/qt5/libexec/QtWebEngineProcess
qtwebengine-qmlplugins \ => /usr/lib/qt5/qml/QtWebEngine
"
Built the image
cd ~/yocto
. poky/oe-init-build-env build
bitbake qt5-image-demo
Running my simple QML
root@raspberrypi2:~# more chromium.qml
import QtQuick 2.1
import QtQuick.Controls 1.1
import QtWebEngine 1.0
ApplicationWindow {
width: 640
height: 480
color: "lightgray"
visible: true
WebEngineView {
id: webview
url: "file:///home/root/hello.html"
anchors.fill: parent
}
}
The Error
root@raspberrypi2:~# /usr/bin/qt5/qmlscene chromium.qml --platform eglfs
file:///home/root/chromium.qml:3 plugin cannot be loaded for module "QtWebEngine": Cannot load library /usr/lib/qt5/qml/QtWebEngine/libqtwebengineplugin.so: (/usr/lib/libexpat.so.1: invalid ELF header)
Any pointers?
What is the invalid ELF header
telling?