diff mbox

[v2] qt5webkit: restore package

Message ID 1459525200-12624-1-git-send-email-gary.bisson@boundarydevices.com
State Superseded
Headers show

Commit Message

Gary Bisson April 1, 2016, 3:40 p.m. UTC
Although this package has been removed from the official release
packages since Qt5.6.0, it is still available for users to build
it from source. This is useful for platforms without GPU since its
successor (QtWebEngine) requires OpenGL support.

The package now matches the community-based meta-qt5 Yocto layer,
using the exact same revision of the qtwebkit source from github:
https://github.com/meta-qt5/meta-qt5/commit/e434995a

Here is the project source tree:
https://github.com/qtproject/qtwebkit

All the patches have been pulled from Yocto as well.

Since we are now using the source from the git repository, we need
to create an empty .git/ folder to force the headers re-generation.
https://github.com/meta-qt5/meta-qt5/blob/jethro/recipes-qt/qt5/qt5.inc#L33

Note that GPLv3 license option has been added with this release.

Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
---
Hi all,

Changelog v1->v2:
- Add comment to explain GitHub choice, suggested by Arnout.
- Add comment to explain .git folder creation, suggested by Julien.
- Remove || true for .git folder creation, suggested by Julien.
- Add SOB to patches, suggested by Julien and Arnout.
- Remove x/y number in patches titles, suggested by Arnout.

I know the .git folder will still make people wonder, I unfortunately haven't
found the exact Makefile where this folder makes a difference. My comment
points to the meta-qt5 inc file which does it with the following explanation:
# Regenerate header files when they are included in source tarball
# Otherwise cmake files don't set PRIVATE_HEADERS correctly
do_configure_prepend() {
    rm -rf ${S}/include
    mkdir -p ${S}/.git || true
}

Tested on i.MX6Q Nitrogen6x platform.

Regards,
Gary
---
 Config.in.legacy                                   |  7 --
 package/qt5/Config.in                              |  1 +
 .../0001-qtwebkit-fix-QA-issue-bad-RPATH.patch     | 31 +++++++++
 .../qt5webkit/0002-Remove-TEXTREL-tag-in-x86.patch | 80 ++++++++++++++++++++++
 ...ude-backtrace-API-for-non-glibc-libraries.patch | 39 +++++++++++
 .../0004-Fix-linking-with-libpthread.patch         | 34 +++++++++
 package/qt5/qt5webkit/Config.in                    | 24 +++++++
 package/qt5/qt5webkit/qt5webkit.hash               |  2 +
 package/qt5/qt5webkit/qt5webkit.mk                 | 62 +++++++++++++++++
 9 files changed, 273 insertions(+), 7 deletions(-)
 create mode 100644 package/qt5/qt5webkit/0001-qtwebkit-fix-QA-issue-bad-RPATH.patch
 create mode 100644 package/qt5/qt5webkit/0002-Remove-TEXTREL-tag-in-x86.patch
 create mode 100644 package/qt5/qt5webkit/0003-Exclude-backtrace-API-for-non-glibc-libraries.patch
 create mode 100644 package/qt5/qt5webkit/0004-Fix-linking-with-libpthread.patch
 create mode 100644 package/qt5/qt5webkit/Config.in
 create mode 100644 package/qt5/qt5webkit/qt5webkit.hash
 create mode 100644 package/qt5/qt5webkit/qt5webkit.mk

Comments

Julien Corjon April 4, 2016, 2:54 p.m. UTC | #1
Dear Gary,

Your patch looks fine, so:
Reviewed-by: Julien Corjon <corjon.j@ecagroup.com>

Regards,

Julien

