* [Buildroot] [PATCH v2 1/1] qt5webengine: enable build for 5.6.3
@ 2017-11-23 23:26 Gaël PORTAY
2017-11-24 9:04 ` Thomas Petazzoni
2017-11-27 20:43 ` Thomas Petazzoni
0 siblings, 2 replies; 4+ messages in thread
From: Gaël PORTAY @ 2017-11-23 23:26 UTC (permalink / raw)
To: buildroot
The build was broken in 5.6.2 and was disabled.
It compiles fine since 5.6.3.
The two additional patches are useful at run-time.
The first one avoid the need to specify the path to the SSL certificate
directory (using an additional environment variable).
The second one is the same used in 5.9.x (plus resolved conflicts). It uses the
process's context to get handles on EGL and GLESv2 libraries. Those libraries
are linked to Qt WebEngine at compile time.
The patch is particularly usefull for RPI boards since the raspberrypi userland
package does not provide the libEGLv2.so.2 and libGLES.so.1 symlinks. Both
library paths are hardcoded in Qt WebEngine.
Signed-off-by: Ga?l PORTAY <gael.portay@savoirfairelinux.com>
---
Changes since v1:
- reword commit message to include comments from cover-letter
- format the first patch using git; and add my signed-off-by
.../5.6.3/0001-Change-default-SSL-directory.patch | 35 ++++++++
...ad-libEGL-and-libGLES2-symbols-implicitly.patch | 93 ++++++++++++++++++++++
package/qt5/qt5webengine/Config.in | 5 --
package/qt5/qt5webengine/qt5webengine.hash | 3 +
4 files changed, 131 insertions(+), 5 deletions(-)
create mode 100644 package/qt5/qt5webengine/5.6.3/0001-Change-default-SSL-directory.patch
create mode 100644 package/qt5/qt5webengine/5.6.3/0002-Load-libEGL-and-libGLES2-symbols-implicitly.patch
diff --git a/package/qt5/qt5webengine/5.6.3/0001-Change-default-SSL-directory.patch b/package/qt5/qt5webengine/5.6.3/0001-Change-default-SSL-directory.patch
new file mode 100644
index 0000000000..15cd9f87bb
--- /dev/null
+++ b/package/qt5/qt5webengine/5.6.3/0001-Change-default-SSL-directory.patch
@@ -0,0 +1,35 @@
+From fc41c0f572ff347142cca4bf5d82b87782bb5906 Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Ga=C3=ABl=20PORTAY?= <gael.portay@savoirfairelinux.com>
+Date: Thu, 23 Nov 2017 16:18:06 -0500
+Subject: [PATCH] Change default SSL directory
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf-8
+Content-Transfer-Encoding: 8bit
+
+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.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Damien Riegel <damien.riegel@savoirfairelinux.com>
+Signed-off-by: Ga?l PORTAY <gael.portay@savoirfairelinux.com>
+---
+ src/core/qtwebengine_extras.gypi | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/core/qtwebengine_extras.gypi b/src/core/qtwebengine_extras.gypi
+index 229421ef..3b2386c0 100644
+--- a/src/core/qtwebengine_extras.gypi
++++ b/src/core/qtwebengine_extras.gypi
+@@ -96,7 +96,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',
+--
+2.15.0
+
diff --git a/package/qt5/qt5webengine/5.6.3/0002-Load-libEGL-and-libGLES2-symbols-implicitly.patch b/package/qt5/qt5webengine/5.6.3/0002-Load-libEGL-and-libGLES2-symbols-implicitly.patch
new file mode 100644
index 0000000000..05ed2956d2
--- /dev/null
+++ b/package/qt5/qt5webengine/5.6.3/0002-Load-libEGL-and-libGLES2-symbols-implicitly.patch
@@ -0,0 +1,93 @@
+From bdfd084296681bcead17c42f1e5cf0e24ee04f65 Mon Sep 17 00:00:00 2001
+From: Viktor Engelmann <viktor.engelmann@qt.io>
+Date: Fri, 7 Jul 2017 12:56:19 +0200
+Subject: [PATCH] Load libEGL and libGLES2 symbols implicitly
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf-8
+Content-Transfer-Encoding: 8bit
+
+Instead of explicitly loading libraries from hard-coded locations,
+we now just call dlopen(NULL, RTLD_LAZY). This returns a handle to
+the host process'es context, which already contains the symbols of
+both these libraries, because we link against them.
+It was necessary to bypass LoadLibrary, because that expects a non-NULL
+file path, so we couldn't pass NULL through that interface.
+
+Upstream-Status: Merged
+Task-number: QTBUG-57761
+Change-Id: I29f037dfe542222b5188a33c7727c81a464a87bb
+Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
+Reviewed-by: Michal Klocek <michal.klocek@qt.io>
+Signed-off-by: Ga?l PORTAY <gael.portay@savoirfairelinux.com>
+[gportay: backport from 5.9 and merge conflicts]
+---
+ src/core/surface_factory_qt.cpp | 40 ++++++++--------------------------------
+ 1 file changed, 8 insertions(+), 32 deletions(-)
+
+diff --git a/src/core/surface_factory_qt.cpp b/src/core/surface_factory_qt.cpp
+index 48c91bfc..c6059b67 100644
+--- a/src/core/surface_factory_qt.cpp
++++ b/src/core/surface_factory_qt.cpp
+@@ -51,51 +51,27 @@
+ #if defined(USE_OZONE)
+
+ #include <EGL/egl.h>
+-
+-#ifndef QT_LIBDIR_EGL
+-#define QT_LIBDIR_EGL "/usr/lib"
+-#endif
+-#ifndef QT_LIBDIR_GLES2
+-#define QT_LIBDIR_GLES2 QT_LIBDIR_EGL
+-#endif
++#include <dlfcn.h>
+
+ namespace QtWebEngineCore {
+
+-base::NativeLibrary LoadLibrary(const base::FilePath& filename) {
+- base::NativeLibraryLoadError error;
+- base::NativeLibrary library = base::LoadNativeLibrary(filename, &error);
+- if (!library) {
+- LOG(ERROR) << "Failed to load " << filename.MaybeAsASCII() << ": " << error.ToString();
+- return NULL;
+- }
+- return library;
+-}
+-
+ bool SurfaceFactoryQt::LoadEGLGLES2Bindings(AddGLLibraryCallback add_gl_library, SetGLGetProcAddressProcCallback set_gl_get_proc_address)
+ {
+- base::FilePath libEGLPath = QtWebEngineCore::toFilePath(QT_LIBDIR_EGL);
+- libEGLPath = libEGLPath.Append("libEGL.so.1");
+- base::NativeLibrary eglLibrary = LoadLibrary(libEGLPath);
+- if (!eglLibrary)
+- return false;
+-
+- base::FilePath libGLES2Path = QtWebEngineCore::toFilePath(QT_LIBDIR_GLES2);
+- libGLES2Path = libGLES2Path.Append("libGLESv2.so.2");
+- base::NativeLibrary gles2Library = LoadLibrary(libGLES2Path);
+- if (!gles2Library)
++ base::NativeLibrary eglgles2Library = dlopen(NULL, RTLD_LAZY);
++ if (!eglgles2Library) {
++ LOG(ERROR) << "Failed to open EGL/GLES2 context " << dlerror();
+ return false;
++ }
+
+- gfx::GLGetProcAddressProc get_proc_address = reinterpret_cast<gfx::GLGetProcAddressProc>(base::GetFunctionPointerFromNativeLibrary(eglLibrary, "eglGetProcAddress"));
++ gfx::GLGetProcAddressProc get_proc_address = reinterpret_cast<gfx::GLGetProcAddressProc>(base::GetFunctionPointerFromNativeLibrary(eglgles2Library, "eglGetProcAddress"));
+ if (!get_proc_address) {
+ LOG(ERROR) << "eglGetProcAddress not found.";
+- base::UnloadNativeLibrary(eglLibrary);
+- base::UnloadNativeLibrary(gles2Library);
++ base::UnloadNativeLibrary(eglgles2Library);
+ return false;
+ }
+
+ gfx::SetGLGetProcAddressProc(get_proc_address);
+- gfx::AddGLNativeLibrary(eglLibrary);
+- gfx::AddGLNativeLibrary(gles2Library);
++ gfx::AddGLNativeLibrary(eglgles2Library);
+ return true;
+ }
+
+--
+2.15.0
+
diff --git a/package/qt5/qt5webengine/Config.in b/package/qt5/qt5webengine/Config.in
index d40b58062e..d0c8d18210 100644
--- a/package/qt5/qt5webengine/Config.in
+++ b/package/qt5/qt5webengine/Config.in
@@ -20,10 +20,6 @@ comment "qt5webengine needs an OpenGL and EGL-capable backend"
depends on BR2_PACKAGE_QT5WEBENGINE_ARCH_SUPPORTS
depends on !BR2_PACKAGE_QT5_GL_AVAILABLE || !BR2_PACKAGE_HAS_LIBEGL
-comment "qt5webengine is not available with Qt 5.6"
- depends on BR2_PACKAGE_QT5WEBENGINE_ARCH_SUPPORTS
- depends on BR2_PACKAGE_QT5_VERSION_5_6
-
config BR2_PACKAGE_QT5WEBENGINE
bool "qt5webengine"
depends on BR2_PACKAGE_QT5WEBENGINE_ARCH_SUPPORTS
@@ -35,7 +31,6 @@ config BR2_PACKAGE_QT5WEBENGINE
depends on BR2_PACKAGE_QT5_GL_AVAILABLE # qt5declarative, qt5base-eglfs
depends on BR2_PACKAGE_HAS_LIBEGL # qt5base-eglfs
depends on BR2_PACKAGE_HAS_UDEV
- depends on !BR2_PACKAGE_QT5_VERSION_5_6
# v8 (a chromium 3rd-party) compiles its internal host-tools with the
# same word size as the target. For 32-bits targets, it adds the -m32
# flag (for 64-bits, it adds the -m64 flag).
diff --git a/package/qt5/qt5webengine/qt5webengine.hash b/package/qt5/qt5webengine/qt5webengine.hash
index 918f7edb3a..f71889e251 100644
--- a/package/qt5/qt5webengine/qt5webengine.hash
+++ b/package/qt5/qt5webengine/qt5webengine.hash
@@ -1,2 +1,5 @@
+# Hash from https://download.qt.io/official_releases/qt/5.6/5.6.3/submodules/qtwebengine-opensource-src-5.6.3.tar.xz.mirrorlist
+sha256 009d69fb39f6c0e2b0cd89a7e9302cd0ae1872d02c787d3a37f2cacca5ddb7a7 qtwebengine-opensource-src-5.6.3.tar.xz
+
# Hash from: https://download.qt.io/official_releases/qt/5.9/5.9.2/submodules/qtwebengine-opensource-src-5.9.2.tar.xz.mirrorlist
sha256 cab069e4589f806640bebe4077c70e5cd5ffeb146c6e8caca6c4454fc0c4a108 qtwebengine-opensource-src-5.9.2.tar.xz
--
2.15.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* [Buildroot] [PATCH v2 1/1] qt5webengine: enable build for 5.6.3
2017-11-23 23:26 [Buildroot] [PATCH v2 1/1] qt5webengine: enable build for 5.6.3 Gaël PORTAY
@ 2017-11-24 9:04 ` Thomas Petazzoni
2017-11-25 13:02 ` Yann E. MORIN
2017-11-27 20:43 ` Thomas Petazzoni
1 sibling, 1 reply; 4+ messages in thread
From: Thomas Petazzoni @ 2017-11-24 9:04 UTC (permalink / raw)
To: buildroot
Hello,
+Yann in Cc, since there is licensing stuff involved :)
On Thu, 23 Nov 2017 18:26:19 -0500, Ga?l PORTAY wrote:
> +Upstream-Status: Merged
> +Task-number: QTBUG-57761
> +Change-Id: I29f037dfe542222b5188a33c7727c81a464a87bb
> +Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
> +Reviewed-by: Michal Klocek <michal.klocek@qt.io>
> +Signed-off-by: Ga?l PORTAY <gael.portay@savoirfairelinux.com>
> +[gportay: backport from 5.9 and merge conflicts]
Backporting from 5.9 to 5.6 raises a red flag: Qt changed its licensing
terms between 5.6 and 5.9, and you can't backport things this way,
because Qt 5.9 is under GPLv3, while Qt 5.6 is not.
However I'm not sure about the specific status of qt5webengine. Also,
its <pkg>_LICENSE variable says:
include package/qt5/qt5webengine/chromium.inc
QT5WEBENGINE_LICENSE = GPL-2.0 or LGPL-3.0 or GPL-3.0 or GPL-3.0 with exception
QT5WEBENGINE_LICENSE_FILES = LICENSE.GPL2 LICENSE.GPL3 LICENSE.GPL3-EXCEPT \
LICENSE.GPLv3 LICENSE.LGPL3 $(CHROMIUM_LICENSE_FILES)
which I'm not sure is correct for Qt 5.6. Indeed, many of the packages
have something like this instead:
ifeq ($(BR2_PACKAGE_QT5_VERSION_LATEST),y)
QT5MULTIMEDIA_LICENSE = GPL-2.0+ or LGPL-3.0, GPL-3.0 with exception(tools), GFDL-1.3 (docs)
QT5MULTIMEDIA_LICENSE_FILES = LICENSE.GPL2 LICENSE.GPL3 LICENSE.GPL3-EXCEPT LICENSE.LGPL3 LICENSE.FDL
else
QT5MULTIMEDIA_LICENSE = GPL-3.0 or LGPL-2.1 with exception or LGPL-3.0, GFDL-1.3 (docs)
QT5MULTIMEDIA_LICENSE_FILES = LICENSE.GPLv3 LICENSE.LGPLv21 LGPL_EXCEPTION.txt LICENSE.LGPLv3 LICENSE.FDL
endif
Could you double check the license status of qt5webengine, in Qt 5.6
and Qt 5.9 respectively ?
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 4+ messages in thread* [Buildroot] [PATCH v2 1/1] qt5webengine: enable build for 5.6.3
2017-11-24 9:04 ` Thomas Petazzoni
@ 2017-11-25 13:02 ` Yann E. MORIN
0 siblings, 0 replies; 4+ messages in thread
From: Yann E. MORIN @ 2017-11-25 13:02 UTC (permalink / raw)
To: buildroot
Thomas, All,
On 2017-11-24 10:04 +0100, Thomas Petazzoni spake thusly:
> +Yann in Cc, since there is licensing stuff involved :)
>
> On Thu, 23 Nov 2017 18:26:19 -0500, Ga?l PORTAY wrote:
>
> > +Upstream-Status: Merged
> > +Task-number: QTBUG-57761
> > +Change-Id: I29f037dfe542222b5188a33c7727c81a464a87bb
> > +Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
> > +Reviewed-by: Michal Klocek <michal.klocek@qt.io>
> > +Signed-off-by: Ga?l PORTAY <gael.portay@savoirfairelinux.com>
> > +[gportay: backport from 5.9 and merge conflicts]
>
> Backporting from 5.9 to 5.6 raises a red flag: Qt changed its licensing
> terms between 5.6 and 5.9, and you can't backport things this way,
> because Qt 5.9 is under GPLv3, while Qt 5.6 is not.
Three things:
0- IANAL, this is not legal advice, blablabla...
1- the real licensing terms are: LGPL-3.0 or GPL-2.0 or GPL-3.0 or proprietary
Note that this is LGPL-3.0 and not '+', because the source states:
[...] this file may be used under the terms of the GNU Lesser
General Public License version 3 as published by [...]
Note that it is not GPL-2.0+, because the source code explicitly says:
[...] this file may be used under the terms of the GNU General Public
License version 2.0 or (at your option) the GNU General Public license
version 3 or any later version approved by the KDE Free Qt Foundation.
Note that the terms are ambiguous, because we don't know what "approved
by the Free Qt Foundation" applies to. We should just assume nothing about
this, hence GPL-3.0 and not '+'.
2- AFAICS, those were already the licensing terms for qtwebengine 5.6, so
it looks like we can indeed backport. But then this should be clearly
stated in the backported patch itself, so we don't come later and worry
again about this issue.
Note that in qt-5.6, some Qt modules were already using the new
licensing terms: new modules that were introduced in Qt-5.6 (and even
those new in Qt-5.5?) have been using the LGPL-3.0/GPL2.0/GPL-3.0 from
the onset.
> However I'm not sure about the specific status of qt5webengine. Also,
> its <pkg>_LICENSE variable says:
>
> include package/qt5/qt5webengine/chromium.inc
> QT5WEBENGINE_LICENSE = GPL-2.0 or LGPL-3.0 or GPL-3.0 or GPL-3.0 with exception
The exception only applies to some filers in the tests/ and tools/
directories.
So I wonder if that is something that is applicable in the end.
> QT5WEBENGINE_LICENSE_FILES = LICENSE.GPL2 LICENSE.GPL3 LICENSE.GPL3-EXCEPT \
> LICENSE.GPLv3 LICENSE.LGPL3 $(CHROMIUM_LICENSE_FILES)
>
> which I'm not sure is correct for Qt 5.6. Indeed, many of the packages
> have something like this instead:
As explained above, it is valid already for Qt-5.6, becasue qtwebengine
was a new module at that time, so it never had the non-v3 licenses.
> ifeq ($(BR2_PACKAGE_QT5_VERSION_LATEST),y)
> QT5MULTIMEDIA_LICENSE = GPL-2.0+ or LGPL-3.0, GPL-3.0 with exception(tools), GFDL-1.3 (docs)
> QT5MULTIMEDIA_LICENSE_FILES = LICENSE.GPL2 LICENSE.GPL3 LICENSE.GPL3-EXCEPT LICENSE.LGPL3 LICENSE.FDL
> else
> QT5MULTIMEDIA_LICENSE = GPL-3.0 or LGPL-2.1 with exception or LGPL-3.0, GFDL-1.3 (docs)
> QT5MULTIMEDIA_LICENSE_FILES = LICENSE.GPLv3 LICENSE.LGPLv21 LGPL_EXCEPTION.txt LICENSE.LGPLv3 LICENSE.FDL
> endif
>
> Could you double check the license status of qt5webengine, in Qt 5.6
> and Qt 5.9 respectively ?
Yes, a second review of my statements above would be very much
appreciated, please.
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH v2 1/1] qt5webengine: enable build for 5.6.3
2017-11-23 23:26 [Buildroot] [PATCH v2 1/1] qt5webengine: enable build for 5.6.3 Gaël PORTAY
2017-11-24 9:04 ` Thomas Petazzoni
@ 2017-11-27 20:43 ` Thomas Petazzoni
1 sibling, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2017-11-27 20:43 UTC (permalink / raw)
To: buildroot
Hello,
On Thu, 23 Nov 2017 18:26:19 -0500, Ga?l PORTAY wrote:
> The build was broken in 5.6.2 and was disabled.
>
> It compiles fine since 5.6.3.
>
> The two additional patches are useful at run-time.
>
> The first one avoid the need to specify the path to the SSL certificate
> directory (using an additional environment variable).
>
> The second one is the same used in 5.9.x (plus resolved conflicts). It uses the
> process's context to get handles on EGL and GLESv2 libraries. Those libraries
> are linked to Qt WebEngine at compile time.
>
> The patch is particularly usefull for RPI boards since the raspberrypi userland
> package does not provide the libEGLv2.so.2 and libGLES.so.1 symlinks. Both
> library paths are hardcoded in Qt WebEngine.
>
> Signed-off-by: Ga?l PORTAY <gael.portay@savoirfairelinux.com>
> ---
Following the feedback from Yann on the licensing question, I applied
to the next branch. Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-11-27 20:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-23 23:26 [Buildroot] [PATCH v2 1/1] qt5webengine: enable build for 5.6.3 Gaël PORTAY
2017-11-24 9:04 ` Thomas Petazzoni
2017-11-25 13:02 ` Yann E. MORIN
2017-11-27 20:43 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox