1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-09-11 15:08:33 +01:00

qt56.qtwebkit: use QLatin1String instead of QStringLiteral

This commit is contained in:
Thomas Tuegel 2017-05-23 11:13:27 -05:00
parent c546c26e3a
commit 8cc09c9e3e
No known key found for this signature in database
GPG key ID: 22CBF5249D4B4D59
6 changed files with 104 additions and 23 deletions

View file

@ -11,18 +11,18 @@ diff --git a/Source/WebCore/platform/qt/GamepadsQt.cpp b/Source/WebCore/platform
index 60ff317..da8ac69 100644
--- a/Source/WebCore/platform/qt/GamepadsQt.cpp
+++ b/Source/WebCore/platform/qt/GamepadsQt.cpp
@@ -111,12 +111,12 @@ private:
@@ -111,13 +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_libUdev.setFileNameAndVersion(QLatin1String(NIXPKGS_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_libUdev.setFileNameAndVersion(QLatin1String(NIXPKGS_LIBUDEV), 0);
m_loaded = m_libUdev.load();
return resolveMethods();
}

View file

@ -1,39 +1,40 @@
{ 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
, darwin
, substituteAll
, flashplayerFix ? false
}:
with stdenv.lib;
let inherit (lib) optional optionals getLib; in
qtSubmodule {
name = "qtwebkit";
qtInputs = [ qtdeclarative qtlocation qtsensors ];
buildInputs = [ fontconfig libwebp libxml2 libxslt sqlite glib gst_all_1.gstreamer gst_all_1.gst-plugins-base ];
buildInputs = [ fontconfig libwebp libxml2 libxslt sqlite glib gst_all_1.gstreamer gst_all_1.gst-plugins-base ]
++ optionals (stdenv.isDarwin) (with darwin.apple_sdk.frameworks; [ OpenGL ]);
nativeBuildInputs = [
bison2 flex gdb gperf perl pkgconfig python2 ruby
];
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 ]
++ [ dlopen-webkit-udev ];
__impureHostDeps = optionals (stdenv.isDarwin) [
"/usr/lib/libicucore.dylib"
];
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)" '';
meta.maintainers = with stdenv.lib.maintainers; [ abbradar ];
meta.maintainers = with stdenv.lib.maintainers; [ abbradar periklis ];
}

View file

@ -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*);

View file

@ -0,0 +1,13 @@
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 @@ 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
- LIBS += -licucore
+ LIBS += /usr/lib/libicucore.dylib
} else:!use?(wchar_unicode): {
win32 {
CONFIG(static, static|shared) {

View file

@ -0,0 +1,3 @@
qtwebkit-dlopen-gtk.patch
qtwebkit-dlopen-udev.patch
qtwebkit-icucore-darwin.patch