Skip to contentSkip to conversation

Qt WebEngine support

PATCH Superseded Gaël PORTAY 3 participants 7 messages Jul 17, 2017 – Jul 18, 2017 Broadcom BCM2711/BCM2835 Arm architecture

v3 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

v3 cover Qt WebEngine support

The purpose of this patch series is to continue the integration of Qt5 WebEngine in buildroot; started long time ago by Akihiko Odaki [1] and Julien Corjon [2].

The first patch fixes the rpi-userland OpenGL libraries symlinks. WebEngine eglfs backend is linked against libEGL.so.1 and libGLESv2.so.2.

	# ls -l /usr/lib/lib*GL*
	lrwxrwxrwx    1 root     root            11 Mar 21 17:24 /usr/lib/libEGL.so -> libEGL.so.1
	lrwxrwxrwx    1 root     root            15 Mar 21 17:24 /usr/lib/libEGL.so.1 -> libEGL.so.1.0.0
	-rwxr-xr-x    1 root     root        163152 Mar 22 14:56 /usr/lib/libEGL.so.1.0.0
	lrwxrwxrwx    1 root     root            14 Mar 21 17:24 /usr/lib/libGLESv2.so -> libGLESv2.so.2
	lrwxrwxrwx    1 root     root            18 Mar 21 17:24 /usr/lib/libGLESv2.so.2 -> libGLESv2.so.2.0.0
	-rwxr-xr-x    1 root     root         78788 Mar 22 14:56 /usr/lib/libGLESv2.so.2.0.0

The second patch provides the Qt WebEngine package.

The last patch is a special defconfig that provides a Qt WebEngine setup on raspberrypi3.

With this patchset, one can run the Qt quicknanobrowser sample on a rpi3 with the following options:
- BR2_TOOLCHAIN_BUILDROOT_LIBC="glibc" and BR2_TOOLCHAIN_BUILDROOT_CXX=y (Qt 5 needs a toolchain w/ wchar, NPTL, C++, dynamic library)
- BR2_PACKAGE_LIBERATION (Qt 5.8 requires a least one font)
- BR2_PACKAGE_RPI_USERLAND (to enable OpenGL backend)
- BR2_PACKAGE_QT5BASE_LICENSE_APPROVED (to not prompt for license agreement; webengine takes many hours to be compiled (and maybe more!))
- BR2_PACKAGE_QT5BASE_EXAMPLES (to install quicknanobrowser sample)
- BR2_PACKAGE_QT5QUICKCONTROLS (needed by quicknanobrowser)
- BR2_PACKAGE_QT5WEBENGINE (because it is what we want :))

To browse for HTTPS websites, please consider adding the following options as well:
- BR2_PACKAGE_CA_CERT (for certificates)
- BR2_PACKAGE_NTPD (to sync date)

To run quicknanobrowser:

	# cd /usr/lib/qt/examples/webengine/quicknanobrowser/
	# ./quicknanobrowser

Enjoy ;)

Note: For now, quicknanobrowser will just display the qt website without any input backend.

[1] https://patchwork.ozlabs.org/patch/640633/
[2] http://lists.busybox.net/pipermail/buildroot/2015-July/132010.html

Changes since RFC:
- rebase to master (use SPDX licenses, remove license approved, update qt5_defconfig...)
- remove the patch "prefer arm tune"
- disable build with Qt 5.6 LTS (not working, waiting for 5.6.3 in August)
- re-order patches

Changes since v1:
- manually create symlinks to preserve SONAME
- add my signed-off-by to the rpi-userland patch
- make qtwe package depends on supported architectures
- fix Kconfig comment about Qt 5.6
- sort alphabetically chromium licenses

Changes since v2:
- fix build issue when I sorted alphabetically the chromium licenses
- replace legacy option BR2_TARGET_ROOTFS_EXT2_BLOCK to new option BR2_TARGET_ROOTFS_EXT2_SIZE

Ga?l PORTAY (3):
rpi-userland: fix opengl library symlinks
qt5webengine: new package
configs: new raspberrypi3 qt5 config

 configs/raspberrypi3_qt5_defconfig                 |  47 ++++
 package/qt5/Config.in                              |   1 +
 .../qt5webengine/0001-change-default-ssl-dir.patch |  19 ++
 package/qt5/qt5webengine/Config.in                 |  51 +++++
 package/qt5/qt5webengine/chromium.inc              | 239 +++++++++++++++++++++
 package/qt5/qt5webengine/qt5webengine.hash         |   5 +
 package/qt5/qt5webengine/qt5webengine.mk           |  77 +++++++
 .../0001-Add-OpenGL-library-versioning.patch       |  35 +++
 8 files changed, 474 insertions(+)
 create mode 100644 configs/raspberrypi3_qt5_defconfig
 create mode 100644 package/qt5/qt5webengine/0001-change-default-ssl-dir.patch
 create mode 100644 package/qt5/qt5webengine/Config.in
 create mode 100644 package/qt5/qt5webengine/chromium.inc
 create mode 100644 package/qt5/qt5webengine/qt5webengine.hash
 create mode 100644 package/qt5/qt5webengine/qt5webengine.mk
 create mode 100644 package/rpi-userland/0001-Add-OpenGL-library-versioning.patch
Signature · 1 line
2.13.2
#1 lore raw

PATCH v3 1/3 rpi-userland: fix opengl library symlinks

The Qt WebEngine module loads libEGL.so.1 and libGLESv2.so.2 libraries. Their path are hard-coded [1].

This patch sets up cmake to create those library links.

	# ls -l /usr/lib/lib*GL*
	lrwxrwxrwx    1 root     root            11 Mar 21 17:24 /usr/lib/libEGL.so -> libEGL.so.1
	lrwxrwxrwx    1 root     root            15 Mar 21 17:24 /usr/lib/libEGL.so.1 -> libEGL.so.1.0.0
	-rwxr-xr-x    1 root     root        163152 Mar 22 14:56 /usr/lib/libEGL.so.1.0.0
	lrwxrwxrwx    1 root     root            14 Mar 21 17:24 /usr/lib/libGLESv2.so -> libGLESv2.so.2
	lrwxrwxrwx    1 root     root            18 Mar 21 17:24 /usr/lib/libGLESv2.so.2 -> libGLESv2.so.2.0.0
	-rwxr-xr-x    1 root     root         78788 Mar 22 14:56 /usr/lib/libGLESv2.so.2.0.0

[1] https://github.com/qt/qtwebengine/blob/5.8/src/core/surface_factory_qt.cpp#L76-L86

---
 .../0001-Add-OpenGL-library-versioning.patch       | 35 ++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 package/rpi-userland/0001-Add-OpenGL-library-versioning.patch
package/rpi-userland/0001-Add-OpenGL-library-versioning.patch new file +35 -0
new file mode 100644
index 0000000000..ea708f9559
@@ -0,0 +1,35 @@
+From bf388550943afc70798c497e3fc706303394cfdc Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Ga=C3=ABl=20PORTAY?= <[email protected]>
+Date: Fri, 3 Mar 2017 17:28:41 -0500
+Subject: [PATCH] Add OpenGL library versioning
+
+Some applications like QtWebEngine dynamically load libraries using
+dlopen. The library name is hardcoded, and it includes the library
+version [1].
+
+This patch creates symlinks for EGL and GLES libraries.
+
+	libEGL.so.1 -> libEGL.so
+	libGLESv2.so.2 -> libGLESv2.so
+
+[1] https://github.com/qt/qtwebengine/blob/dev/src/core/surface_factory_qt.cpp#L76-L86
+---
+ host_applications/android/apps/vidtex/CMakeLists.txt | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/host_applications/android/apps/vidtex/CMakeLists.txt b/host_applications/android/apps/vidtex/CMakeLists.txt
+index 1f705ef..d68ae5f 100644
+--- a/host_applications/android/apps/vidtex/CMakeLists.txt
++++ b/host_applications/android/apps/vidtex/CMakeLists.txt
+@@ -10,3 +10,8 @@ set (VIDTEX_SOURCES
+    vidtex.c)
+ add_executable(vidtex ${VIDTEX_SOURCES})
+ target_link_libraries(vidtex GLESv2 EGL m bcm_host mmal_core mmal_components mmal_util mmal_vc_client vcos)
++
++set(DESTDIR \$ENV{DESTDIR})
++include(GNUInstallDirs)
++install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink libEGL.so ${DESTDIR}/${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/libEGL.so.1)")
++install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink libGLESv2.so ${DESTDIR}/${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/libGLESv2.so.2)")
+-- 
+2.12.1
+
Signature · 1 line
2.13.2
#2 lore raw