Le 01/04/2016 17:40, Gary Bisson a écrit :
> Although this package has been removed from the official release
> packages since Qt5.6.0, it is still available for users to build
> it from source. This is useful for platforms without GPU since its
> successor (QtWebEngine) requires OpenGL support.
>
> The package now matches the community-based meta-qt5 Yocto layer,
> using the exact same revision of the qtwebkit source from github:
> https://github.com/meta-qt5/meta-qt5/commit/e434995a
>
> Here is the project source tree:
> https://github.com/qtproject/qtwebkit
>
> All the patches have been pulled from Yocto as well.
>
> Since we are now using the source from the git repository, we need
> to create an empty .git/ folder to force the headers re-generation.
> https://github.com/meta-qt5/meta-qt5/blob/jethro/recipes-qt/qt5/qt5.inc#L33
>
> Note that GPLv3 license option has been added with this release.
>
> Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
> ---
> Hi all,
>
> Changelog v1->v2:
> - Add comment to explain GitHub choice, suggested by Arnout.
> - Add comment to explain .git folder creation, suggested by Julien.
> - Remove || true for .git folder creation, suggested by Julien.
> - Add SOB to patches, suggested by Julien and Arnout.
> - Remove x/y number in patches titles, suggested by Arnout.
>
> I know the .git folder will still make people wonder, I unfortunately haven't
> found the exact Makefile where this folder makes a difference. My comment
> points to the meta-qt5 inc file which does it with the following explanation:
> # Regenerate header files when they are included in source tarball
> # Otherwise cmake files don't set PRIVATE_HEADERS correctly
> do_configure_prepend() {
>      rm -rf ${S}/include
>      mkdir -p ${S}/.git || true
> }
>
> Tested on i.MX6Q Nitrogen6x platform.
>
> Regards,
> Gary
> ---
>   Config.in.legacy                                   |  7 --
>   package/qt5/Config.in                              |  1 +
>   .../0001-qtwebkit-fix-QA-issue-bad-RPATH.patch     | 31 +++++++++
>   .../qt5webkit/0002-Remove-TEXTREL-tag-in-x86.patch | 80 ++++++++++++++++++++++
>   ...ude-backtrace-API-for-non-glibc-libraries.patch | 39 +++++++++++
>   .../0004-Fix-linking-with-libpthread.patch         | 34 +++++++++
>   package/qt5/qt5webkit/Config.in                    | 24 +++++++
>   package/qt5/qt5webkit/qt5webkit.hash               |  2 +
>   package/qt5/qt5webkit/qt5webkit.mk                 | 62 +++++++++++++++++
>   9 files changed, 273 insertions(+), 7 deletions(-)
>   create mode 100644 package/qt5/qt5webkit/0001-qtwebkit-fix-QA-issue-bad-RPATH.patch
>   create mode 100644 package/qt5/qt5webkit/0002-Remove-TEXTREL-tag-in-x86.patch
>   create mode 100644 package/qt5/qt5webkit/0003-Exclude-backtrace-API-for-non-glibc-libraries.patch
>   create mode 100644 package/qt5/qt5webkit/0004-Fix-linking-with-libpthread.patch
>   create mode 100644 package/qt5/qt5webkit/Config.in
>   create mode 100644 package/qt5/qt5webkit/qt5webkit.hash
>   create mode 100644 package/qt5/qt5webkit/qt5webkit.mk
>
> diff --git a/Config.in.legacy b/Config.in.legacy
> index 60702ce..6691c50 100644
> --- a/Config.in.legacy
> +++ b/Config.in.legacy
> @@ -152,13 +152,6 @@ config BR2_PACKAGE_QT5WEBKIT_EXAMPLES
>   	  The qt5webkit-examples package has been removed, since it
>   	  was removed from upstream starting from Qt 5.6.
>
> -config BR2_PACKAGE_QT5WEBKIT
> -	bool "qt5webkit package removed"
> -	select BR2_LEGACY
> -	help
> -	  The qt5webkit package has been removed, since it was removed
> -	  from upstream starting from Qt 5.6.
> -
>   config BR2_PACKAGE_QT5QUICK1
>   	bool "qt5quick1 package removed"
>   	select BR2_LEGACY
> diff --git a/package/qt5/Config.in b/package/qt5/Config.in
> index f673daa..0c0e971 100644
> --- a/package/qt5/Config.in
> +++ b/package/qt5/Config.in
> @@ -49,4 +49,5 @@ source "package/qt5/qt5x11extras/Config.in"
>   source "package/qt5/qt5xmlpatterns/Config.in"
>   comment "legacy compatibility"
>   source "package/qt5/qt5script/Config.in"
> +source "package/qt5/qt5webkit/Config.in"
>   endif
> diff --git a/package/qt5/qt5webkit/0001-qtwebkit-fix-QA-issue-bad-RPATH.patch b/package/qt5/qt5webkit/0001-qtwebkit-fix-QA-issue-bad-RPATH.patch
> new file mode 100644
> index 0000000..ada98a2
> --- /dev/null
> +++ b/package/qt5/qt5webkit/0001-qtwebkit-fix-QA-issue-bad-RPATH.patch
> @@ -0,0 +1,31 @@
> +From 1735a8484ef9ae336f8d607b56bda64c8af10c79 Mon Sep 17 00:00:00 2001
> +From: Trevor Woerner <trevor.woerner@linaro.org>
> +Date: Fri, 7 Feb 2014 04:07:17 +0100
> +Subject: [PATCH] qtwebkit: fix QA issue (bad RPATH)
> +
> +Building qtwebkit causes a QA issue such that QtWebPluginProcess and
> +QtWebProcess contain bad RPATHs which point into the build location. This fix
> +adds a patch to not include the rpath.prf which causes this problem.
> +
> +Signed-off-by: Trevor Woerner <trevor.woerner@linaro.org>
> +Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> +Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
> +---
> + Tools/qmake/mkspecs/features/unix/default_post.prf | 1 -
> + 1 file changed, 1 deletion(-)
> +
> +diff --git a/Tools/qmake/mkspecs/features/unix/default_post.prf b/Tools/qmake/mkspecs/features/unix/default_post.prf
> +index fd66af6..ef754c3 100644
> +--- a/Tools/qmake/mkspecs/features/unix/default_post.prf
> ++++ b/Tools/qmake/mkspecs/features/unix/default_post.prf
> +@@ -61,7 +61,6 @@ linux-*g++* {
> +     }
> + }
> +
> +-contains(TEMPLATE, app): CONFIG += rpath
> +
> + CONFIG(debug, debug|release)|force_debug_info {
> +     # Make ld not cache the symbol tables of input files in memory to avoid memory exhaustion during the linking phase.
> +--
> +2.7.0
> +
> diff --git a/package/qt5/qt5webkit/0002-Remove-TEXTREL-tag-in-x86.patch b/package/qt5/qt5webkit/0002-Remove-TEXTREL-tag-in-x86.patch
> new file mode 100644
> index 0000000..d07a62f
> --- /dev/null
> +++ b/package/qt5/qt5webkit/0002-Remove-TEXTREL-tag-in-x86.patch
> @@ -0,0 +1,80 @@
> +From ae16ce17cc7060274a0b0c165b953fc32540f977 Mon Sep 17 00:00:00 2001
> +From: Magnus Granberg <zorry@gentoo.org>
> +Date: Fri, 27 Feb 2015 11:55:09 +0100
> +Subject: [PATCH] Remove TEXTREL tag in x86
> +
> +Fix textrel QA warnings when building qtwebkit for x86:
> +
> +  WARNING: QA Issue: ELF binary '/home/andre/rdk/rdk-master/build-vbox32/tmp/work/core2-32-rdk-linux/qtwebkit/5.4.0-r0/packages-split/qtwebkit/usr/lib/libQt5WebKit.so.5.4.0' has relocations in .text [textrel]
> +
> +Patch from upstream webkit:
> +
> +  https://bugs.webkit.org/show_bug.cgi?id=70610
> +
> +Minor refresh required to apply cleanly to the older webkit sources used
> +by qtwebkit. Specifically, the patch needed to be modified to account
> +for PLATFORM(MAC) -> OS(DARWIN) renaming in recent webkit which is not
> +part of qtwebkit yet ( https://bugs.webkit.org/show_bug.cgi?id=99683 ).
> +
> +Upstream status [webkit] : backport
> +Upstream status [qtwebkit] : unclear
> +
> +Bug: https://bugs.webkit.org/show_bug.cgi?id=70610
> +Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> +Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
> +---
> + Source/JavaScriptCore/jit/ThunkGenerators.cpp | 24 ++++++++++++++++++++++++
> + Source/WTF/wtf/InlineASM.h                    |  2 ++
> + 2 files changed, 26 insertions(+)
> +
> +diff --git a/Source/JavaScriptCore/jit/ThunkGenerators.cpp b/Source/JavaScriptCore/jit/ThunkGenerators.cpp
> +index 9684df2..8af82d8 100644
> +--- a/Source/JavaScriptCore/jit/ThunkGenerators.cpp
> ++++ b/Source/JavaScriptCore/jit/ThunkGenerators.cpp
> +@@ -524,6 +524,30 @@ double jsRound(double d)
> +     } \
> +     static MathThunk UnaryDoubleOpWrapper(function) = &function##Thunk;
> +
> ++#elif CPU(X86) && COMPILER(GCC) && OS(LINUX) && defined(__PIC__)
> ++#define defineUnaryDoubleOpWrapper(function) \
> ++    asm( \
> ++        ".text\n" \
> ++        ".globl " SYMBOL_STRING(function##Thunk) "\n" \
> ++        HIDE_SYMBOL(function##Thunk) "\n" \
> ++        SYMBOL_STRING(function##Thunk) ":" "\n" \
> ++        "pushl %ebx\n" \
> ++        "subl $20, %esp\n" \
> ++        "movsd %xmm0, (%esp) \n" \
> ++        "call __x86.get_pc_thunk.bx\n" \
> ++        "addl $_GLOBAL_OFFSET_TABLE_, %ebx\n" \
> ++        "call " GLOBAL_REFERENCE(function) "\n" \
> ++        "fstpl (%esp) \n" \
> ++        "movsd (%esp), %xmm0 \n" \
> ++        "addl $20, %esp\n" \
> ++        "popl %ebx\n" \
> ++        "ret\n" \
> ++    );\
> ++    extern "C" { \
> ++        MathThunkCallingConvention function##Thunk(MathThunkCallingConvention); \
> ++    } \
> ++    static MathThunk UnaryDoubleOpWrapper(function) = &function##Thunk;
> ++
> + #elif CPU(X86) && COMPILER(GCC) && (PLATFORM(MAC) || OS(LINUX))
> + #define defineUnaryDoubleOpWrapper(function) \
> +     asm( \
> +diff --git a/Source/WTF/wtf/InlineASM.h b/Source/WTF/wtf/InlineASM.h
> +index 0a2fe78..2dc40ef 100644
> +--- a/Source/WTF/wtf/InlineASM.h
> ++++ b/Source/WTF/wtf/InlineASM.h
> +@@ -46,6 +46,8 @@
> + #define GLOBAL_REFERENCE(name) #name "@plt"
> + #elif CPU(X86) && COMPILER(MINGW)
> + #define GLOBAL_REFERENCE(name) "@" #name "@4"
> ++#elif OS(LINUX) && CPU(X86) && defined(__PIC__)
> ++#define GLOBAL_REFERENCE(name) SYMBOL_STRING(name) "@plt"
> + #else
> + #define GLOBAL_REFERENCE(name) SYMBOL_STRING(name)
> + #endif
> +--
> +2.7.0
> +
> diff --git a/package/qt5/qt5webkit/0003-Exclude-backtrace-API-for-non-glibc-libraries.patch b/package/qt5/qt5webkit/0003-Exclude-backtrace-API-for-non-glibc-libraries.patch
> new file mode 100644
> index 0000000..9496947
> --- /dev/null
> +++ b/package/qt5/qt5webkit/0003-Exclude-backtrace-API-for-non-glibc-libraries.patch
> @@ -0,0 +1,39 @@
> +From 6c36f0ff8c1f5852c33d2b23714f9f187cc6ff26 Mon Sep 17 00:00:00 2001
> +From: Khem Raj <raj.khem@gmail.com>
> +Date: Fri, 5 Jun 2015 19:55:05 -0700
> +Subject: [PATCH] Exclude backtrace() API for non-glibc libraries
> +
> +It was excluding musl with current checks, so lets make it such that it
> +considers only glibc when using backtrace API
> +
> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
> +Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
> +---
> + Source/WTF/wtf/Assertions.cpp | 4 ++--
> + 1 file changed, 2 insertions(+), 2 deletions(-)
> +
> +diff --git a/Source/WTF/wtf/Assertions.cpp b/Source/WTF/wtf/Assertions.cpp
> +index 1b2091f..ba03a28 100644
> +--- a/Source/WTF/wtf/Assertions.cpp
> ++++ b/Source/WTF/wtf/Assertions.cpp
> +@@ -61,7 +61,7 @@
> + #include <windows.h>
> + #endif
> +
> +-#if (OS(DARWIN) || (OS(LINUX) && !defined(__UCLIBC__))) && !OS(ANDROID)
> ++#if (OS(DARWIN) || (OS(LINUX) && defined (__GLIBC__) && !defined(__UCLIBC__))) && !OS(ANDROID)
> + #include <cxxabi.h>
> + #include <dlfcn.h>
> + #include <execinfo.h>
> +@@ -245,7 +245,7 @@ void WTFReportArgumentAssertionFailure(const char* file, int line, const char* f
> +
> + void WTFGetBacktrace(void** stack, int* size)
> + {
> +-#if (OS(DARWIN) || (OS(LINUX) && !defined(__UCLIBC__))) && !OS(ANDROID)
> ++#if (OS(DARWIN) || (OS(LINUX) && defined(__GLIBC__) && !defined(__UCLIBC__))) && !OS(ANDROID)
> +     *size = backtrace(stack, *size);
> + #elif OS(WINDOWS) && !OS(WINCE)
> +     // The CaptureStackBackTrace function is available in XP, but it is not defined
> +--
> +2.7.0
> +
> diff --git a/package/qt5/qt5webkit/0004-Fix-linking-with-libpthread.patch b/package/qt5/qt5webkit/0004-Fix-linking-with-libpthread.patch
> new file mode 100644
> index 0000000..b7b6791
> --- /dev/null
> +++ b/package/qt5/qt5webkit/0004-Fix-linking-with-libpthread.patch
> @@ -0,0 +1,34 @@
> +From 5dd4bb67cfce812fd7686e43616e2069f354a7df Mon Sep 17 00:00:00 2001
> +From: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
> +Date: Mon, 22 Feb 2016 10:57:32 +0100
> +Subject: [PATCH] Fix linking with libpthread
> +
> +WebKit use libpthread directly but is depending on other qt modules
> +causing it to be linked against, which might break unless -lpthread
> +is last. Instead just add it explicitly after the static libraries.
> +
> +Upstream-Status: Backport from 5.7 branch
> +
> +Change-Id: I2b95cff2c96373f8dce6f95052c4fccbe1982b33
> +Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
> +Signed-off-by: Jonathan Liu <net147@gmail.com>
> +Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
> +---
> + Tools/qmake/mkspecs/features/default_post.prf | 1 +
> + 1 file changed, 1 insertion(+)
> +
> +diff --git a/Tools/qmake/mkspecs/features/default_post.prf b/Tools/qmake/mkspecs/features/default_post.prf
> +index 67276b7..39bb3f7 100644
> +--- a/Tools/qmake/mkspecs/features/default_post.prf
> ++++ b/Tools/qmake/mkspecs/features/default_post.prf
> +@@ -201,6 +201,7 @@ needToLink() {
> +         linkAgainstLibrary($$library, $$eval(WEBKIT.$${library_identifier}.root_source_dir))
> +         LIBS += $$eval(WEBKIT.$${library_identifier}.dependent_libs)
> +     }
> ++    posix:!darwin: LIBS += -lpthread
> + }
> +
> + creating_module {
> +--
> +2.7.1
> +
> diff --git a/package/qt5/qt5webkit/Config.in b/package/qt5/qt5webkit/Config.in
> new file mode 100644
> index 0000000..fb84b1e
> --- /dev/null
> +++ b/package/qt5/qt5webkit/Config.in
> @@ -0,0 +1,24 @@
> +config BR2_PACKAGE_QT5WEBKIT
> +	bool "qt5webkit"
> +	select BR2_PACKAGE_QT5BASE
> +	select BR2_PACKAGE_QT5BASE_ICU
> +	select BR2_PACKAGE_QT5BASE_GUI
> +	select BR2_PACKAGE_SQLITE
> +	select BR2_PACKAGE_XLIB_LIBXEXT if BR2_PACKAGE_QT5BASE_XCB
> +	select BR2_PACKAGE_XLIB_LIBXRENDER if BR2_PACKAGE_QT5BASE_XCB
> +	# This module does not support static linking
> +	depends on !BR2_STATIC_LIBS
> +	depends on BR2_PACKAGE_QT5_JSCORE_AVAILABLE
> +	depends on !BR2_BINFMT_FLAT # icu
> +	help
> +	  Qt is a cross-platform application and UI framework for
> +	  developers using C++.
> +
> +	  This package corresponds to the qt5webkit module.
> +
> +	  This package has been removed from the official release packages
> +	  since Qt5.6.0, but it is still available for users to build it
> +	  from source. This is useful for platforms without GPU since the
> +	  successor (QtWebEngine) requires OpenGL support.
> +
> +	  http://qt.io
> diff --git a/package/qt5/qt5webkit/qt5webkit.hash b/package/qt5/qt5webkit/qt5webkit.hash
> new file mode 100644
> index 0000000..d2ac7bb
> --- /dev/null
> +++ b/package/qt5/qt5webkit/qt5webkit.hash
> @@ -0,0 +1,2 @@
> +# locally computed
> +sha256 1c79843ef32313312290d4fe0b87256a9129dc44d62b01789a692981edf4d8ab  qt5webkit-d2ff5a085572b1ee24dcb42ae107063f3142d14e.tar.gz
> diff --git a/package/qt5/qt5webkit/qt5webkit.mk b/package/qt5/qt5webkit/qt5webkit.mk
> new file mode 100644
> index 0000000..1ac4c25
> --- /dev/null
> +++ b/package/qt5/qt5webkit/qt5webkit.mk
> @@ -0,0 +1,62 @@
> +################################################################################
> +#
> +# qt5webkit
> +#
> +################################################################################
> +
> +QT5WEBKIT_VERSION = d2ff5a085572b1ee24dcb42ae107063f3142d14e
> +# Using GitHub since it supports downloading tarballs from random commits.
> +# The http://code.qt.io/cgit/qt/qtwebkit.git/ repo doesn't allow to do so.
> +QT5WEBKIT_SITE = $(call github,qtproject,qtwebkit,$(QT5WEBKIT_VERSION))
> +QT5WEBKIT_DEPENDENCIES = qt5base sqlite host-ruby host-gperf host-bison host-flex
> +QT5WEBKIT_INSTALL_STAGING = YES
> +
> +QT5WEBKIT_LICENSE_FILES = Source/WebCore/LICENSE-LGPL-2 Source/WebCore/LICENSE-LGPL-2.1
> +
> +ifeq ($(BR2_PACKAGE_QT5BASE_LICENSE_APPROVED),y)
> +QT5WEBKIT_LICENSE = LGPLv2+ (WebCore), LGPLv2.1 with exception or LGPLv3 or GPLv2 or GPLv3
> +# Source files contain references to LGPL_EXCEPTION.txt but it is not included
> +# in the archive.
> +QT5WEBKIT_LICENSE_FILES += LICENSE.LGPLv21 LICENSE.LGPLv3 LICENSE.GPLv2 LICENSE.GPLv3
> +else
> +QT5WEBKIT_LICENSE = LGPLv2+ (WebCore), Commercial license
> +QT5WEBKIT_REDISTRIBUTE = NO
> +endif
> +
> +ifeq ($(BR2_PACKAGE_QT5BASE_XCB),y)
> +QT5WEBKIT_DEPENDENCIES += xlib_libXext xlib_libXrender
> +endif
> +
> +ifeq ($(BR2_PACKAGE_QT5DECLARATIVE),y)
> +QT5WEBKIT_DEPENDENCIES += qt5declarative
> +endif
> +
> +# Create an empty .git/ folder to force headers re-generation.
> +# See http://github.com/meta-qt5/meta-qt5/blob/master/recipes-qt/qt5/qt5.inc
> +define QT5WEBKIT_CONFIGURE_CMDS
> +	mkdir -p $(@D)/.git
> +	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/usr/bin/qmake)
> +endef
> +
> +define QT5WEBKIT_BUILD_CMDS
> +	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
> +endef
> +
> +define QT5WEBKIT_INSTALL_STAGING_CMDS
> +	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
> +	$(QT5_LA_PRL_FILES_FIXUP)
> +endef
> +
> +ifeq ($(BR2_PACKAGE_QT5DECLARATIVE_QUICK),y)
> +define QT5WEBKIT_INSTALL_TARGET_QMLS
> +	cp -dpfr $(STAGING_DIR)/usr/qml/QtWebKit $(TARGET_DIR)/usr/qml/
> +endef
> +endif
> +
> +define QT5WEBKIT_INSTALL_TARGET_CMDS
> +	cp -dpf $(STAGING_DIR)/usr/lib/libQt5WebKit*.so.* $(TARGET_DIR)/usr/lib
> +	cp -dpf $(@D)/bin/* $(TARGET_DIR)/usr/bin/
> +	$(QT5WEBKIT_INSTALL_TARGET_QMLS)
> +endef
> +
> +$(eval $(generic-package))
>
Arnout Vandecappelle April 10, 2016, 9:55 p.m. UTC | #2
On 04/01/16 17:40, Gary Bisson wrote:
> Although this package has been removed from the official release
> packages since Qt5.6.0, it is still available for users to build
> it from source. This is useful for platforms without GPU since its
> successor (QtWebEngine) requires OpenGL support.
>
> The package now matches the community-based meta-qt5 Yocto layer,
> using the exact same revision of the qtwebkit source from github:
> https://github.com/meta-qt5/meta-qt5/commit/e434995a
>
> Here is the project source tree:
> https://github.com/qtproject/qtwebkit
>
> All the patches have been pulled from Yocto as well.
>
> Since we are now using the source from the git repository, we need
> to create an empty .git/ folder to force the headers re-generation.
> https://github.com/meta-qt5/meta-qt5/blob/jethro/recipes-qt/qt5/qt5.inc#L33
>
> Note that GPLv3 license option has been added with this release.
>
> Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
> ---
> Hi all,
>
> Changelog v1->v2:
> - Add comment to explain GitHub choice, suggested by Arnout.
> - Add comment to explain .git folder creation, suggested by Julien.
> - Remove || true for .git folder creation, suggested by Julien.
> - Add SOB to patches, suggested by Julien and Arnout.
> - Remove x/y number in patches titles, suggested by Arnout.
>
> I know the .git folder will still make people wonder, I unfortunately haven't
> found the exact Makefile where this folder makes a difference. My comment
> points to the meta-qt5 inc file which does it with the following explanation:
> # Regenerate header files when they are included in source tarball
> # Otherwise cmake files don't set PRIVATE_HEADERS correctly
> do_configure_prepend() {
>      rm -rf ${S}/include
>      mkdir -p ${S}/.git || true
> }

  I've found out, I'll comment on it below.

>
> Tested on i.MX6Q Nitrogen6x platform.
>
> Regards,
> Gary
> ---
>   Config.in.legacy                                   |  7 --
>   package/qt5/Config.in                              |  1 +
>   .../0001-qtwebkit-fix-QA-issue-bad-RPATH.patch     | 31 +++++++++
>   .../qt5webkit/0002-Remove-TEXTREL-tag-in-x86.patch | 80 ++++++++++++++++++++++
>   ...ude-backtrace-API-for-non-glibc-libraries.patch | 39 +++++++++++
>   .../0004-Fix-linking-with-libpthread.patch         | 34 +++++++++
>   package/qt5/qt5webkit/Config.in                    | 24 +++++++
>   package/qt5/qt5webkit/qt5webkit.hash               |  2 +
>   package/qt5/qt5webkit/qt5webkit.mk                 | 62 +++++++++++++++++
>   9 files changed, 273 insertions(+), 7 deletions(-)
>   create mode 100644 package/qt5/qt5webkit/0001-qtwebkit-fix-QA-issue-bad-RPATH.patch
>   create mode 100644 package/qt5/qt5webkit/0002-Remove-TEXTREL-tag-in-x86.patch
>   create mode 100644 package/qt5/qt5webkit/0003-Exclude-backtrace-API-for-non-glibc-libraries.patch
>   create mode 100644 package/qt5/qt5webkit/0004-Fix-linking-with-libpthread.patch
>   create mode 100644 package/qt5/qt5webkit/Config.in
>   create mode 100644 package/qt5/qt5webkit/qt5webkit.hash
>   create mode 100644 package/qt5/qt5webkit/qt5webkit.mk
[snip]
> diff --git a/package/qt5/qt5webkit/qt5webkit.mk b/package/qt5/qt5webkit/qt5webkit.mk
> new file mode 100644
> index 0000000..1ac4c25
> --- /dev/null
> +++ b/package/qt5/qt5webkit/qt5webkit.mk
> @@ -0,0 +1,62 @@
> +################################################################################
> +#
> +# qt5webkit
> +#
> +################################################################################
> +
> +QT5WEBKIT_VERSION = d2ff5a085572b1ee24dcb42ae107063f3142d14e
> +# Using GitHub since it supports downloading tarballs from random commits.
> +# The http://code.qt.io/cgit/qt/qtwebkit.git/ repo doesn't allow to do so.
> +QT5WEBKIT_SITE = $(call github,qtproject,qtwebkit,$(QT5WEBKIT_VERSION))
> +QT5WEBKIT_DEPENDENCIES = qt5base sqlite host-ruby host-gperf host-bison host-flex
> +QT5WEBKIT_INSTALL_STAGING = YES
> +
> +QT5WEBKIT_LICENSE_FILES = Source/WebCore/LICENSE-LGPL-2 Source/WebCore/LICENSE-LGPL-2.1
> +
> +ifeq ($(BR2_PACKAGE_QT5BASE_LICENSE_APPROVED),y)
> +QT5WEBKIT_LICENSE = LGPLv2+ (WebCore), LGPLv2.1 with exception or LGPLv3 or GPLv2 or GPLv3

  Actually, as far as I can see with the help of fossology, it's all LGPLv2+ 
except a few files which specify additional possibilities. So I'd say that it's 
LGPLv2+.

  There is also quite a lot of BSD-2c and BSD-3c, so I'd add those, even if 
there's no corresponding license file.

  There are also a few build tools that are GPLv2+ but we don't consider those.

> +# Source files contain references to LGPL_EXCEPTION.txt but it is not included
> +# in the archive.
> +QT5WEBKIT_LICENSE_FILES += LICENSE.LGPLv21 LICENSE.LGPLv3 LICENSE.GPLv2 LICENSE.GPLv3

  This is a funny situation... Four license files are provided, but none of them 
actually corresponds to the license of the code... Anyway, I'd keep just the 
LGPLv21 file.

> +else
> +QT5WEBKIT_LICENSE = LGPLv2+ (WebCore), Commercial license
> +QT5WEBKIT_REDISTRIBUTE = NO
> +endif
> +
> +ifeq ($(BR2_PACKAGE_QT5BASE_XCB),y)
> +QT5WEBKIT_DEPENDENCIES += xlib_libXext xlib_libXrender
> +endif
> +
> +ifeq ($(BR2_PACKAGE_QT5DECLARATIVE),y)
> +QT5WEBKIT_DEPENDENCIES += qt5declarative
> +endif
> +
> +# Create an empty .git/ folder to force headers re-generation.
> +# See http://github.com/meta-qt5/meta-qt5/blob/master/recipes-qt/qt5/qt5.inc

  Here's my analysis of the situation; I'll write it as comments directly for 
easy cut and paste.

# Since we get the source from git, generated header files are not included.
# qmake detects that header file generation (using the syncqt tool) must be
# done based on the existence of a .git directory (cfr. the git_build config
# option which is set in qt_build_paths.prf).
# So, to make sure that qmake detects that header files must be generated,
# create an empty .git directory.


  Regards,
  Arnout

> +define QT5WEBKIT_CONFIGURE_CMDS
> +	mkdir -p $(@D)/.git
> +	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/usr/bin/qmake)
> +endef
> +
> +define QT5WEBKIT_BUILD_CMDS
> +	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
> +endef
> +
> +define QT5WEBKIT_INSTALL_STAGING_CMDS
> +	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
> +	$(QT5_LA_PRL_FILES_FIXUP)
> +endef
> +
> +ifeq ($(BR2_PACKAGE_QT5DECLARATIVE_QUICK),y)
> +define QT5WEBKIT_INSTALL_TARGET_QMLS
> +	cp -dpfr $(STAGING_DIR)/usr/qml/QtWebKit $(TARGET_DIR)/usr/qml/
> +endef
> +endif
> +
> +define QT5WEBKIT_INSTALL_TARGET_CMDS
> +	cp -dpf $(STAGING_DIR)/usr/lib/libQt5WebKit*.so.* $(TARGET_DIR)/usr/lib
> +	cp -dpf $(@D)/bin/* $(TARGET_DIR)/usr/bin/
> +	$(QT5WEBKIT_INSTALL_TARGET_QMLS)
> +endef
> +
> +$(eval $(generic-package))
>
Gary Bisson April 11, 2016, 9:13 p.m. UTC | #3
Arnout, All,

On Sun, Apr 10, 2016 at 11:55 PM, Arnout Vandecappelle <arnout@mind.be> wrote:
> On 04/01/16 17:40, Gary Bisson wrote:
>>
>> Although this package has been removed from the official release
>> packages since Qt5.6.0, it is still available for users to build
>> it from source. This is useful for platforms without GPU since its
>> successor (QtWebEngine) requires OpenGL support.
>>
>> The package now matches the community-based meta-qt5 Yocto layer,
>> using the exact same revision of the qtwebkit source from github:
>> https://github.com/meta-qt5/meta-qt5/commit/e434995a
>>
>> Here is the project source tree:
>> https://github.com/qtproject/qtwebkit
>>
>> All the patches have been pulled from Yocto as well.
>>
>> Since we are now using the source from the git repository, we need
>> to create an empty .git/ folder to force the headers re-generation.
>>
>> https://github.com/meta-qt5/meta-qt5/blob/jethro/recipes-qt/qt5/qt5.inc#L33
>>
>> Note that GPLv3 license option has been added with this release.
>>
>> Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
>> ---
>> Hi all,
>>
>> Changelog v1->v2:
>> - Add comment to explain GitHub choice, suggested by Arnout.
>> - Add comment to explain .git folder creation, suggested by Julien.
>> - Remove || true for .git folder creation, suggested by Julien.
>> - Add SOB to patches, suggested by Julien and Arnout.
>> - Remove x/y number in patches titles, suggested by Arnout.
>>
>> I know the .git folder will still make people wonder, I unfortunately
>> haven't
>> found the exact Makefile where this folder makes a difference. My comment
>> points to the meta-qt5 inc file which does it with the following
>> explanation:
>> # Regenerate header files when they are included in source tarball
>> # Otherwise cmake files don't set PRIVATE_HEADERS correctly
>> do_configure_prepend() {
>>      rm -rf ${S}/include
>>      mkdir -p ${S}/.git || true
>> }
>
>
>  I've found out, I'll comment on it below.

Thanks for looking into it!

>> Tested on i.MX6Q Nitrogen6x platform.
>>
>> Regards,
>> Gary
>> ---
>>   Config.in.legacy                                   |  7 --
>>   package/qt5/Config.in                              |  1 +
>>   .../0001-qtwebkit-fix-QA-issue-bad-RPATH.patch     | 31 +++++++++
>>   .../qt5webkit/0002-Remove-TEXTREL-tag-in-x86.patch | 80
>> ++++++++++++++++++++++
>>   ...ude-backtrace-API-for-non-glibc-libraries.patch | 39 +++++++++++
>>   .../0004-Fix-linking-with-libpthread.patch         | 34 +++++++++
>>   package/qt5/qt5webkit/Config.in                    | 24 +++++++
>>   package/qt5/qt5webkit/qt5webkit.hash               |  2 +
>>   package/qt5/qt5webkit/qt5webkit.mk                 | 62
>> +++++++++++++++++
>>   9 files changed, 273 insertions(+), 7 deletions(-)
>>   create mode 100644
>> package/qt5/qt5webkit/0001-qtwebkit-fix-QA-issue-bad-RPATH.patch
>>   create mode 100644
>> package/qt5/qt5webkit/0002-Remove-TEXTREL-tag-in-x86.patch
>>   create mode 100644
>> package/qt5/qt5webkit/0003-Exclude-backtrace-API-for-non-glibc-libraries.patch
>>   create mode 100644
>> package/qt5/qt5webkit/0004-Fix-linking-with-libpthread.patch
>>   create mode 100644 package/qt5/qt5webkit/Config.in
>>   create mode 100644 package/qt5/qt5webkit/qt5webkit.hash
>>   create mode 100644 package/qt5/qt5webkit/qt5webkit.mk
>
> [snip]
>>
>> diff --git a/package/qt5/qt5webkit/qt5webkit.mk
>> b/package/qt5/qt5webkit/qt5webkit.mk
>> new file mode 100644
>> index 0000000..1ac4c25
>> --- /dev/null
>> +++ b/package/qt5/qt5webkit/qt5webkit.mk
>> @@ -0,0 +1,62 @@
>>
>> +################################################################################
>> +#
>> +# qt5webkit
>> +#
>>
>> +################################################################################
>> +
>> +QT5WEBKIT_VERSION = d2ff5a085572b1ee24dcb42ae107063f3142d14e
>> +# Using GitHub since it supports downloading tarballs from random
>> commits.
>> +# The http://code.qt.io/cgit/qt/qtwebkit.git/ repo doesn't allow to do
>> so.
>> +QT5WEBKIT_SITE = $(call github,qtproject,qtwebkit,$(QT5WEBKIT_VERSION))
>> +QT5WEBKIT_DEPENDENCIES = qt5base sqlite host-ruby host-gperf host-bison
>> host-flex
>> +QT5WEBKIT_INSTALL_STAGING = YES
>> +
>> +QT5WEBKIT_LICENSE_FILES = Source/WebCore/LICENSE-LGPL-2
>> Source/WebCore/LICENSE-LGPL-2.1
>> +
>> +ifeq ($(BR2_PACKAGE_QT5BASE_LICENSE_APPROVED),y)
>> +QT5WEBKIT_LICENSE = LGPLv2+ (WebCore), LGPLv2.1 with exception or LGPLv3
>> or GPLv2 or GPLv3
>
>  Actually, as far as I can see with the help of fossology, it's all LGPLv2+
> except a few files which specify additional possibilities. So I'd say that
> it's LGPLv2+.
>
>  There is also quite a lot of BSD-2c and BSD-3c, so I'd add those, even if
> there's no corresponding license file.
>
>  There are also a few build tools that are GPLv2+ but we don't consider
> those.

Yes sorry I actually just looked at the LICENSE files available. The
Yocto recipe actually says "BSD & LGPLv2+ | GPL-2.0"[1].

So I'll discard the GPLv2 as for build tools. Should I specify BSD-2c
and BSD-3c or is BSD sufficient?

>> +# Source files contain references to LGPL_EXCEPTION.txt but it is not
>> included
>> +# in the archive.
>> +QT5WEBKIT_LICENSE_FILES += LICENSE.LGPLv21 LICENSE.LGPLv3 LICENSE.GPLv2
>> LICENSE.GPLv3
>
>  This is a funny situation... Four license files are provided, but none of
> them actually corresponds to the license of the code... Anyway, I'd keep
> just the LGPLv21 file.

They got me there.

>> +else
>> +QT5WEBKIT_LICENSE = LGPLv2+ (WebCore), Commercial license
>> +QT5WEBKIT_REDISTRIBUTE = NO
>> +endif
>> +
>> +ifeq ($(BR2_PACKAGE_QT5BASE_XCB),y)
>> +QT5WEBKIT_DEPENDENCIES += xlib_libXext xlib_libXrender
>> +endif
>> +
>> +ifeq ($(BR2_PACKAGE_QT5DECLARATIVE),y)
>> +QT5WEBKIT_DEPENDENCIES += qt5declarative
>> +endif
>> +
>> +# Create an empty .git/ folder to force headers re-generation.
>> +# See
>> http://github.com/meta-qt5/meta-qt5/blob/master/recipes-qt/qt5/qt5.inc
>
>  Here's my analysis of the situation; I'll write it as comments directly for
> easy cut and paste.
>
> # Since we get the source from git, generated header files are not included.
> # qmake detects that header file generation (using the syncqt tool) must be
> # done based on the existence of a .git directory (cfr. the git_build config
> # option which is set in qt_build_paths.prf).
> # So, to make sure that qmake detects that header files must be generated,
> # create an empty .git directory.

Once again thanks for digging, I tried to grep for \.git but nothing
striked me at the time.

I'll submit a v3 tomorrow.

Regards,
Gary

[1] https://github.com/meta-qt5/meta-qt5/blob/master/recipes-qt/qt5/qtwebkit_git.bb#L4
Arnout Vandecappelle April 11, 2016, 9:57 p.m. UTC | #4
On 04/11/16 23:13, Gary Bisson wrote:
> Arnout, All,
>
> On Sun, Apr 10, 2016 at 11:55 PM, Arnout Vandecappelle <arnout@mind.be> wrote:
>> On 04/01/16 17:40, Gary Bisson wrote:
[snip]
>>> +ifeq ($(BR2_PACKAGE_QT5BASE_LICENSE_APPROVED),y)
>>> +QT5WEBKIT_LICENSE = LGPLv2+ (WebCore), LGPLv2.1 with exception or LGPLv3
>>> or GPLv2 or GPLv3
>>
>>   Actually, as far as I can see with the help of fossology, it's all LGPLv2+
>> except a few files which specify additional possibilities. So I'd say that
>> it's LGPLv2+.
>>
>>   There is also quite a lot of BSD-2c and BSD-3c, so I'd add those, even if
>> there's no corresponding license file.
>>
>>   There are also a few build tools that are GPLv2+ but we don't consider
>> those.
>
> Yes sorry I actually just looked at the LICENSE files available. The
> Yocto recipe actually says "BSD & LGPLv2+ | GPL-2.0"[1].
>
> So I'll discard the GPLv2 as for build tools. Should I specify BSD-2c
> and BSD-3c or is BSD sufficient?

  LGPLv2+, BSD-3c, BSD-2c


  Regards,
  Arnout

>
>>> +# Source files contain references to LGPL_EXCEPTION.txt but it is not
>>> included
>>> +# in the archive.
>>> +QT5WEBKIT_LICENSE_FILES += LICENSE.LGPLv21 LICENSE.LGPLv3 LICENSE.GPLv2
>>> LICENSE.GPLv3
>>
>>   This is a funny situation... Four license files are provided, but none of
>> them actually corresponds to the license of the code... Anyway, I'd keep
>> just the LGPLv21 file.
>
> They got me there.
>
[snip]
>
> [1] https://github.com/meta-qt5/meta-qt5/blob/master/recipes-qt/qt5/qtwebkit_git.bb#L4
>
diff mbox

Patch

diff --git a/Config.in.legacy b/Config.in.legacy
index 60702ce..6691c50 100644
--- a/Config.in.legacy
+++ b/Config.in.legacy
@@ -152,13 +152,6 @@  config BR2_PACKAGE_QT5WEBKIT_EXAMPLES
 	  The qt5webkit-examples package has been removed, since it
 	  was removed from upstream starting from Qt 5.6.
 
-config BR2_PACKAGE_QT5WEBKIT
-	bool "qt5webkit package removed"
-	select BR2_LEGACY
-	help
-	  The qt5webkit package has been removed, since it was removed
-	  from upstream starting from Qt 5.6.
-
 config BR2_PACKAGE_QT5QUICK1
 	bool "qt5quick1 package removed"
 	select BR2_LEGACY
diff --git a/package/qt5/Config.in b/package/qt5/Config.in
index f673daa..0c0e971 100644
--- a/package/qt5/Config.in
+++ b/package/qt5/Config.in
@@ -49,4 +49,5 @@  source "package/qt5/qt5x11extras/Config.in"
 source "package/qt5/qt5xmlpatterns/Config.in"
 comment "legacy compatibility"
 source "package/qt5/qt5script/Config.in"
+source "package/qt5/qt5webkit/Config.in"
 endif
diff --git a/package/qt5/qt5webkit/0001-qtwebkit-fix-QA-issue-bad-RPATH.patch b/package/qt5/qt5webkit/0001-qtwebkit-fix-QA-issue-bad-RPATH.patch
new file mode 100644
index 0000000..ada98a2
--- /dev/null
+++ b/package/qt5/qt5webkit/0001-qtwebkit-fix-QA-issue-bad-RPATH.patch
@@ -0,0 +1,31 @@ 
+From 1735a8484ef9ae336f8d607b56bda64c8af10c79 Mon Sep 17 00:00:00 2001
+From: Trevor Woerner <trevor.woerner@linaro.org>
+Date: Fri, 7 Feb 2014 04:07:17 +0100
+Subject: [PATCH] qtwebkit: fix QA issue (bad RPATH)
+
+Building qtwebkit causes a QA issue such that QtWebPluginProcess and
+QtWebProcess contain bad RPATHs which point into the build location. This fix
+adds a patch to not include the rpath.prf which causes this problem.
+
+Signed-off-by: Trevor Woerner <trevor.woerner@linaro.org>
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
+---
+ Tools/qmake/mkspecs/features/unix/default_post.prf | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/Tools/qmake/mkspecs/features/unix/default_post.prf b/Tools/qmake/mkspecs/features/unix/default_post.prf
+index fd66af6..ef754c3 100644
+--- a/Tools/qmake/mkspecs/features/unix/default_post.prf
++++ b/Tools/qmake/mkspecs/features/unix/default_post.prf
+@@ -61,7 +61,6 @@ linux-*g++* {
+     }
+ }
+ 
+-contains(TEMPLATE, app): CONFIG += rpath
+ 
+ CONFIG(debug, debug|release)|force_debug_info {
+     # Make ld not cache the symbol tables of input files in memory to avoid memory exhaustion during the linking phase.
+-- 
+2.7.0
+
diff --git a/package/qt5/qt5webkit/0002-Remove-TEXTREL-tag-in-x86.patch b/package/qt5/qt5webkit/0002-Remove-TEXTREL-tag-in-x86.patch
new file mode 100644
index 0000000..d07a62f
--- /dev/null
+++ b/package/qt5/qt5webkit/0002-Remove-TEXTREL-tag-in-x86.patch
@@ -0,0 +1,80 @@ 
+From ae16ce17cc7060274a0b0c165b953fc32540f977 Mon Sep 17 00:00:00 2001
+From: Magnus Granberg <zorry@gentoo.org>
+Date: Fri, 27 Feb 2015 11:55:09 +0100
+Subject: [PATCH] Remove TEXTREL tag in x86
+
+Fix textrel QA warnings when building qtwebkit for x86:
+
+  WARNING: QA Issue: ELF binary '/home/andre/rdk/rdk-master/build-vbox32/tmp/work/core2-32-rdk-linux/qtwebkit/5.4.0-r0/packages-split/qtwebkit/usr/lib/libQt5WebKit.so.5.4.0' has relocations in .text [textrel]
+
+Patch from upstream webkit:
+
+  https://bugs.webkit.org/show_bug.cgi?id=70610
+
+Minor refresh required to apply cleanly to the older webkit sources used
+by qtwebkit. Specifically, the patch needed to be modified to account
+for PLATFORM(MAC) -> OS(DARWIN) renaming in recent webkit which is not
+part of qtwebkit yet ( https://bugs.webkit.org/show_bug.cgi?id=99683 ).
+
+Upstream status [webkit] : backport
+Upstream status [qtwebkit] : unclear
+
+Bug: https://bugs.webkit.org/show_bug.cgi?id=70610
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
+---
+ Source/JavaScriptCore/jit/ThunkGenerators.cpp | 24 ++++++++++++++++++++++++
+ Source/WTF/wtf/InlineASM.h                    |  2 ++
+ 2 files changed, 26 insertions(+)
+
+diff --git a/Source/JavaScriptCore/jit/ThunkGenerators.cpp b/Source/JavaScriptCore/jit/ThunkGenerators.cpp
+index 9684df2..8af82d8 100644
+--- a/Source/JavaScriptCore/jit/ThunkGenerators.cpp
++++ b/Source/JavaScriptCore/jit/ThunkGenerators.cpp
+@@ -524,6 +524,30 @@ double jsRound(double d)
+     } \
+     static MathThunk UnaryDoubleOpWrapper(function) = &function##Thunk;
+ 
++#elif CPU(X86) && COMPILER(GCC) && OS(LINUX) && defined(__PIC__)
++#define defineUnaryDoubleOpWrapper(function) \
++    asm( \
++        ".text\n" \
++        ".globl " SYMBOL_STRING(function##Thunk) "\n" \
++        HIDE_SYMBOL(function##Thunk) "\n" \
++        SYMBOL_STRING(function##Thunk) ":" "\n" \
++        "pushl %ebx\n" \
++        "subl $20, %esp\n" \
++        "movsd %xmm0, (%esp) \n" \
++        "call __x86.get_pc_thunk.bx\n" \
++        "addl $_GLOBAL_OFFSET_TABLE_, %ebx\n" \
++        "call " GLOBAL_REFERENCE(function) "\n" \
++        "fstpl (%esp) \n" \
++        "movsd (%esp), %xmm0 \n" \
++        "addl $20, %esp\n" \
++        "popl %ebx\n" \
++        "ret\n" \
++    );\
++    extern "C" { \
++        MathThunkCallingConvention function##Thunk(MathThunkCallingConvention); \
++    } \
++    static MathThunk UnaryDoubleOpWrapper(function) = &function##Thunk;
++
+ #elif CPU(X86) && COMPILER(GCC) && (PLATFORM(MAC) || OS(LINUX))
+ #define defineUnaryDoubleOpWrapper(function) \
+     asm( \
+diff --git a/Source/WTF/wtf/InlineASM.h b/Source/WTF/wtf/InlineASM.h
+index 0a2fe78..2dc40ef 100644
+--- a/Source/WTF/wtf/InlineASM.h
++++ b/Source/WTF/wtf/InlineASM.h
+@@ -46,6 +46,8 @@
+ #define GLOBAL_REFERENCE(name) #name "@plt"
+ #elif CPU(X86) && COMPILER(MINGW)
+ #define GLOBAL_REFERENCE(name) "@" #name "@4"
++#elif OS(LINUX) && CPU(X86) && defined(__PIC__)
++#define GLOBAL_REFERENCE(name) SYMBOL_STRING(name) "@plt"
+ #else
+ #define GLOBAL_REFERENCE(name) SYMBOL_STRING(name)
+ #endif
+-- 
+2.7.0
+
diff --git a/package/qt5/qt5webkit/0003-Exclude-backtrace-API-for-non-glibc-libraries.patch b/package/qt5/qt5webkit/0003-Exclude-backtrace-API-for-non-glibc-libraries.patch
new file mode 100644
index 0000000..9496947
--- /dev/null
+++ b/package/qt5/qt5webkit/0003-Exclude-backtrace-API-for-non-glibc-libraries.patch
@@ -0,0 +1,39 @@ 
+From 6c36f0ff8c1f5852c33d2b23714f9f187cc6ff26 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 5 Jun 2015 19:55:05 -0700
+Subject: [PATCH] Exclude backtrace() API for non-glibc libraries
+
+It was excluding musl with current checks, so lets make it such that it
+considers only glibc when using backtrace API
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
+---
+ Source/WTF/wtf/Assertions.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Source/WTF/wtf/Assertions.cpp b/Source/WTF/wtf/Assertions.cpp
+index 1b2091f..ba03a28 100644
+--- a/Source/WTF/wtf/Assertions.cpp
++++ b/Source/WTF/wtf/Assertions.cpp
+@@ -61,7 +61,7 @@
+ #include <windows.h>
+ #endif
+ 
+-#if (OS(DARWIN) || (OS(LINUX) && !defined(__UCLIBC__))) && !OS(ANDROID)
++#if (OS(DARWIN) || (OS(LINUX) && defined (__GLIBC__) && !defined(__UCLIBC__))) && !OS(ANDROID)
+ #include <cxxabi.h>
+ #include <dlfcn.h>
+ #include <execinfo.h>
+@@ -245,7 +245,7 @@ void WTFReportArgumentAssertionFailure(const char* file, int line, const char* f
+ 
+ void WTFGetBacktrace(void** stack, int* size)
+ {
+-#if (OS(DARWIN) || (OS(LINUX) && !defined(__UCLIBC__))) && !OS(ANDROID)
++#if (OS(DARWIN) || (OS(LINUX) && defined(__GLIBC__) && !defined(__UCLIBC__))) && !OS(ANDROID)
+     *size = backtrace(stack, *size);
+ #elif OS(WINDOWS) && !OS(WINCE)
+     // The CaptureStackBackTrace function is available in XP, but it is not defined
+-- 
+2.7.0
+
diff --git a/package/qt5/qt5webkit/0004-Fix-linking-with-libpthread.patch b/package/qt5/qt5webkit/0004-Fix-linking-with-libpthread.patch
new file mode 100644
index 0000000..b7b6791
--- /dev/null
+++ b/package/qt5/qt5webkit/0004-Fix-linking-with-libpthread.patch
@@ -0,0 +1,34 @@ 
+From 5dd4bb67cfce812fd7686e43616e2069f354a7df Mon Sep 17 00:00:00 2001
+From: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
+Date: Mon, 22 Feb 2016 10:57:32 +0100
+Subject: [PATCH] Fix linking with libpthread
+
+WebKit use libpthread directly but is depending on other qt modules
+causing it to be linked against, which might break unless -lpthread
+is last. Instead just add it explicitly after the static libraries.
+
+Upstream-Status: Backport from 5.7 branch
+
+Change-Id: I2b95cff2c96373f8dce6f95052c4fccbe1982b33
+Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
+Signed-off-by: Jonathan Liu <net147@gmail.com>
+Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
+---
+ Tools/qmake/mkspecs/features/default_post.prf | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/Tools/qmake/mkspecs/features/default_post.prf b/Tools/qmake/mkspecs/features/default_post.prf
+index 67276b7..39bb3f7 100644
+--- a/Tools/qmake/mkspecs/features/default_post.prf
++++ b/Tools/qmake/mkspecs/features/default_post.prf
+@@ -201,6 +201,7 @@ needToLink() {
+         linkAgainstLibrary($$library, $$eval(WEBKIT.$${library_identifier}.root_source_dir))
+         LIBS += $$eval(WEBKIT.$${library_identifier}.dependent_libs)
+     }
++    posix:!darwin: LIBS += -lpthread
+ }
+ 
+ creating_module {
+-- 
+2.7.1
+
diff --git a/package/qt5/qt5webkit/Config.in b/package/qt5/qt5webkit/Config.in
new file mode 100644
index 0000000..fb84b1e
--- /dev/null
+++ b/package/qt5/qt5webkit/Config.in
@@ -0,0 +1,24 @@ 
+config BR2_PACKAGE_QT5WEBKIT
+	bool "qt5webkit"
+	select BR2_PACKAGE_QT5BASE
+	select BR2_PACKAGE_QT5BASE_ICU
+	select BR2_PACKAGE_QT5BASE_GUI
+	select BR2_PACKAGE_SQLITE
+	select BR2_PACKAGE_XLIB_LIBXEXT if BR2_PACKAGE_QT5BASE_XCB
+	select BR2_PACKAGE_XLIB_LIBXRENDER if BR2_PACKAGE_QT5BASE_XCB
+	# This module does not support static linking
+	depends on !BR2_STATIC_LIBS
+	depends on BR2_PACKAGE_QT5_JSCORE_AVAILABLE
+	depends on !BR2_BINFMT_FLAT # icu
+	help
+	  Qt is a cross-platform application and UI framework for
+	  developers using C++.
+
+	  This package corresponds to the qt5webkit module.
+
+	  This package has been removed from the official release packages
+	  since Qt5.6.0, but it is still available for users to build it
+	  from source. This is useful for platforms without GPU since the
+	  successor (QtWebEngine) requires OpenGL support.
+
+	  http://qt.io
diff --git a/package/qt5/qt5webkit/qt5webkit.hash b/package/qt5/qt5webkit/qt5webkit.hash
new file mode 100644
index 0000000..d2ac7bb
--- /dev/null
+++ b/package/qt5/qt5webkit/qt5webkit.hash
@@ -0,0 +1,2 @@ 
+# locally computed
+sha256 1c79843ef32313312290d4fe0b87256a9129dc44d62b01789a692981edf4d8ab  qt5webkit-d2ff5a085572b1ee24dcb42ae107063f3142d14e.tar.gz
diff --git a/package/qt5/qt5webkit/qt5webkit.mk b/package/qt5/qt5webkit/qt5webkit.mk
new file mode 100644
index 0000000..1ac4c25
--- /dev/null
+++ b/package/qt5/qt5webkit/qt5webkit.mk
@@ -0,0 +1,62 @@ 
+################################################################################
+#
+# qt5webkit
+#
+################################################################################
+
+QT5WEBKIT_VERSION = d2ff5a085572b1ee24dcb42ae107063f3142d14e
+# Using GitHub since it supports downloading tarballs from random commits.
+# The http://code.qt.io/cgit/qt/qtwebkit.git/ repo doesn't allow to do so.
+QT5WEBKIT_SITE = $(call github,qtproject,qtwebkit,$(QT5WEBKIT_VERSION))
+QT5WEBKIT_DEPENDENCIES = qt5base sqlite host-ruby host-gperf host-bison host-flex
+QT5WEBKIT_INSTALL_STAGING = YES
+
+QT5WEBKIT_LICENSE_FILES = Source/WebCore/LICENSE-LGPL-2 Source/WebCore/LICENSE-LGPL-2.1
+
+ifeq ($(BR2_PACKAGE_QT5BASE_LICENSE_APPROVED),y)
+QT5WEBKIT_LICENSE = LGPLv2+ (WebCore), LGPLv2.1 with exception or LGPLv3 or GPLv2 or GPLv3
+# Source files contain references to LGPL_EXCEPTION.txt but it is not included
+# in the archive.
+QT5WEBKIT_LICENSE_FILES += LICENSE.LGPLv21 LICENSE.LGPLv3 LICENSE.GPLv2 LICENSE.GPLv3
+else
+QT5WEBKIT_LICENSE = LGPLv2+ (WebCore), Commercial license
+QT5WEBKIT_REDISTRIBUTE = NO
+endif
+
+ifeq ($(BR2_PACKAGE_QT5BASE_XCB),y)
+QT5WEBKIT_DEPENDENCIES += xlib_libXext xlib_libXrender
+endif
+
+ifeq ($(BR2_PACKAGE_QT5DECLARATIVE),y)
+QT5WEBKIT_DEPENDENCIES += qt5declarative
+endif
+
+# Create an empty .git/ folder to force headers re-generation.
+# See http://github.com/meta-qt5/meta-qt5/blob/master/recipes-qt/qt5/qt5.inc
+define QT5WEBKIT_CONFIGURE_CMDS
+	mkdir -p $(@D)/.git
+	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/usr/bin/qmake)
+endef
+
+define QT5WEBKIT_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
+endef
+
+define QT5WEBKIT_INSTALL_STAGING_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
+	$(QT5_LA_PRL_FILES_FIXUP)
+endef
+
+ifeq ($(BR2_PACKAGE_QT5DECLARATIVE_QUICK),y)
+define QT5WEBKIT_INSTALL_TARGET_QMLS
+	cp -dpfr $(STAGING_DIR)/usr/qml/QtWebKit $(TARGET_DIR)/usr/qml/
+endef
+endif
+
+define QT5WEBKIT_INSTALL_TARGET_CMDS
+	cp -dpf $(STAGING_DIR)/usr/lib/libQt5WebKit*.so.* $(TARGET_DIR)/usr/lib
+	cp -dpf $(@D)/bin/* $(TARGET_DIR)/usr/bin/
+	$(QT5WEBKIT_INSTALL_TARGET_QMLS)
+endef
+
+$(eval $(generic-package))