1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-22 21:50:55 +00:00

qt56: purge all refrences to gtk, solves all of the theme problems

This commit is contained in:
michael bishop 2016-07-29 18:50:06 -03:00
parent 06536879e7
commit dd3e27f2e7
3 changed files with 2 additions and 77 deletions

View file

@ -66,8 +66,6 @@ let
mesa = pkgs.mesa_noglu;
harfbuzz = pkgs.harfbuzz-icu;
cups = if stdenv.isLinux then pkgs.cups else null;
# GNOME dependencies are not used unless gtkStyle == true
inherit (pkgs.gnome) libgnomeui GConf gnome_vfs;
bison = pkgs.bison2; # error: too few arguments to function 'int yylex(...
inherit developerBuild decryptSslTraffic;
};

View file

@ -19,15 +19,11 @@
, buildExamples ? false
, buildTests ? false
, developerBuild ? false
, libgnomeui, GConf, gnome_vfs, gtk
, decryptSslTraffic ? false
}:
let
system-x86_64 = lib.elem stdenv.system lib.platforms.x86_64;
# Search path for Gtk plugin
gtkLibPath = lib.makeLibraryPath [ gtk gnome_vfs libgnomeui GConf ];
in
stdenv.mkDerivation {
@ -35,7 +31,7 @@ stdenv.mkDerivation {
name = "qtbase-${srcs.qtbase.version}";
inherit (srcs.qtbase) src version;
outputs = [ "dev" "out" "gtk" ];
outputs = [ "dev" "out" ];
patches =
copyPathsToStore (lib.readPathsFromFile ./. ./series)
@ -127,7 +123,6 @@ stdenv.mkDerivation {
-xcb
-qpa xcb
-${lib.optionalString (cups == null) "no-"}cups
-gtkstyle
-no-eglfs
-no-directfb
@ -189,9 +184,7 @@ stdenv.mkDerivation {
++ lib.optional developerBuild gdb
++ lib.optional (cups != null) cups
++ lib.optional (mysql != null) mysql.lib
++ lib.optional (postgresql != null) postgresql
# FIXME: move to the main list on rebuild.
++ [gnome_vfs.out libgnomeui.out gtk GConf];
++ lib.optional (postgresql != null) postgresql;
nativeBuildInputs = [ lndir patchelf perl pkgconfig python ];
@ -216,22 +209,6 @@ stdenv.mkDerivation {
# The destination directory must exist or moveToOutput will do nothing
mkdir -p "$dev/share"
moveToOutput "share/doc" "$dev"
# Move the QGtkStyle plugin to the gtk output
mkdir -p "$gtk/lib/qt5/plugins/platformthemes"
mv "$out/lib/qt5/plugins/platformthemes/libqgtk2.so" "$gtk/lib/qt5/plugins/platformthemes"
rm "$out/lib/cmake/Qt5Gui/Qt5Gui_QGtk2ThemePlugin.cmake"
# Set RPATH for QGtkStyle plugin
qgtk2="$gtk/lib/qt5/plugins/platformthemes/libqgtk2.so"
qgtk2_RPATH="$(patchelf --print-rpath "$qgtk2")"
qgtk2_RPATH="$qgtk2_RPATH''${qgtk2_RPATH:+:}${gtkLibPath}"
patchelf "$qgtk2" \
--add-needed libgtk-x11-2.0.so \
--add-needed libgnomeui-2.so \
--add-needed libgnomevfs-2.so \
--add-needed libgconf-2.so \
--set-rpath "$qgtk2_RPATH"
'';
postFixup =

View file

@ -1,50 +0,0 @@
Index: qtbase-opensource-src-5.5.1/src/widgets/styles/qgtk2painter.cpp
===================================================================
--- qtbase-opensource-src-5.5.1.orig/src/widgets/styles/qgtk2painter.cpp
+++ qtbase-opensource-src-5.5.1/src/widgets/styles/qgtk2painter.cpp
@@ -96,7 +96,7 @@ static void initGtk()
static bool initialized = false;
if (!initialized) {
// enforce the "0" suffix, so we'll open libgtk-x11-2.0.so.0
- QLibrary libgtk(QLS("gtk-x11-2.0"), 0, 0);
+ QLibrary libgtk(QLS("@gtk@/lib/libgtk-x11-2.0"), 0, 0);
QGtk2PainterPrivate::gdk_pixmap_new = (Ptr_gdk_pixmap_new)libgtk.resolve("gdk_pixmap_new");
QGtk2PainterPrivate::gdk_pixbuf_get_from_drawable = (Ptr_gdk_pixbuf_get_from_drawable)libgtk.resolve("gdk_pixbuf_get_from_drawable");
Index: qtbase-opensource-src-5.5.1/src/widgets/styles/qgtkstyle_p.cpp
===================================================================
--- qtbase-opensource-src-5.5.1.orig/src/widgets/styles/qgtkstyle_p.cpp
+++ qtbase-opensource-src-5.5.1/src/widgets/styles/qgtkstyle_p.cpp
@@ -327,7 +327,7 @@ void QGtkStylePrivate::gtkWidgetSetFocus
void QGtkStylePrivate::resolveGtk() const
{
// enforce the "0" suffix, so we'll open libgtk-x11-2.0.so.0
- QLibrary libgtk(QLS("gtk-x11-2.0"), 0, 0);
+ QLibrary libgtk(QLS("@gtk@/lib/libgtk-x11-2.0"), 0, 0);
gtk_init = (Ptr_gtk_init)libgtk.resolve("gtk_init");
gtk_window_new = (Ptr_gtk_window_new)libgtk.resolve("gtk_window_new");
@@ -425,8 +425,8 @@ void QGtkStylePrivate::resolveGtk() cons
pango_font_description_get_family = (Ptr_pango_font_description_get_family)libgtk.resolve("pango_font_description_get_family");
pango_font_description_get_style = (Ptr_pango_font_description_get_style)libgtk.resolve("pango_font_description_get_style");
- gnome_icon_lookup_sync = (Ptr_gnome_icon_lookup_sync)QLibrary::resolve(QLS("gnomeui-2"), 0, "gnome_icon_lookup_sync");
- gnome_vfs_init= (Ptr_gnome_vfs_init)QLibrary::resolve(QLS("gnomevfs-2"), 0, "gnome_vfs_init");
+ gnome_icon_lookup_sync = (Ptr_gnome_icon_lookup_sync)QLibrary::resolve(QLS("@libgnomeui@/lib/libgnomeui-2"), 0, "gnome_icon_lookup_sync");
+ gnome_vfs_init= (Ptr_gnome_vfs_init)QLibrary::resolve(QLS("@gnome_vfs@/lib/libgnomevfs-2"), 0, "gnome_vfs_init");
}
/* \internal
@@ -594,9 +594,9 @@ void QGtkStylePrivate::cleanupGtkWidgets
static bool resolveGConf()
{
if (!QGtkStylePrivate::gconf_client_get_default) {
- QGtkStylePrivate::gconf_client_get_default = (Ptr_gconf_client_get_default)QLibrary::resolve(QLS("gconf-2"), 4, "gconf_client_get_default");
- QGtkStylePrivate::gconf_client_get_string = (Ptr_gconf_client_get_string)QLibrary::resolve(QLS("gconf-2"), 4, "gconf_client_get_string");
- QGtkStylePrivate::gconf_client_get_bool = (Ptr_gconf_client_get_bool)QLibrary::resolve(QLS("gconf-2"), 4, "gconf_client_get_bool");
+ QGtkStylePrivate::gconf_client_get_default = (Ptr_gconf_client_get_default)QLibrary::resolve(QLS("@gconf@/lib/libgconf-2"), 4, "gconf_client_get_default");
+ QGtkStylePrivate::gconf_client_get_string = (Ptr_gconf_client_get_string)QLibrary::resolve(QLS("@gconf@/lib/libgconf-2"), 4, "gconf_client_get_string");
+ QGtkStylePrivate::gconf_client_get_bool = (Ptr_gconf_client_get_bool)QLibrary::resolve(QLS("@gconf@/lib/libgconf-2"), 4, "gconf_client_get_bool");
}
return (QGtkStylePrivate::gconf_client_get_default !=0);
}