about summary refs log tree commit diff
path: root/nixpkgs/pkgs/desktops/plasma-5/plasma-desktop
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/desktops/plasma-5/plasma-desktop')
-rw-r--r--nixpkgs/pkgs/desktops/plasma-5/plasma-desktop/default.nix145
-rw-r--r--nixpkgs/pkgs/desktops/plasma-5/plasma-desktop/hwclock-path.patch24
-rw-r--r--nixpkgs/pkgs/desktops/plasma-5/plasma-desktop/kcm-access.patch13
-rw-r--r--nixpkgs/pkgs/desktops/plasma-5/plasma-desktop/no-discover-shortcut.patch13
-rw-r--r--nixpkgs/pkgs/desktops/plasma-5/plasma-desktop/tzdir.patch18
5 files changed, 213 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/desktops/plasma-5/plasma-desktop/default.nix b/nixpkgs/pkgs/desktops/plasma-5/plasma-desktop/default.nix
new file mode 100644
index 000000000000..aaf1519ceaeb
--- /dev/null
+++ b/nixpkgs/pkgs/desktops/plasma-5/plasma-desktop/default.nix
@@ -0,0 +1,145 @@
+{ mkDerivation
+, lib
+, extra-cmake-modules
+, kdoctools
+, wayland-scanner
+, boost
+, fontconfig
+, ibus
+, libXcursor
+, libXft
+, libcanberra_kde
+, libpulseaudio
+, libxkbfile
+, xf86inputevdev
+, xf86inputsynaptics
+, xinput
+, xkeyboard_config
+, xorgserver
+, util-linux
+, wayland
+, wayland-protocols
+, accounts-qt
+, qtdeclarative
+, qtquickcontrols
+, qtquickcontrols2
+, qtsvg
+, qtx11extras
+, attica
+, baloo
+, kaccounts-integration
+, kactivities
+, kactivities-stats
+, kauth
+, kcmutils
+, kdbusaddons
+, kdeclarative
+, kded
+, kdelibs4support
+, kemoticons
+, kglobalaccel
+, ki18n
+, kitemmodels
+, knewstuff
+, knotifications
+, knotifyconfig
+, kpeople
+, krunner
+, kscreenlocker
+, kwallet
+, kwin
+, phonon
+, plasma-framework
+, plasma-workspace
+, qqc2-desktop-style
+, xf86inputlibinput
+, glib
+, gsettings-desktop-schemas
+, runCommandLocal
+, makeWrapper
+}:
+let
+  # run gsettings with desktop schemas for using in "kcm_access" kcm
+  # and in kaccess
+  gsettings-wrapper = runCommandLocal "gsettings-wrapper" { nativeBuildInputs = [ makeWrapper ]; } ''
+    mkdir -p $out/bin
+    makeWrapper ${glib}/bin/gsettings $out/bin/gsettings --prefix XDG_DATA_DIRS : ${gsettings-desktop-schemas.out}/share/gsettings-schemas/${gsettings-desktop-schemas.name}
+  '';
+in
+mkDerivation {
+  pname = "plasma-desktop";
+  nativeBuildInputs = [ extra-cmake-modules kdoctools wayland-scanner ];
+  buildInputs = [
+    boost
+    fontconfig
+    ibus
+    libcanberra_kde
+    libpulseaudio
+    libXcursor
+    libXft
+    xorgserver
+    libxkbfile
+    phonon
+    xf86inputlibinput
+    xf86inputevdev
+    xf86inputsynaptics
+    xinput
+    xkeyboard_config
+    wayland
+    wayland-protocols
+
+    accounts-qt
+    qtdeclarative
+    qtquickcontrols
+    qtquickcontrols2
+    qtsvg
+    qtx11extras
+
+    attica
+    baloo
+    kaccounts-integration
+    kactivities
+    kactivities-stats
+    kauth
+    kcmutils
+    kdbusaddons
+    kdeclarative
+    kded
+    kdelibs4support
+    kemoticons
+    kglobalaccel
+    ki18n
+    kitemmodels
+    knewstuff
+    knotifications
+    knotifyconfig
+    kpeople
+    krunner
+    kscreenlocker
+    kwallet
+    kwin
+    plasma-framework
+    plasma-workspace
+    qqc2-desktop-style
+  ];
+
+  patches = [
+    ./hwclock-path.patch
+    ./tzdir.patch
+    ./kcm-access.patch
+    ./no-discover-shortcut.patch
+  ];
+  CXXFLAGS =
+    [
+      ''-DNIXPKGS_HWCLOCK=\"${lib.getBin util-linux}/bin/hwclock\"''
+      ''-DNIXPKGS_GSETTINGS=\"${gsettings-wrapper}/bin/gsettings\"''
+    ];
+  postInstall = ''
+    # Display ~/Desktop contents on the desktop by default.
+    sed -i "''${!outputBin}/share/plasma/shells/org.kde.plasma.desktop/contents/defaults" \
+        -e 's/Containment=org.kde.desktopcontainment/Containment=org.kde.plasma.folder/'
+  '';
+
+  # wrap kaccess with wrapped gsettings so it can access accessibility schemas
+  qtWrapperArgs = [ "--prefix PATH : ${lib.makeBinPath [ gsettings-wrapper ]}" ];
+}
diff --git a/nixpkgs/pkgs/desktops/plasma-5/plasma-desktop/hwclock-path.patch b/nixpkgs/pkgs/desktops/plasma-5/plasma-desktop/hwclock-path.patch
new file mode 100644
index 000000000000..c85d66ad0031
--- /dev/null
+++ b/nixpkgs/pkgs/desktops/plasma-5/plasma-desktop/hwclock-path.patch
@@ -0,0 +1,24 @@
+Index: plasma-desktop-5.8.5/kcms/dateandtime/helper.cpp
+===================================================================
+--- plasma-desktop-5.8.5.orig/kcms/dateandtime/helper.cpp
++++ plasma-desktop-5.8.5/kcms/dateandtime/helper.cpp
+@@ -48,10 +48,6 @@
+ #include <sys/types.h>
+ #endif
+
+-// We cannot rely on the $PATH environment variable, because D-Bus activation
+-// clears it. So we have to use a reasonable default.
+-static const QString exePath = QStringLiteral("/usr/sbin:/usr/bin:/sbin:/bin");
+-
+ int ClockHelper::ntp(const QStringList &ntpServers, bool ntpEnabled)
+ {
+     int ret = 0;
+@@ -227,7 +223,7 @@ int ClockHelper::tzreset()
+ 
+ void ClockHelper::toHwclock()
+ {
+-    QString hwclock = QStandardPaths::findExecutable(QStringLiteral("hwclock"), exePath.split(QLatin1Char(':')));
++    QString hwclock = QLatin1String(NIXPKGS_HWCLOCK);
+     if (!hwclock.isEmpty()) {
+         KProcess::execute(hwclock, QStringList() << QStringLiteral("--systohc"));
+     }
diff --git a/nixpkgs/pkgs/desktops/plasma-5/plasma-desktop/kcm-access.patch b/nixpkgs/pkgs/desktops/plasma-5/plasma-desktop/kcm-access.patch
new file mode 100644
index 000000000000..89f6dd8b84f7
--- /dev/null
+++ b/nixpkgs/pkgs/desktops/plasma-5/plasma-desktop/kcm-access.patch
@@ -0,0 +1,13 @@
+diff --git a/kcms/access/kcmaccess.cpp b/kcms/access/kcmaccess.cpp
+index 4f8d3e2..a96f755 100644
+--- a/kcms/access/kcmaccess.cpp
++++ b/kcms/access/kcmaccess.cpp
+@@ -176,7 +176,7 @@ void KAccessConfig::launchOrcaConfiguration()
+                                       QStringLiteral("screen-reader-enabled"),
+                                       QStringLiteral("true")};
+ 
+-    int ret = QProcess::execute(QStringLiteral("gsettings"), gsettingArgs);
++    int ret = QProcess::execute(QStringLiteral(NIXPKGS_GSETTINGS), gsettingArgs);
+     if (ret) {
+         const QString errorStr = QLatin1String("gsettings ") + gsettingArgs.join(QLatin1Char(' '));
+         setOrcaLaunchFeedback(i18n("Could not set gsettings for Orca: \"%1\" failed", errorStr));
diff --git a/nixpkgs/pkgs/desktops/plasma-5/plasma-desktop/no-discover-shortcut.patch b/nixpkgs/pkgs/desktops/plasma-5/plasma-desktop/no-discover-shortcut.patch
new file mode 100644
index 000000000000..f186671c9cc5
--- /dev/null
+++ b/nixpkgs/pkgs/desktops/plasma-5/plasma-desktop/no-discover-shortcut.patch
@@ -0,0 +1,13 @@
+diff --git a/applets/taskmanager/package/contents/config/main.xml b/applets/taskmanager/package/contents/config/main.xml
+index 6bb27695d..25e621810 100644
+--- a/applets/taskmanager/package/contents/config/main.xml
++++ b/applets/taskmanager/package/contents/config/main.xml
+@@ -85,7 +85,7 @@
+     </entry>
+     <entry name="launchers" type="StringList">
+       <label>The list of launcher tasks on the widget. Usually .desktop file or executable URLs. Special URLs such as preferred://browser that expand to default applications are supported.</label>
+-      <default>applications:systemsettings.desktop,applications:org.kde.discover.desktop,preferred://filemanager,preferred://browser</default>
++      <default>applications:systemsettings.desktop,preferred://filemanager,preferred://browser</default>
+     </entry>
+     <entry name="middleClickAction" type="Enum">
+       <label>What to do on middle-mouse click on a task button.</label>
diff --git a/nixpkgs/pkgs/desktops/plasma-5/plasma-desktop/tzdir.patch b/nixpkgs/pkgs/desktops/plasma-5/plasma-desktop/tzdir.patch
new file mode 100644
index 000000000000..97504b330fed
--- /dev/null
+++ b/nixpkgs/pkgs/desktops/plasma-5/plasma-desktop/tzdir.patch
@@ -0,0 +1,18 @@
+Index: plasma-desktop-5.8.5/kcms/dateandtime/helper.cpp
+===================================================================
+--- plasma-desktop-5.8.5.orig/kcms/dateandtime/helper.cpp
++++ plasma-desktop-5.8.5/kcms/dateandtime/helper.cpp
+@@ -181,7 +181,12 @@ int ClockHelper::tz( const QString& sele
+ 
+     val = selectedzone;
+ #else
+-    QString tz = "/usr/share/zoneinfo/" + selectedzone;
++    QString tzdir = QString::fromLocal8Bit(qgetenv("TZDIR"));
++    QString tz = tzdir + "/" + selectedzone;
++    if (tzdir.isEmpty()) {
++      // Standard Linux path
++      tz = "/usr/share/zoneinfo/" + selectedzone;
++    }
+ 
+     if (QFile::exists(tz)) { // make sure the new TZ really exists
+         QFile::remove(QStringLiteral("/etc/localtime"));