summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/desktops/plasma-5/kde-gtk-config/default.nix10
-rw-r--r--pkgs/desktops/plasma-5/kde-gtk-config/patches/follow-symlinks.patch (renamed from pkgs/desktops/plasma-5/kde-gtk-config/0001-follow-symlinks.patch)35
-rw-r--r--pkgs/desktops/plasma-5/kde-gtk-config/patches/gsettings.patch21
-rw-r--r--pkgs/desktops/plasma-5/kde-gtk-config/patches/series2
4 files changed, 46 insertions, 22 deletions
diff --git a/pkgs/desktops/plasma-5/kde-gtk-config/default.nix b/pkgs/desktops/plasma-5/kde-gtk-config/default.nix
index 35d90a246bc6..8cfc947d30bd 100644
--- a/pkgs/desktops/plasma-5/kde-gtk-config/default.nix
+++ b/pkgs/desktops/plasma-5/kde-gtk-config/default.nix
@@ -1,21 +1,25 @@
 {
   mkDerivation,
-  extra-cmake-modules,
+  extra-cmake-modules, wrapGAppsHook,
   glib, gtk2, gtk3, karchive, kcmutils, kconfigwidgets, ki18n, kiconthemes, kio,
   knewstuff, gsettings-desktop-schemas
 }:
 
 mkDerivation {
   name = "kde-gtk-config";
-  nativeBuildInputs = [ extra-cmake-modules ];
+  nativeBuildInputs = [ extra-cmake-modules wrapGAppsHook ];
+  dontWrapGApps = true;  # There is nothing to wrap
   buildInputs = [
     ki18n kio glib gtk2 gtk3 karchive kcmutils kconfigwidgets kiconthemes
     knewstuff gsettings-desktop-schemas
   ];
-  patches = [ ./0001-follow-symlinks.patch ];
+  patches = [ ./patches/follow-symlinks.patch ./patches/gsettings.patch ];
   cmakeFlags = [
     "-DGTK2_GLIBCONFIG_INCLUDE_DIR=${glib.out}/lib/glib-2.0/include"
     "-DGTK2_GDKCONFIG_INCLUDE_DIR=${gtk2.out}/lib/gtk-2.0/include"
     "-DGLIB_SCHEMAS_DIR=${gsettings-desktop-schemas.out}/"
   ];
+  preConfigure = ''
+    NIX_CFLAGS_COMPILE+=" -DGSETTINGS_SCHEMAS_PATH=\"$GSETTINGS_SCHEMAS_PATH\""
+  '';
 }
diff --git a/pkgs/desktops/plasma-5/kde-gtk-config/0001-follow-symlinks.patch b/pkgs/desktops/plasma-5/kde-gtk-config/patches/follow-symlinks.patch
index d610d19eedd2..f30a0a4588fa 100644
--- a/pkgs/desktops/plasma-5/kde-gtk-config/0001-follow-symlinks.patch
+++ b/pkgs/desktops/plasma-5/kde-gtk-config/patches/follow-symlinks.patch
@@ -8,11 +8,11 @@ Subject: [PATCH] follow symlinks
  src/iconthemesmodel.cpp | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)
 
