From c546c26e3a7c20e23d82209176e378ccbb00fdb8 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Tue, 23 May 2017 11:12:19 -0500 Subject: [PATCH] qt58.qtwebkit: use QLatin1String instead of QStringLiteral --- .../0001-dlopen-webkit-nsplugin.patch | 53 --------------- .../5.8/qtwebkit/0002-dlopen-webkit-gtk.patch | 25 -------- .../qtwebkit/0003-dlopen-webkit-udev.patch | 31 --------- .../libraries/qt-5/5.8/qtwebkit/default.nix | 31 ++++----- .../5.8/qtwebkit/qtwebkit-dlopen-gtk.patch | 64 +++++++++++++++++++ .../5.8/qtwebkit/qtwebkit-dlopen-udev.patch | 0 ...in.patch => qtwebkit-icucore-darwin.patch} | 4 +- .../libraries/qt-5/5.8/qtwebkit/series | 3 + 8 files changed, 82 insertions(+), 129 deletions(-) delete mode 100644 pkgs/development/libraries/qt-5/5.8/qtwebkit/0001-dlopen-webkit-nsplugin.patch delete mode 100644 pkgs/development/libraries/qt-5/5.8/qtwebkit/0002-dlopen-webkit-gtk.patch delete mode 100644 pkgs/development/libraries/qt-5/5.8/qtwebkit/0003-dlopen-webkit-udev.patch create mode 100644 pkgs/development/libraries/qt-5/5.8/qtwebkit/qtwebkit-dlopen-gtk.patch create mode 100644 pkgs/development/libraries/qt-5/5.8/qtwebkit/qtwebkit-dlopen-udev.patch rename pkgs/development/libraries/qt-5/5.8/qtwebkit/{0004-icucore-darwin.patch => qtwebkit-icucore-darwin.patch} (75%) create mode 100644 pkgs/development/libraries/qt-5/5.8/qtwebkit/series diff --git a/pkgs/development/libraries/qt-5/5.8/qtwebkit/0001-dlopen-webkit-nsplugin.patch b/pkgs/development/libraries/qt-5/5.8/qtwebkit/0001-dlopen-webkit-nsplugin.patch deleted file mode 100644 index 0eeacce1bc0..00000000000 --- a/pkgs/development/libraries/qt-5/5.8/qtwebkit/0001-dlopen-webkit-nsplugin.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 862ce7d357a3ec32683ac6ec7c0ebdc9346b44ba Mon Sep 17 00:00:00 2001 -From: Thomas Tuegel -Date: Sun, 23 Aug 2015 09:18:54 -0500 -Subject: [PATCH 1/3] dlopen webkit nsplugin - ---- - Source/WebCore/plugins/qt/PluginPackageQt.cpp | 2 +- - Source/WebCore/plugins/qt/PluginViewQt.cpp | 2 +- - Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp | 2 +- - 3 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/Source/WebCore/plugins/qt/PluginPackageQt.cpp b/Source/WebCore/plugins/qt/PluginPackageQt.cpp -index a923d49..2731d05 100644 ---- a/Source/WebCore/plugins/qt/PluginPackageQt.cpp -+++ b/Source/WebCore/plugins/qt/PluginPackageQt.cpp -@@ -136,7 +136,7 @@ static void initializeGtk(QLibrary* module = 0) - } - } - -- QLibrary library(QLatin1String("libgtk-x11-2.0"), 0); -+ QLibrary library(QLatin1String("@gtk@/lib/libgtk-x11-2.0"), 0); - if (library.load()) { - typedef void *(*gtk_init_check_ptr)(int*, char***); - gtk_init_check_ptr gtkInitCheck = (gtk_init_check_ptr)library.resolve("gtk_init_check"); -diff --git a/Source/WebCore/plugins/qt/PluginViewQt.cpp b/Source/WebCore/plugins/qt/PluginViewQt.cpp -index de06a2f..363bde5 100644 ---- a/Source/WebCore/plugins/qt/PluginViewQt.cpp -+++ b/Source/WebCore/plugins/qt/PluginViewQt.cpp -@@ -697,7 +697,7 @@ static Display *getPluginDisplay() - // support gdk based plugins (like flash) that use a different X connection. - // The code below has the same effect as this one: - // Display *gdkDisplay = gdk_x11_display_get_xdisplay(gdk_display_get_default()); -- QLibrary library(QLatin1String("libgdk-x11-2.0"), 0); -+ QLibrary library(QLatin1String("@gdk_pixbuf@/lib/libgdk-x11-2.0"), 0); - if (!library.load()) - return 0; - -diff --git a/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp b/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp -index d734ff6..62a2197 100644 ---- a/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp -+++ b/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp -@@ -64,7 +64,7 @@ static Display* getPluginDisplay() - // The code below has the same effect as this one: - // Display *gdkDisplay = gdk_x11_display_get_xdisplay(gdk_display_get_default()); - -- QLibrary library(QLatin1String("libgdk-x11-2.0"), 0); -+ QLibrary library(QLatin1String("@gdk_pixbuf@/libgdk-x11-2.0"), 0); - if (!library.load()) - return 0; - --- -2.5.0 - diff --git a/pkgs/development/libraries/qt-5/5.8/qtwebkit/0002-dlopen-webkit-gtk.patch b/pkgs/development/libraries/qt-5/5.8/qtwebkit/0002-dlopen-webkit-gtk.patch deleted file mode 100644 index bb5d1f74364..00000000000 --- a/pkgs/development/libraries/qt-5/5.8/qtwebkit/0002-dlopen-webkit-gtk.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 6a407d30357c2551abceac75c82f4a1688e47437 Mon Sep 17 00:00:00 2001 -From: Thomas Tuegel -Date: Sun, 23 Aug 2015 09:19:16 -0500 -Subject: [PATCH 2/3] dlopen webkit gtk - ---- - Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp b/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp -index 8de6521..0b25748 100644 ---- a/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp -+++ b/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp -@@ -53,7 +53,7 @@ static void messageHandler(QtMsgType type, const QMessageLogContext&, const QStr - - static bool initializeGtk() - { -- QLibrary gtkLibrary(QLatin1String("libgtk-x11-2.0"), 0); -+ QLibrary gtkLibrary(QLatin1String("@gtk@/lib/libgtk-x11-2.0"), 0); - if (!gtkLibrary.load()) - return false; - typedef void* (*gtk_init_ptr)(void*, void*); --- -2.5.0 - diff --git a/pkgs/development/libraries/qt-5/5.8/qtwebkit/0003-dlopen-webkit-udev.patch b/pkgs/development/libraries/qt-5/5.8/qtwebkit/0003-dlopen-webkit-udev.patch deleted file mode 100644 index 1c360cd81aa..00000000000 --- a/pkgs/development/libraries/qt-5/5.8/qtwebkit/0003-dlopen-webkit-udev.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 864020dd47c3b6d532d9f26b82185904cf9324f2 Mon Sep 17 00:00:00 2001 -From: Thomas Tuegel -Date: Sun, 23 Aug 2015 09:19:29 -0500 -Subject: [PATCH 3/3] dlopen webkit udev - ---- - Source/WebCore/platform/qt/GamepadsQt.cpp | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/Source/WebCore/platform/qt/GamepadsQt.cpp b/Source/WebCore/platform/qt/GamepadsQt.cpp -index 60ff317..da8ac69 100644 ---- a/Source/WebCore/platform/qt/GamepadsQt.cpp -+++ b/Source/WebCore/platform/qt/GamepadsQt.cpp -@@ -111,12 +111,12 @@ private: - bool load() - { - m_libUdev.setLoadHints(QLibrary::ResolveAllSymbolsHint); -- m_libUdev.setFileNameAndVersion(QStringLiteral("udev"), 1); -+ m_libUdev.setFileNameAndVersion(QStringLiteral("@libudev@/lib/libudev"), 1); - m_loaded = m_libUdev.load(); - if (resolveMethods()) - return true; - -- m_libUdev.setFileNameAndVersion(QStringLiteral("udev"), 0); -+ m_libUdev.setFileNameAndVersion(QStringLiteral("@libudev@/lib/libudev"), 0); - m_loaded = m_libUdev.load(); - return resolveMethods(); - } --- -2.5.0 - diff --git a/pkgs/development/libraries/qt-5/5.8/qtwebkit/default.nix b/pkgs/development/libraries/qt-5/5.8/qtwebkit/default.nix index bee3786ef32..664281aac31 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtwebkit/default.nix +++ b/pkgs/development/libraries/qt-5/5.8/qtwebkit/default.nix @@ -1,4 +1,5 @@ -{ qtSubmodule, stdenv, qtdeclarative, qtlocation, qtsensors +{ qtSubmodule, stdenv, copyPathsToStore, lib +, qtdeclarative, qtlocation, qtsensors , fontconfig, gdk_pixbuf, gtk2, libwebp, libxml2, libxslt , sqlite, systemd, glib, gst_all_1 , bison2, flex, gdb, gperf, perl, pkgconfig, python2, ruby @@ -7,7 +8,7 @@ , flashplayerFix ? false }: -with stdenv.lib; +let inherit (lib) optional optionals getLib; in qtSubmodule { name = "qtwebkit"; @@ -22,23 +23,15 @@ qtSubmodule { "/usr/lib/libicucore.dylib" ]; - patches = - let dlopen-webkit-nsplugin = substituteAll { - src = ./0001-dlopen-webkit-nsplugin.patch; - gtk = gtk2.out; - gdk_pixbuf = gdk_pixbuf.out; - }; - dlopen-webkit-gtk = substituteAll { - src = ./0002-dlopen-webkit-gtk.patch; - gtk = gtk2.out; - }; - dlopen-webkit-udev = substituteAll { - src = ./0003-dlopen-webkit-udev.patch; - libudev = systemd.lib; - }; - in optionals flashplayerFix [ dlopen-webkit-nsplugin dlopen-webkit-gtk ] - ++ optionals (!stdenv.isDarwin) [ dlopen-webkit-udev ] - ++ optionals (stdenv.isDarwin) [ ./0004-icucore-darwin.patch ]; + patches = copyPathsToStore (lib.readPathsFromFile ./. ./series); + + NIX_CFLAGS_COMPILE = + optionals flashplayerFix + [ + ''-DNIXPKGS_LIBGTK2="${getLib gtk2}/lib/libgtk-x11-2.0"'' + ''-DNIXPKGS_LIBGDK2="${getLib gdk_pixbuf}/lib/libgdk-x11-2.0"'' + ] + ++ optional (!stdenv.isDarwin) ''-DNIXPKGS_LIBUDEV="${getLib systemd}/lib/libudev"''; # Hack to avoid TMPDIR in RPATHs. preFixup = ''rm -rf "$(pwd)" && mkdir "$(pwd)" ''; diff --git a/pkgs/development/libraries/qt-5/5.8/qtwebkit/qtwebkit-dlopen-gtk.patch b/pkgs/development/libraries/qt-5/5.8/qtwebkit/qtwebkit-dlopen-gtk.patch new file mode 100644 index 00000000000..e34eda592af --- /dev/null +++ b/pkgs/development/libraries/qt-5/5.8/qtwebkit/qtwebkit-dlopen-gtk.patch @@ -0,0 +1,64 @@ +Index: qtwebkit-opensource-src-5.8.0/Source/WebCore/plugins/qt/PluginPackageQt.cpp +=================================================================== +--- qtwebkit-opensource-src-5.8.0.orig/Source/WebCore/plugins/qt/PluginPackageQt.cpp ++++ qtwebkit-opensource-src-5.8.0/Source/WebCore/plugins/qt/PluginPackageQt.cpp +@@ -136,7 +136,11 @@ static void initializeGtk(QLibrary* modu + } + } + ++#ifdef NIXPKGS_LIBGTK2 ++ QLibrary library(QLatin1String(NIXPKGS_LIBGTK2), 0); ++#else + QLibrary library(QLatin1String("libgtk-x11-2.0"), 0); ++#endif + if (library.load()) { + typedef void *(*gtk_init_check_ptr)(int*, char***); + gtk_init_check_ptr gtkInitCheck = (gtk_init_check_ptr)library.resolve("gtk_init_check"); +Index: qtwebkit-opensource-src-5.8.0/Source/WebCore/plugins/qt/PluginViewQt.cpp +=================================================================== +--- qtwebkit-opensource-src-5.8.0.orig/Source/WebCore/plugins/qt/PluginViewQt.cpp ++++ qtwebkit-opensource-src-5.8.0/Source/WebCore/plugins/qt/PluginViewQt.cpp +@@ -697,7 +697,11 @@ static Display *getPluginDisplay() + // support gdk based plugins (like flash) that use a different X connection. + // The code below has the same effect as this one: + // Display *gdkDisplay = gdk_x11_display_get_xdisplay(gdk_display_get_default()); ++#ifdef NIXPKGS_LIBGDK2 ++ QLibrary library(QLatin1String(NIXPKGS_LIBGDK2), 0); ++#else + QLibrary library(QLatin1String("libgdk-x11-2.0"), 0); ++#endif + if (!library.load()) + return 0; + +Index: qtwebkit-opensource-src-5.8.0/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp +=================================================================== +--- qtwebkit-opensource-src-5.8.0.orig/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp ++++ qtwebkit-opensource-src-5.8.0/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp +@@ -64,7 +64,11 @@ static Display* getPluginDisplay() + // The code below has the same effect as this one: + // Display *gdkDisplay = gdk_x11_display_get_xdisplay(gdk_display_get_default()); + ++#ifdef NIXPKGS_LIBGDK2 ++ QLibrary library(QLatin1String(NIXPKGS_LIBGDK2), 0); ++#else + QLibrary library(QLatin1String("libgdk-x11-2.0"), 0); ++#endif + if (!library.load()) + return 0; + +Index: qtwebkit-opensource-src-5.8.0/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp +=================================================================== +--- qtwebkit-opensource-src-5.8.0.orig/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp ++++ qtwebkit-opensource-src-5.8.0/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp +@@ -53,7 +53,11 @@ static void messageHandler(QtMsgType typ + + static bool initializeGtk() + { ++#ifdef NIXPKGS_LIBGTK2 ++ QLibrary gtkLibrary(QLatin1String(NIXPKGS_LIBGTK2), 0); ++#else + QLibrary gtkLibrary(QLatin1String("libgtk-x11-2.0"), 0); ++#endif + if (!gtkLibrary.load()) + return false; + typedef void* (*gtk_init_ptr)(void*, void*); diff --git a/pkgs/development/libraries/qt-5/5.8/qtwebkit/qtwebkit-dlopen-udev.patch b/pkgs/development/libraries/qt-5/5.8/qtwebkit/qtwebkit-dlopen-udev.patch new file mode 100644 index 00000000000..e69de29bb2d diff --git a/pkgs/development/libraries/qt-5/5.8/qtwebkit/0004-icucore-darwin.patch b/pkgs/development/libraries/qt-5/5.8/qtwebkit/qtwebkit-icucore-darwin.patch similarity index 75% rename from pkgs/development/libraries/qt-5/5.8/qtwebkit/0004-icucore-darwin.patch rename to pkgs/development/libraries/qt-5/5.8/qtwebkit/qtwebkit-icucore-darwin.patch index a1cc1892288..63c653da94e 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtwebkit/0004-icucore-darwin.patch +++ b/pkgs/development/libraries/qt-5/5.8/qtwebkit/qtwebkit-icucore-darwin.patch @@ -1,6 +1,8 @@ +Index: qtwebkit-opensource-src-5.8.0/Source/WTF/WTF.pri +=================================================================== --- qtwebkit-opensource-src-5.8.0.orig/Source/WTF/WTF.pri +++ qtwebkit-opensource-src-5.8.0/Source/WTF/WTF.pri -@@ -12,7 +12,7 @@ +@@ -12,7 +12,7 @@ mac { # Mac OS does ship libicu but not the associated header files. # Therefore WebKit provides adequate header files. INCLUDEPATH = $${ROOT_WEBKIT_DIR}/Source/WTF/icu $$INCLUDEPATH diff --git a/pkgs/development/libraries/qt-5/5.8/qtwebkit/series b/pkgs/development/libraries/qt-5/5.8/qtwebkit/series new file mode 100644 index 00000000000..140e2a3dd4e --- /dev/null +++ b/pkgs/development/libraries/qt-5/5.8/qtwebkit/series @@ -0,0 +1,3 @@ +qtwebkit-dlopen-gtk.patch +qtwebkit-dlopen-udev.patch +qtwebkit-icucore-darwin.patch