author | Antonio Rojas
<arojas@archlinux.org> 2018-05-22 08:34:59 UTC |
committer | Antonio Rojas
<arojas@archlinux.org> 2018-05-22 08:34:59 UTC |
parent | 41774336712867c83db14d644a6965ab18cbf505 |
PKGBUILD | +17 | -16 |
qtwebengine-ffmpeg4.patch | +0 | -76 |
qtwebengine-gcc8.patch | +36 | -0 |
qtwebengine-no-gpu.patch | +0 | -99 |
diff --git a/PKGBUILD b/PKGBUILD index 9cfbc77..ca7cfe3 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -2,9 +2,9 @@ # Contributor: Andrea Scarpino <andrea@archlinux.org> pkgname=qt5-webengine -_qtver=5.10.1 +_qtver=5.11.0 pkgver=${_qtver/-/} -pkgrel=2 +pkgrel=1 arch=('x86_64') url='http://qt-project.org/' license=('LGPL3' 'LGPL2.1' 'BSD') @@ -15,13 +15,13 @@ makedepends=('python2' 'git' 'gperf' 'jsoncpp' 'ninja' 'qt5-tools') groups=('qt' 'qt5') _pkgfqn="${pkgname/5-/}-everywhere-src-${_qtver}" source=("http://download.qt.io/official_releases/qt/${pkgver%.*}/${_qtver}/submodules/${_pkgfqn}.tar.xz" - qtwebengine-harmony.patch - qtwebengine-no-gpu.patch - qtwebengine-ffmpeg4.patch) -sha256sums=('12644f8d2ba8354a2a533d5a7f3f5139c6ff168c2f51aa3e21b701db6dbc01de' + qtwebengine-harmony.patch qtwebengine-gcc8.patch qtwebengine-ffmpeg4.patch + falkon-copy-menu.patch::"http://code.qt.io/cgit/qt/qtwebengine.git/patch/?id=af0c47b1") +sha256sums=('5dd754d603c66d36e93b96b4f7c24a6e6269ae6a1682a524b8baa664d5c44b45' 'feca54ab09ac0fc9d0626770a6b899a6ac5a12173c7d0c1005bc3964ec83e7b3' - '6cd70c37f3b3aea926f1ee20c1f59354f2a02d240dbf344c6dc0a75f8aa8e07b' - 'bbba71e97bae57245d2aba37684301924746e88e92091d6a248097c91dcda4a1') + '7f84891ef1ac9b7943ac5b92f2df8caf0c24c3695bdc6296926b581a87c0e856' + '4a831d89fb0d6a6ced23115ced71e60513ce279fba4bd493178842647948f510' + 'b5b3d873c51ed2ad05b2ffe1f3d14cd95a732f0e1288c04a502d65576e316f5d') prepare() { mkdir -p build @@ -34,12 +34,13 @@ prepare() { # FreeType 2.8.1 patch -Np1 -i ../qtwebengine-harmony.patch - # Disable GPU rendering on nouveau and wayland (openSUSE) https://bugreports.qt.io/browse/QTBUG-65682 - patch -p1 -i ../qtwebengine-no-gpu.patch - - cd src/3rdparty -# Fix build with ffmpeg 4 - patch -p1 -i "$srcdir"/qtwebengine-ffmpeg4.patch + # Fix copy context menu + patch -p1 -i "$srcdir"/falkon-copy-menu.patch + # Fix build with gcc8 (Fedora) + cd src/3rdparty/chromium + patch -p1 -i "$srcdir"/qtwebengine-gcc8.patch + # Fix build with ffmpeg 4 + patch -p2 -i "$srcdir"/qtwebengine-ffmpeg4.patch } build() { @@ -50,8 +51,8 @@ build() { -proprietary-codecs \ -system-ffmpeg \ -webp \ - -spellchecker -# -webengine-icu + -spellchecker \ + -webengine-icu make } diff --git a/qtwebengine-ffmpeg4.patch b/qtwebengine-ffmpeg4.patch index c91cd54..bc92ec6 100644 --- a/qtwebengine-ffmpeg4.patch +++ b/qtwebengine-ffmpeg4.patch @@ -11,79 +11,3 @@ index 0341e5784f..60ffba708b 100644 #if defined(ARCH_CPU_ARM_FAMILY) kAlignmentSize = 16 #else -diff --git a/chromium/media/ffmpeg/ffmpeg_common.cc b/chromium/media/ffmpeg/ffmpeg_common.cc -index 61d0bc341c..d79c694555 100644 ---- a/chromium/media/ffmpeg/ffmpeg_common.cc -+++ b/chromium/media/ffmpeg/ffmpeg_common.cc -@@ -30,10 +30,10 @@ EncryptionScheme GetEncryptionScheme(const AVStream* stream) { - - } // namespace - --// Why FF_INPUT_BUFFER_PADDING_SIZE? FFmpeg assumes all input buffers are -+// Why AV_INPUT_BUFFER_PADDING_SIZE? FFmpeg assumes all input buffers are - // padded. Check here to ensure FFmpeg only receives data padded to its - // specifications. --static_assert(DecoderBuffer::kPaddingSize >= FF_INPUT_BUFFER_PADDING_SIZE, -+static_assert(DecoderBuffer::kPaddingSize >= AV_INPUT_BUFFER_PADDING_SIZE, - "DecoderBuffer padding size does not fit ffmpeg requirement"); - - // Alignment requirement by FFmpeg for input and output buffers. This need to -@@ -444,11 +444,11 @@ void AudioDecoderConfigToAVCodecContext(const AudioDecoderConfig& config, - } else { - codec_context->extradata_size = config.extra_data().size(); - codec_context->extradata = reinterpret_cast<uint8_t*>( -- av_malloc(config.extra_data().size() + FF_INPUT_BUFFER_PADDING_SIZE)); -+ av_malloc(config.extra_data().size() + AV_INPUT_BUFFER_PADDING_SIZE)); - memcpy(codec_context->extradata, &config.extra_data()[0], - config.extra_data().size()); - memset(codec_context->extradata + config.extra_data().size(), '\0', -- FF_INPUT_BUFFER_PADDING_SIZE); -+ AV_INPUT_BUFFER_PADDING_SIZE); - } - } - -@@ -585,11 +585,11 @@ void VideoDecoderConfigToAVCodecContext( - } else { - codec_context->extradata_size = config.extra_data().size(); - codec_context->extradata = reinterpret_cast<uint8_t*>( -- av_malloc(config.extra_data().size() + FF_INPUT_BUFFER_PADDING_SIZE)); -+ av_malloc(config.extra_data().size() + AV_INPUT_BUFFER_PADDING_SIZE)); - memcpy(codec_context->extradata, &config.extra_data()[0], - config.extra_data().size()); - memset(codec_context->extradata + config.extra_data().size(), '\0', -- FF_INPUT_BUFFER_PADDING_SIZE); -+ AV_INPUT_BUFFER_PADDING_SIZE); - } - } - -diff --git a/chromium/media/filters/ffmpeg_audio_decoder.cc b/chromium/media/filters/ffmpeg_audio_decoder.cc -index b4020b001d..41da2d3939 100644 ---- a/chromium/media/filters/ffmpeg_audio_decoder.cc -+++ b/chromium/media/filters/ffmpeg_audio_decoder.cc -@@ -368,7 +368,7 @@ void FFmpegAudioDecoder::ResetTimestampState(const AudioDecoderConfig& config) { - int FFmpegAudioDecoder::GetAudioBuffer(struct AVCodecContext* s, - AVFrame* frame, - int flags) { -- DCHECK(s->codec->capabilities & CODEC_CAP_DR1); -+ DCHECK(s->codec->capabilities & AV_CODEC_CAP_DR1); - DCHECK_EQ(s->codec_type, AVMEDIA_TYPE_AUDIO); - - // Since this routine is called by FFmpeg when a buffer is required for audio -diff --git a/chromium/media/filters/ffmpeg_video_decoder.cc b/chromium/media/filters/ffmpeg_video_decoder.cc -index 42d044dd69..32f5c7b79d 100644 ---- a/chromium/media/filters/ffmpeg_video_decoder.cc -+++ b/chromium/media/filters/ffmpeg_video_decoder.cc -@@ -427,12 +427,11 @@ bool FFmpegVideoDecoder::ConfigureDecoder(const VideoDecoderConfig& config, - codec_context_->thread_type = - FF_THREAD_SLICE | (low_delay ? 0 : FF_THREAD_FRAME); - codec_context_->opaque = this; -- codec_context_->flags |= CODEC_FLAG_EMU_EDGE; - codec_context_->get_buffer2 = GetVideoBufferImpl; - codec_context_->refcounted_frames = 1; - - if (decode_nalus_) -- codec_context_->flags2 |= CODEC_FLAG2_CHUNKS; -+ codec_context_->flags2 |= AV_CODEC_FLAG2_CHUNKS; - - AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id); - if (!codec || avcodec_open2(codec_context_.get(), codec, NULL) < 0) { diff --git a/qtwebengine-gcc8.patch b/qtwebengine-gcc8.patch new file mode 100644 index 0000000..a27f3a8 --- /dev/null +++ b/qtwebengine-gcc8.patch @@ -0,0 +1,36 @@ +diff -up chromium-65.0.3325.162/mojo/public/cpp/bindings/associated_interface_ptr_info.h.boolfix chromium-65.0.3325.162/mojo/public/cpp/bindings/associated_interface_ptr_info.h +--- chromium-65.0.3325.162/mojo/public/cpp/bindings/associated_interface_ptr_info.h.boolfix 2018-03-15 13:07:54.999428755 -0400 ++++ chromium-65.0.3325.162/mojo/public/cpp/bindings/associated_interface_ptr_info.h 2018-03-15 13:08:21.270794252 -0400 +@@ -45,7 +45,7 @@ class AssociatedInterfacePtrInfo { + + bool is_valid() const { return handle_.is_valid(); } + +- explicit operator bool() const { return handle_; } ++ explicit operator bool() const { return (bool) handle_; } + + ScopedInterfaceEndpointHandle PassHandle() { + return std::move(handle_); +diff -up chromium-65.0.3325.162/mojo/public/cpp/bindings/associated_interface_request.h.boolfix chromium-65.0.3325.162/mojo/public/cpp/bindings/associated_interface_request.h +--- chromium-65.0.3325.162/mojo/public/cpp/bindings/associated_interface_request.h.boolfix 2018-03-15 13:07:09.680523296 -0400 ++++ chromium-65.0.3325.162/mojo/public/cpp/bindings/associated_interface_request.h 2018-03-15 13:07:44.429684037 -0400 +@@ -50,7 +50,7 @@ class AssociatedInterfaceRequest { + // handle. + bool is_pending() const { return handle_.is_valid(); } + +- explicit operator bool() const { return handle_; } ++ explicit operator bool() const { return (bool) handle_; } + + ScopedInterfaceEndpointHandle PassHandle() { return std::move(handle_); } + +diff -up chromium-65.0.3325.162/mojo/public/cpp/bindings/interface_request.h.boolfix chromium-65.0.3325.162/mojo/public/cpp/bindings/interface_request.h +--- chromium-65.0.3325.162/mojo/public/cpp/bindings/interface_request.h.boolfix 2018-03-15 13:08:33.494499025 -0400 ++++ chromium-65.0.3325.162/mojo/public/cpp/bindings/interface_request.h 2018-03-15 13:10:39.218462546 -0400 +@@ -54,7 +54,7 @@ class InterfaceRequest { + // Indicates whether the request currently contains a valid message pipe. + bool is_pending() const { return handle_.is_valid(); } + +- explicit operator bool() const { return handle_; } ++ explicit operator bool() const { return (bool) handle_; } + + // Removes the message pipe from the request and returns it. + ScopedMessagePipeHandle PassMessagePipe() { return std::move(handle_); } diff --git a/qtwebengine-no-gpu.patch b/qtwebengine-no-gpu.patch deleted file mode 100644 index 4662f5f..0000000 --- a/qtwebengine-no-gpu.patch +++ /dev/null @@ -1,99 +0,0 @@ -From: Antonio Larrosa <alarrosa@suse.com> -Subject: Disable GPU when using nouveau or running on wayland -References: boo#1005323, boo#1060990 - -Qt WebEngine uses multi-threaded OpenGL, which nouveau does not support. -It also crashes when running on wayland, the cause is not yet known. -Work around these issues by not doing GPU-accelerated rendering in such -cases. - -Index: qtwebengine-everywhere-src-5.10.0/src/core/web_engine_context.cpp -=================================================================== ---- qtwebengine-everywhere-src-5.10.0.orig/src/core/web_engine_context.cpp -+++ qtwebengine-everywhere-src-5.10.0/src/core/web_engine_context.cpp -@@ -93,6 +93,7 @@ - #include <QOffscreenSurface> - #ifndef QT_NO_OPENGL - # include <QOpenGLContext> -+# include <QOpenGLFunctions> - #endif - #include <QQuickWindow> - #include <QStringList> -@@ -167,6 +168,39 @@ void dummyGetPluginCallback(const std::v - } - #endif - -+#ifndef QT_NO_OPENGL -+QString openGLVendor() -+{ -+ QString vendor; -+ -+ QOpenGLContext *oldContext = QOpenGLContext::currentContext(); -+ QSurface *oldSurface = 0; -+ if (oldContext) -+ oldSurface = oldContext->surface(); -+ -+ QScopedPointer<QOffscreenSurface> surface( new QOffscreenSurface ); -+ surface->create(); -+ QOpenGLContext context; -+ if (!context.create()) { -+ qDebug() << "Error creating openGL context"; -+ } -+ else if (!context.makeCurrent(surface.data())) { -+ qDebug() << "Error making openGL context current context"; -+ } else { -+ const GLubyte *p; -+ QOpenGLFunctions *f = context.functions(); -+ if ((p = f->glGetString(GL_VENDOR))) -+ vendor = QString::fromLatin1(reinterpret_cast<const char *>(p)); -+ } -+ -+ context.doneCurrent(); -+ if (oldContext && oldSurface) -+ oldContext->makeCurrent(oldSurface); -+ -+ return vendor; -+} -+#endif -+ - } // namespace - - namespace QtWebEngineCore { -@@ -379,6 +413,27 @@ WebEngineContext::WebEngineContext() - const char *glType = 0; - #ifndef QT_NO_OPENGL - -+ bool disableGpu = qEnvironmentVariableIsSet("QT_WEBENGINE_DISABLE_GPU"); -+ -+ if (!qEnvironmentVariableIsSet("QT_WEBENGINE_DISABLE_WAYLAND_WORKAROUND") && platform.startsWith("wayland", Qt::CaseInsensitive)) -+ { -+ qWarning() << "Running on wayland. Qt WebEngine will disable usage of the GPU.\n" -+ "Note: you can set the QT_WEBENGINE_DISABLE_WAYLAND_WORKAROUND\n" -+ "environment variable before running this application, but this is \n" -+ "not recommended since this usually causes applications to crash."; -+ disableGpu = true; -+ } -+ -+ if (!qEnvironmentVariableIsSet("QT_WEBENGINE_DISABLE_NOUVEAU_WORKAROUND") && openGLVendor() == QStringLiteral("nouveau")) -+ { -+ qWarning() << "Nouveau openGL driver detected. Qt WebEngine will disable usage of the GPU.\n" -+ "Note: you can set the QT_WEBENGINE_DISABLE_NOUVEAU_WORKAROUND\n" -+ "environment variable before running this application, but this is \n" -+ "not recommended since this usually causes applications to crash as\n" -+ "Nouveau openGL drivers don't support multithreaded rendering"; -+ disableGpu = true; -+ } -+ - bool tryGL = - !usingANGLE() - && (!usingSoftwareDynamicGL() -@@ -389,7 +444,7 @@ WebEngineContext::WebEngineContext() - || enableWebGLSoftwareRendering - #endif - ) -- && !usingQtQuick2DRenderer(); -+ && !usingQtQuick2DRenderer() && !disableGpu; - - if (tryGL) { - if (qt_gl_global_share_context() && qt_gl_global_share_context()->isValid()) { -