-diff --git a/src/appearancegtk2.cpp b/src/appearancegtk2.cpp
-index b1e0b52..095cddc 100644
---- a/src/appearancegtk2.cpp
-+++ b/src/appearancegtk2.cpp
-@@ -73,7 +73,7 @@ QString AppearanceGTK2::themesGtkrcFile(const QString& themeName) const
+Index: kde-gtk-config-5.12.4/src/appearancegtk2.cpp
+===================================================================
+--- kde-gtk-config-5.12.4.orig/src/appearancegtk2.cpp
++++ kde-gtk-config-5.12.4/src/appearancegtk2.cpp
+@@ -69,7 +69,7 @@ QString AppearanceGTK2::themesGtkrcFile(
      QStringList themes=installedThemes();
      themes=themes.filter(QRegExp("/"+themeName+"/?$"));
      if(themes.size()==1) {
@@ -21,12 +21,12 @@ index b1e0b52..095cddc 100644
          while(it.hasNext()) {
              it.next();
              if(it.fileName()=="gtkrc") {
-diff --git a/src/iconthemesmodel.cpp b/src/iconthemesmodel.cpp
-index 07c7ad7..b04d978 100644
---- a/src/iconthemesmodel.cpp
-+++ b/src/iconthemesmodel.cpp
-@@ -46,7 +46,7 @@ QList<QDir> IconThemesModel::installedThemesPaths()
-     
+Index: kde-gtk-config-5.12.4/src/iconthemesmodel.cpp
+===================================================================
+--- kde-gtk-config-5.12.4.orig/src/iconthemesmodel.cpp
++++ kde-gtk-config-5.12.4/src/iconthemesmodel.cpp
+@@ -47,7 +47,7 @@ QList<QDir> IconThemesModel::installedTh
+ 
      foreach(const QString& dir, dirs) {
          QDir userIconsDir(dir);
 -        QDirIterator it(userIconsDir.path(), QDir::NoDotAndDotDot|QDir::AllDirs|QDir::NoSymLinks);
@@ -34,14 +34,11 @@ index 07c7ad7..b04d978 100644
          while(it.hasNext()) {
              QString currentPath = it.next();
              QDir dir(currentPath);
--- 
-2.6.2
-
-diff --git a/src/cursorthemesmodel.cpp b/src/cursorthemesmodel.cpp
-index 926a666..85b10f8 100644
---- a/src/cursorthemesmodel.cpp
-+++ b/src/cursorthemesmodel.cpp
-@@ -47,7 +47,7 @@ QList<QDir> CursorThemesModel::installedThemesPaths()
+Index: kde-gtk-config-5.12.4/src/cursorthemesmodel.cpp
+===================================================================
+--- kde-gtk-config-5.12.4.orig/src/cursorthemesmodel.cpp
++++ kde-gtk-config-5.12.4/src/cursorthemesmodel.cpp
+@@ -47,7 +47,7 @@ QList<QDir> CursorThemesModel::installed
  
      foreach(const QString& dir, dirs) {
          QDir userIconsDir(dir);
diff --git a/pkgs/desktops/plasma-5/kde-gtk-config/patches/gsettings.patch b/pkgs/desktops/plasma-5/kde-gtk-config/patches/gsettings.patch
new file mode 100644
index 000000000000..b4bc89d59e9e
--- /dev/null
+++ b/pkgs/desktops/plasma-5/kde-gtk-config/patches/gsettings.patch
@@ -0,0 +1,21 @@
+Index: kde-gtk-config-5.12.4/src/gtkconfigkcmodule.cpp
+===================================================================
+--- kde-gtk-config-5.12.4.orig/src/gtkconfigkcmodule.cpp
++++ kde-gtk-config-5.12.4/src/gtkconfigkcmodule.cpp
+@@ -78,6 +78,16 @@ GTKConfigKCModule::GTKConfigKCModule(QWi
+     m_iconsModel = new IconThemesModel(false, this);
+     ui->cb_icon->setModel(m_iconsModel);
+     ui->cb_icon_fallback->setModel(m_iconsModel);
++
++    // Add GSETTINGS_SCHEMAS_PATH to the front of XDG_DATA_DIRS.
++    // Normally this would be done by wrapGAppsHook, but this plugin
++    // (shared object) cannot be wrapped.
++    QByteArray xdgdata = qgetenv("XDG_DATA_DIRS");
++    if (!xdgdata.isEmpty()) {
++        xdgdata.push_front(":");
++    }
++    xdgdata.push_front(QByteArray(GSETTINGS_SCHEMAS_PATH));
++    qputenv("XDG_DATA_DIRS", xdgdata);
+     
+     m_tempGtk2Preview = QStandardPaths::writableLocation(QStandardPaths::TempLocation)+ "/gtkrc-2.0";
+     m_tempGtk3Preview = QStandardPaths::writableLocation(QStandardPaths::TempLocation)+ "/.config/gtk-3.0/settings.ini";
diff --git a/pkgs/desktops/plasma-5/kde-gtk-config/patches/series b/pkgs/desktops/plasma-5/kde-gtk-config/patches/series
new file mode 100644
index 000000000000..7aad1acf6ac4
--- /dev/null
+++ b/pkgs/desktops/plasma-5/kde-gtk-config/patches/series
@@ -0,0 +1,2 @@
+follow-symlinks.patch
+gsettings.patch