PATCH v3 1/3 rpi-userland: fix opengl library symlinks

Hello,

Quoted 32 lines · Ga?l PORTAY

The Qt WebEngine module loads libEGL.so.1 and libGLESv2.so.2 libraries. Their path are hard-coded [1].

This patch sets up cmake to create those library links.

	# ls -l /usr/lib/lib*GL*
	lrwxrwxrwx    1 root     root            11 Mar 21 17:24 /usr/lib/libEGL.so -> libEGL.so.1
	lrwxrwxrwx    1 root     root            15 Mar 21 17:24 /usr/lib/libEGL.so.1 -> libEGL.so.1.0.0
	-rwxr-xr-x    1 root     root        163152 Mar 22 14:56 /usr/lib/libEGL.so.1.0.0
	lrwxrwxrwx    1 root     root            14 Mar 21 17:24 /usr/lib/libGLESv2.so -> libGLESv2.so.2
	lrwxrwxrwx    1 root     root            18 Mar 21 17:24 /usr/lib/libGLESv2.so.2 -> libGLESv2.so.2.0.0
	-rwxr-xr-x    1 root     root         78788 Mar 22 14:56 /usr/lib/libGLESv2.so.2.0.0

[1] https://github.com/qt/qtwebengine/blob/5.8/src/core/surface_factory_qt.cpp#L76-L86

---
 .../0001-Add-OpenGL-library-versioning.patch       | 35 ++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 package/rpi-userland/0001-Add-OpenGL-library-versioning.patch
package/rpi-userland/0001-Add-OpenGL-library-versioning.patch new file +5 -0
new file mode 100644
index 0000000000..ea708f9559
@@ -0,0 +1,35 @@
+From bf388550943afc70798c497e3fc706303394cfdc Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Ga=C3=ABl=20PORTAY?= <[email protected]>
+Date: Fri, 3 Mar 2017 17:28:41 -0500
+Subject: [PATCH] Add OpenGL library versioning
+

package/rpi-userland/0001-Add-OpenGL-library-versioning.patch line 15

Quoted 10 lines
package/rpi-userland/0001-Add-OpenGL-library-versioning.patch new file +10 -0
+Some applications like QtWebEngine dynamically load libraries using
+dlopen. The library name is hardcoded, and it includes the library
+version [1].
+
+This patch creates symlinks for EGL and GLES libraries.
+
+	libEGL.so.1 -> libEGL.so
+	libGLESv2.so.2 -> libGLESv2.so
+
+[1] https://github.com/qt/qtwebengine/blob/dev/src/core/surface_factory_qt.cpp#L76-L86

Missing Signed-off-by line here.

Has this patch been submitted upstream ?

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#3 lore raw

PATCH v3 1/3 rpi-userland: fix opengl library symlinks

Hi Thomas,

Quoted 15 lines · Thomas Petazzoni
Quoted 15 lines
package/rpi-userland/0001-Add-OpenGL-library-versioning.patch new file +9 -0
new file mode 100644
index 0000000000..ea708f9559
@@ -0,0 +1,35 @@
+From bf388550943afc70798c497e3fc706303394cfdc Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Ga=C3=ABl=20PORTAY?= <[email protected]>
+Date: Fri, 3 Mar 2017 17:28:41 -0500
+Subject: [PATCH] Add OpenGL library versioning
+
+Some applications like QtWebEngine dynamically load libraries using
+dlopen. The library name is hardcoded, and it includes the library
+version [1].
+
Quoted 9 lines

package/rpi-userland/0001-Add-OpenGL-library-versioning.patch line 15

Quoted 6 lines
package/rpi-userland/0001-Add-OpenGL-library-versioning.patch new file +6 -0
+This patch creates symlinks for EGL and GLES libraries.
+
+	libEGL.so.1 -> libEGL.so
+	libGLESv2.so.2 -> libGLESv2.so
+
+[1] https://github.com/qt/qtwebengine/blob/dev/src/core/surface_factory_qt.cpp#L76-L86

Missing Signed-off-by line here.

I will add it in v4.

Quoted 2 lines

Has this patch been submitted upstream ?

Yes, I made a PR[1] couple of month ago.

I will ping popcormix.

Quoted 7 lines

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

Regards,
Gael

1: https://github.com/raspberrypi/userland/pull/379

#4 lore raw

PATCH v3 1/3 rpi-userland: fix opengl library symlinks

Quoted 3 lines · Ga?l PORTAY
Quoted 2 lines

Has this patch been submitted upstream ?

Yes, I made a PR[1] couple of month ago.

Please add that URL to the commit log.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#5 lore raw

PATCH v3 2/3 qt5webengine: new package

In reply to Gaël PORTAY

This patch is based on works [1] and [2].

[1]: http://lists.busybox.net/pipermail/buildroot/2015-July/132010.html
[2]: https://patchwork.ozlabs.org/patch/640633/

Cc Akihiko Odaki <[email protected]>
Cc Julien Corjon <[email protected]>
---
 package/qt5/Config.in                              |   1 +
 .../qt5webengine/0001-change-default-ssl-dir.patch |  19 ++
 package/qt5/qt5webengine/Config.in                 |  51 +++++
 package/qt5/qt5webengine/chromium.inc              | 239 +++++++++++++++++++++
 package/qt5/qt5webengine/qt5webengine.hash         |   5 +
 package/qt5/qt5webengine/qt5webengine.mk           |  77 +++++++
 6 files changed, 392 insertions(+)
 create mode 100644 package/qt5/qt5webengine/0001-change-default-ssl-dir.patch
 create mode 100644 package/qt5/qt5webengine/Config.in
 create mode 100644 package/qt5/qt5webengine/chromium.inc
 create mode 100644 package/qt5/qt5webengine/qt5webengine.hash
 create mode 100644 package/qt5/qt5webengine/qt5webengine.mk
package/qt5/Config.in +1 -0
index cca04a6d3d..7fabca2726 100644
@@ -79,6 +79,7 @@ source "package/qt5/qt5tools/Config.in"
 source "package/qt5/qt5virtualkeyboard/Config.in"
 source "package/qt5/qt5webchannel/Config.in"
 source "package/qt5/qt5webkit/Config.in"
+source "package/qt5/qt5webengine/Config.in"
 source "package/qt5/qt5websockets/Config.in"
 source "package/qt5/qt5x11extras/Config.in"
 source "package/qt5/qt5xmlpatterns/Config.in"
package/qt5/qt5webengine/0001-change-default-ssl-dir.patch new file +19 -0
new file mode 100644
index 0000000000..d61d1e71f6
@@ -0,0 +1,19 @@
+Change the default SSL directory, as buildroot ca-cert package is
+installed at /etc/ssl. That way, we don't have to use the SSL_CERT_DIR
+environment at runtime.
+
+Signed-off-by: Damien Riegel <[email protected]>
+Signed-off-by: Ga?l PORTAY <[email protected]>
+
+diff -Nura qt5webengine-5.8.0.orig/src/core/qtwebengine_extras.gypi qt5webengine-5.8.0/src/core/qtwebengine_extras.gypi
+--- qt5webengine-5.8.0.orig/src/core/qtwebengine_extras.gypi	2017-01-03 05:35:11.000000000 -0500
++++ qt5webengine-5.8.0/src/core/qtwebengine_extras.gypi	2017-03-03 16:24:34.947416678 -0500
+@@ -103,7 +103,7 @@
+             'GL_GLEXT_PROTOTYPES',
+             'EGL_EGLEXT_PROTOTYPES',
+             # At runtime the env variable SSL_CERT_DIR can be used to override this
+-            'OPENSSLDIR="/usr/lib/ssl"',
++            'OPENSSLDIR="/etc/ssl"',
+             'OPENSSL_LOAD_CONF',
+             'EGL_API_FB=1',
+             'LINUX=1',
package/qt5/qt5webengine/Config.in new file +51 -0

51 lines not on this page · raw message

package/qt5/qt5webengine/chromium.inc new file +239 -0

239 lines not on this page · raw message

package/qt5/qt5webengine/qt5webengine.hash new file +5 -0
new file mode 100644
index 0000000000..cad32cc54c
@@ -0,0 +1,5 @@
+# Hash from: http://download.qt.io/official_releases/qt/5.6/5.6.2/submodules/qtwebengine-opensource-src-5.6.2.tar.xz.mirrorlist
+sha256 2f0a1648e1a8b22bad0134f2b37d69d185074393c398c1a3c6a83b910ff39740  qtwebengine-opensource-src-5.6.2.tar.xz
+
+# Hash from: http://download.qt.io/official_releases/qt/5.8/5.8.0/submodules/qtwebengine-opensource-src-5.8.0.tar.xz.mirrorlist
+sha256 223d22f1660811e60677afe0a85f2f385823e25157689561489700c5d1da79be  qtwebengine-opensource-src-5.8.0.tar.xz
package/qt5/qt5webengine/qt5webengine.mk new file +77 -0

77 lines not on this page · raw message

Signature · 1 line
2.13.2
#6 lore raw

PATCH v3 3/3 configs: new raspberrypi3 qt5 config

In reply to Gaël PORTAY

This config sets Qt WebEngine for raspberrypi 3.

---
 configs/raspberrypi3_qt5_defconfig | 47 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)
 create mode 100644 configs/raspberrypi3_qt5_defconfig
configs/raspberrypi3_qt5_defconfig new file +47 -0
new file mode 100644
index 0000000000..58ac36770c
@@ -0,0 +1,47 @@
+BR2_arm=y
+BR2_cortex_a7=y
+BR2_ARM_FPU_NEON_VFPV4=y
+
+BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
+BR2_TOOLCHAIN_BUILDROOT_CXX=y
+
+BR2_SYSTEM_DHCP="eth0"
+
+# Linux headers same as kernel, a 4.9 series
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_9=y
+
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_GIT=y
+BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/raspberrypi/linux.git"
+BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="5e4ee836560d4c0371e109bf469e1ad808ae7a44"
+BR2_LINUX_KERNEL_DEFCONFIG="bcm2709"
+
+# Build the DTB from the kernel sources
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="bcm2710-rpi-3-b bcm2710-rpi-cm3"
+
+# Build Qt5 WebEngine
+BR2_PACKAGE_LIBERATION=y
+BR2_PACKAGE_QT5=y
+BR2_PACKAGE_QT5BASE_EXAMPLES=y
+BR2_PACKAGE_QT5QUICKCONTROLS=y
+BR2_PACKAGE_QT5WEBENGINE=y
+BR2_PACKAGE_QT5WEBENGINE_PROPRIETARY_CODECS=y
+BR2_PACKAGE_RPI_FIRMWARE=y
+BR2_PACKAGE_RPI_USERLAND=y
+BR2_PACKAGE_CA_CERTIFICATES=y
+BR2_PACKAGE_NTP=y
+
+# Required tools to create the SD image
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
+
+# Filesystem / image
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_EXT2_SIZE="300000"
+# BR2_TARGET_ROOTFS_TAR is not set
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/raspberrypi3/post-build.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/raspberrypi3/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="--add-pi3-miniuart-bt-overlay"
Signature · 1 line
2.13.2