From d19dc420d250fd115693724af543a3082175b5c0 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Fri, 15 Jul 2016 07:37:38 -0500 Subject: [PATCH 01/12] qt56.qtbase: don't use propagatedUserEnvPkgs Fixes #15498. --- pkgs/development/libraries/qt-5/5.6/qtbase/setup-hook.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pkgs/development/libraries/qt-5/5.6/qtbase/setup-hook.sh b/pkgs/development/libraries/qt-5/5.6/qtbase/setup-hook.sh index 8d1a453787f..6d8989281eb 100644 --- a/pkgs/development/libraries/qt-5/5.6/qtbase/setup-hook.sh +++ b/pkgs/development/libraries/qt-5/5.6/qtbase/setup-hook.sh @@ -28,7 +28,6 @@ _qtPropagate() { for dir in "lib/qt5/plugins" "lib/qt5/qml" "lib/qt5/imports"; do if [ -d "$1/$dir" ]; then propagateOnce propagatedBuildInputs "$1" - propagateOnce propagatedUserEnvPkgs "$1" break fi done @@ -43,9 +42,6 @@ _qtPropagateNative() { for dir in "lib/qt5/plugins" "lib/qt5/qml" "lib/qt5/imports"; do if [ -d "$1/$dir" ]; then propagateOnce propagatedNativeBuildInputs "$1" - if [ -z "$crossConfig" ]; then - propagateOnce propagatedUserEnvPkgs "$1" - fi break fi done From 766ea7c4ca6dc54bd26a28f67a99257bde2ff331 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Fri, 15 Jul 2016 07:57:18 -0500 Subject: [PATCH 02/12] qt55.qtbase: update setup hook --- .../libraries/qt-5/5.5/qtbase/setup-hook.sh | 125 +++++++++++++++++- 1 file changed, 122 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/qt-5/5.5/qtbase/setup-hook.sh b/pkgs/development/libraries/qt-5/5.5/qtbase/setup-hook.sh index a9c4fbc855f..6d8989281eb 100644 --- a/pkgs/development/libraries/qt-5/5.5/qtbase/setup-hook.sh +++ b/pkgs/development/libraries/qt-5/5.5/qtbase/setup-hook.sh @@ -24,11 +24,10 @@ propagateOnce() { addToSearchPathOnceWithCustomDelimiter ' ' "$@" } -_qtPropagateRuntimeDependencies() { +_qtPropagate() { for dir in "lib/qt5/plugins" "lib/qt5/qml" "lib/qt5/imports"; do if [ -d "$1/$dir" ]; then propagateOnce propagatedBuildInputs "$1" - propagateOnce propagatedUserEnvPkgs "$1" break fi done @@ -37,7 +36,23 @@ _qtPropagateRuntimeDependencies() { addToSearchPathOnce QML2_IMPORT_PATH "$1/lib/qt5/qml" } -envHooks+=(_qtPropagateRuntimeDependencies) +crossEnvHooks+=(_qtPropagate) + +_qtPropagateNative() { + for dir in "lib/qt5/plugins" "lib/qt5/qml" "lib/qt5/imports"; do + if [ -d "$1/$dir" ]; then + propagateOnce propagatedNativeBuildInputs "$1" + break + fi + done + if [ -z "$crossConfig" ]; then + addToSearchPathOnce QT_PLUGIN_PATH "$1/lib/qt5/plugins" + addToSearchPathOnce QML_IMPORT_PATH "$1/lib/qt5/imports" + addToSearchPathOnce QML2_IMPORT_PATH "$1/lib/qt5/qml" + fi +} + +envHooks+=(_qtPropagateNative) _qtMultioutDevs() { # This is necessary whether the package is a Qt module or not @@ -50,3 +65,107 @@ if [[ -z "$NIX_QT_PIC" ]]; then export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE${NIX_CFLAGS_COMPILE:+ }-fPIC" export NIX_QT_PIC=1 fi + +_qtSetCMakePrefix() { + export CMAKE_PREFIX_PATH="$NIX_QT5_TMP${CMAKE_PREFIX_PATH:+:}${CMAKE_PREFIX_PATH}" +} + +_qtRmTmp() { + if [ -z "$NIX_QT_SUBMODULE" ]; then + rm -fr "$NIX_QT5_TMP" + else + cat "$NIX_QT5_TMP/nix-support/qt-inputs" | while read file; do + if [ ! -d "$NIX_QT5_TMP/$file" ]; then + rm -f "$NIX_QT5_TMP/$file" + fi + done + + cat "$NIX_QT5_TMP/nix-support/qt-inputs" | while read dir; do + if [ -d "$NIX_QT5_TMP/$dir" ]; then + rmdir --ignore-fail-on-non-empty -p "$NIX_QT5_TMP/$dir" + fi + done + + rm "$NIX_QT5_TMP/nix-support/qt-inputs" + fi +} + +_qtSetQmakePath() { + export PATH="$NIX_QT5_TMP/bin${PATH:+:}$PATH" +} + +if [ -z "$NIX_QT5_TMP" ]; then + if [ -z "$NIX_QT_SUBMODULE" ]; then + NIX_QT5_TMP=$(mktemp -d) + else + NIX_QT5_TMP=$out + fi + postInstallHooks+=(_qtRmTmp) + + mkdir -p "$NIX_QT5_TMP/nix-support" + for subdir in bin include lib mkspecs share; do + mkdir "$NIX_QT5_TMP/$subdir" + echo "$subdir/" >> "$NIX_QT5_TMP/nix-support/qt-inputs" + done + + postHooks+=(_qtSetCMakePrefix) + + cp "@dev@/bin/qmake" "$NIX_QT5_TMP/bin" + echo "bin/qmake" >> "$NIX_QT5_TMP/nix-support/qt-inputs" + + cat >"$NIX_QT5_TMP/bin/qt.conf" <> "$NIX_QT5_TMP/nix-support/qt-inputs" + + export QMAKE="$NIX_QT5_TMP/bin/qmake" + + # Set PATH to find qmake first in a preConfigure hook + # It must run after all the envHooks! + preConfigureHooks+=(_qtSetQmakePath) +fi + +qt5LinkModuleDir() { + if [ -d "$1/$2" ]; then + @lndir@/bin/lndir -silent "$1/$2" "$NIX_QT5_TMP/$2" + find "$1/$2" -printf "$2/%P\n" >> "$NIX_QT5_TMP/nix-support/qt-inputs" + fi +} + +NIX_QT5_MODULES="${NIX_QT5_MODULES}${NIX_QT5_MODULES:+:}@out@" +NIX_QT5_MODULES_DEV="${NIX_QT5_MODULES_DEV}${NIX_QT5_MODULES_DEV:+:}@dev@" + +_qtLinkAllModules() { + IFS=: read -a modules <<< $NIX_QT5_MODULES + for module in ${modules[@]}; do + qt5LinkModuleDir "$module" "lib" + done + + IFS=: read -a modules <<< $NIX_QT5_MODULES_DEV + for module in ${modules[@]}; do + qt5LinkModuleDir "$module" "bin" + qt5LinkModuleDir "$module" "include" + qt5LinkModuleDir "$module" "lib" + qt5LinkModuleDir "$module" "mkspecs" + qt5LinkModuleDir "$module" "share" + done +} + +preConfigureHooks+=(_qtLinkAllModules) + +_qtFixCMakePaths() { + find "${!outputLib}" -name "*.cmake" | while read file; do + substituteInPlace "$file" \ + --subst-var-by NIX_OUT "${!outputLib}" \ + --subst-var-by NIX_DEV "${!outputDev}" + done +} + +if [ -n "$NIX_QT_SUBMODULE" ]; then + postInstallHooks+=(_qtFixCMakePaths) +fi From 1cb4aacf180cf2e087f59f8810caf405f101839e Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Fri, 15 Jul 2016 09:37:11 -0500 Subject: [PATCH 03/12] nixos/kde5: fix paths to setuid programs --- nixos/modules/services/x11/desktop-managers/kde5.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/x11/desktop-managers/kde5.nix b/nixos/modules/services/x11/desktop-managers/kde5.nix index 060dda1a70a..312e4d72585 100644 --- a/nixos/modules/services/x11/desktop-managers/kde5.nix +++ b/nixos/modules/services/x11/desktop-managers/kde5.nix @@ -50,13 +50,13 @@ in security.setuidOwners = [ { program = "kcheckpass"; - source = "${kde5.plasma-workspace}/lib/libexec/kcheckpass"; + source = "${kde5.plasma-workspace.out}/lib/libexec/kcheckpass"; owner = "root"; setuid = true; } { program = "start_kdeinit_wrapper"; - source = "${kde5.plasma-workspace}/lib/libexec/kf5/start_kdeinit_wrapper"; + source = "${kde5.kinit.out}/lib/libexec/kf5/start_kdeinit_wrapper"; owner = "root"; setuid = true; } From 949277ed0a2d772476f83a108783c2ff1af68342 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Fri, 15 Jul 2016 09:43:35 -0500 Subject: [PATCH 04/12] kde5.startkde: append extra PATH elements; set Qt search paths --- .../kde-5/plasma/startkde/default.nix | 48 ++++++++++++++----- .../kde-5/plasma/startkde/startkde.sh | 6 ++- 2 files changed, 40 insertions(+), 14 deletions(-) diff --git a/pkgs/desktops/kde-5/plasma/startkde/default.nix b/pkgs/desktops/kde-5/plasma/startkde/default.nix index 30e986c21b4..516d651cec2 100644 --- a/pkgs/desktops/kde-5/plasma/startkde/default.nix +++ b/pkgs/desktops/kde-5/plasma/startkde/default.nix @@ -1,16 +1,15 @@ -{ stdenv, lib, runCommand -, dbus, qttools, socat -, gnugrep, gnused -, kconfig, kinit, kservice -, plasma-workspace -, xmessage, xprop, xsetroot +{ + stdenv, lib, runCommand, dbus, qttools, socat, gnugrep, gnused, kconfig, + kinit, kservice, plasma-workspace, xmessage, xprop, xsetroot, qtbase, + qtdeclarative, qtgraphicaleffects, qtquickcontrols, qtscript, qtsvg, + qtx11extras, qtxmlpatterns }: let env = { inherit (stdenv) shell; - paths = builtins.map (pkg: pkg.out or pkg) + bins = builtins.map (pkg: pkg.out or pkg) [ dbus qttools socat gnugrep gnused @@ -18,15 +17,38 @@ let plasma-workspace xmessage xprop xsetroot ]; + libs = builtins.map (pkg: pkg.out or pkg) + [ + qtbase qtdeclarative qtgraphicaleffects qtquickcontrols + qtscript qtsvg qtx11extras qtxmlpatterns + ]; }; in runCommand "startkde" env '' - prefix_PATH= - for pkg in $paths; do - addToSearchPath prefix_PATH "$pkg/bin" - addToSearchPath prefix_PATH "$pkg/lib/libexec" - addToSearchPath prefix_PATH "$pkg/lib/libexec/kf5" + + # Configure PATH variable + suffixPATH= + for p in $bins; do + addToSearchPath suffixPATH "$p/bin" + addToSearchPath suffixPATH "$p/lib/libexec" + addToSearchPath suffixPATH "$p/lib/libexec/kf5" done - substitute ${./startkde.sh} "$out" --subst-var shell --subst-var prefix_PATH + + # Configure Qt search paths + QT_PLUGIN_PATH= + QML_IMPORT_PATH= + QML2_IMPORT_PATH= + for p in $libs; do + addToSearchPath QT_PLUGIN_PATH "$p/lib/qt5/plugins" + addToSearchPath QML_IMPORT_PATH "$p/lib/qt5/imports" + addToSearchPath QML2_IMPORT_PATH "$p/lib/qt5/qml" + done + + substitute ${./startkde.sh} "$out" \ + --subst-var shell \ + --subst-var suffixPATH \ + --subst-var QT_PLUGIN_PATH \ + --subst-var QML_IMPORT_PATH \ + --subst-var QML2_IMPORT_PATH chmod +x "$out" '' diff --git a/pkgs/desktops/kde-5/plasma/startkde/startkde.sh b/pkgs/desktops/kde-5/plasma/startkde/startkde.sh index d839226a456..a626fdc2b5a 100755 --- a/pkgs/desktops/kde-5/plasma/startkde/startkde.sh +++ b/pkgs/desktops/kde-5/plasma/startkde/startkde.sh @@ -1,6 +1,10 @@ #!@shell@ -PATH="@prefix_PATH@:$PATH" +PATH="$PATH${PATH:+:}@suffixPATH@" + +export QT_PLUGIN_PATH="$QT_PLUGIN_PATH${QT_PLUGIN_PATH:+:}@QT_PLUGIN_PATH@" +export QML_IMPORT_PATH="$QML_IMPORT_PATH${QML_IMPORT_PATH:+:}@QML_IMPORT_PATH@" +export QML2_IMPORT_PATH="$QML2_IMPORT_PATH${QML2_IMPORT_PATH:+:}@QML2_IMPORT_PATH@" # The KDE icon cache is supposed to update itself # automatically, but it uses the timestamp on the icon From 888c66f97d592ebb2579527da722843a5e99a5b8 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Fri, 15 Jul 2016 09:52:40 -0500 Subject: [PATCH 05/12] nixos/kde5: disable setuid wrapper for kdeinit We need to pass certain environment variables through the wrapper, but I don't know how to do that yet. The setuid-root feature serves only to hide kdeinit from the OOM killer, so this is not critical. --- nixos/modules/services/x11/desktop-managers/kde5.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nixos/modules/services/x11/desktop-managers/kde5.nix b/nixos/modules/services/x11/desktop-managers/kde5.nix index 312e4d72585..f94e1b6559a 100644 --- a/nixos/modules/services/x11/desktop-managers/kde5.nix +++ b/nixos/modules/services/x11/desktop-managers/kde5.nix @@ -54,12 +54,16 @@ in owner = "root"; setuid = true; } + # ttuegel: Disabled until I can figure out how to propagate the + # necessary environment variables. + /* { program = "start_kdeinit_wrapper"; source = "${kde5.kinit.out}/lib/libexec/kf5/start_kdeinit_wrapper"; owner = "root"; setuid = true; } + */ ]; environment.systemPackages = From 512212db36b3a3afec6ae38081028e51927ad3bc Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Fri, 15 Jul 2016 09:59:21 -0500 Subject: [PATCH 06/12] kde5.frameworks: unwrap all frameworks --- .../kde-5/applications/ark/default.nix | 51 ++++++++----------- pkgs/desktops/kde-5/frameworks/baloo.nix | 11 +--- pkgs/desktops/kde-5/frameworks/kconfig.nix | 11 +--- .../frameworks/kconfigwidgets/default.nix | 5 +- .../desktops/kde-5/frameworks/kcoreaddons.nix | 7 +-- .../desktops/kde-5/frameworks/kdbusaddons.nix | 10 +--- .../kde-5/frameworks/kdeclarative.nix | 7 +-- .../kde-5/frameworks/kdesignerplugin.nix | 7 +-- .../kde-5/frameworks/kdoctools/default.nix | 4 +- .../kde-5/frameworks/kglobalaccel.nix | 6 +-- .../kde-5/frameworks/kiconthemes/default.nix | 7 +-- .../desktops/kde-5/frameworks/kio/default.nix | 10 +--- pkgs/desktops/kde-5/frameworks/kjs.nix | 6 +-- pkgs/desktops/kde-5/frameworks/kjsembed.nix | 8 +-- .../kde-5/frameworks/kpackage/default.nix | 6 +-- .../kde-5/frameworks/ktexteditor/default.nix | 4 +- pkgs/desktops/kde-5/frameworks/kwallet.nix | 8 +-- .../kde-5/frameworks/plasma-framework.nix | 7 +-- pkgs/desktops/kde-5/frameworks/solid.nix | 6 +-- .../kde-5/plasma/plasma-workspace/default.nix | 39 +++++--------- 20 files changed, 64 insertions(+), 156 deletions(-) diff --git a/pkgs/desktops/kde-5/applications/ark/default.nix b/pkgs/desktops/kde-5/applications/ark/default.nix index 331c8c647ca..0af13b645e1 100644 --- a/pkgs/desktops/kde-5/applications/ark/default.nix +++ b/pkgs/desktops/kde-5/applications/ark/default.nix @@ -1,44 +1,33 @@ -{ kdeApp -, lib -, extra-cmake-modules -, kdoctools -, karchive -, kconfig -, kcrash -, kdbusaddons -, ki18n -, kiconthemes -, khtml -, kio -, kservice -, kpty -, kwidgetsaddons -, libarchive -, p7zip -, unrar -, unzipNLS -, zip -}: +{ + kdeApp, lib, -let PATH = lib.makeBinPath [ - p7zip unrar unzipNLS zip - ]; -in + extra-cmake-modules, kdoctools, makeQtWrapper, + + karchive, kconfig, kcrash, kdbusaddons, ki18n, kiconthemes, khtml, kio, + kservice, kpty, kwidgetsaddons, libarchive, + + # Archive tools + p7zip, unrar, unzipNLS, zip +}: kdeApp { name = "ark"; nativeBuildInputs = [ - extra-cmake-modules - kdoctools + extra-cmake-modules kdoctools makeQtWrapper ]; propagatedBuildInputs = [ khtml ki18n kio karchive kconfig kcrash kdbusaddons kiconthemes kservice kpty kwidgetsaddons libarchive ]; - postInstall = '' - wrapQtProgram "$out/bin/ark" \ - --prefix PATH : "${PATH}" - ''; + postInstall = + let + PATH = lib.makeBinPath [ + p7zip unrar unzipNLS zip + ]; + in '' + wrapQtProgram "$out/bin/ark" \ + --prefix PATH : "${PATH}" + ''; meta = { license = with lib.licenses; [ gpl2 lgpl3 ]; maintainers = [ lib.maintainers.ttuegel ]; diff --git a/pkgs/desktops/kde-5/frameworks/baloo.nix b/pkgs/desktops/kde-5/frameworks/baloo.nix index f676da0f4c8..825a125c8a7 100644 --- a/pkgs/desktops/kde-5/frameworks/baloo.nix +++ b/pkgs/desktops/kde-5/frameworks/baloo.nix @@ -1,22 +1,15 @@ { kdeFramework, lib, extra-cmake-modules, kauth, kconfig , kcoreaddons, kcrash, kdbusaddons, kfilemetadata, ki18n, kidletime -, kio, lmdb, makeQtWrapper, qtbase, solid +, kio, lmdb, qtbase, solid }: kdeFramework { name = "baloo"; - nativeBuildInputs = [ extra-cmake-modules makeQtWrapper ]; + nativeBuildInputs = [ extra-cmake-modules ]; propagatedBuildInputs = [ kauth kconfig kcoreaddons kcrash kdbusaddons kfilemetadata ki18n kio kidletime lmdb qtbase solid ]; - postInstall = '' - wrapQtProgram "$out/bin/baloo_file" - wrapQtProgram "$out/bin/baloo_file_extractor" - wrapQtProgram "$out/bin/balooctl" - wrapQtProgram "$out/bin/baloosearch" - wrapQtProgram "$out/bin/balooshow" - ''; meta = { maintainers = [ lib.maintainers.ttuegel ]; }; diff --git a/pkgs/desktops/kde-5/frameworks/kconfig.nix b/pkgs/desktops/kde-5/frameworks/kconfig.nix index e132afe5988..154329d0e98 100644 --- a/pkgs/desktops/kde-5/frameworks/kconfig.nix +++ b/pkgs/desktops/kde-5/frameworks/kconfig.nix @@ -1,16 +1,9 @@ { kdeFramework, lib , extra-cmake-modules -, makeQtWrapper }: kdeFramework { name = "kconfig"; - nativeBuildInputs = [ extra-cmake-modules makeQtWrapper ]; - postInstall = '' - wrapQtProgram "$out/bin/kreadconfig5" - wrapQtProgram "$out/bin/kwriteconfig5" - ''; - meta = { - maintainers = [ lib.maintainers.ttuegel ]; - }; + meta = { maintainers = [ lib.maintainers.ttuegel ]; }; + nativeBuildInputs = [ extra-cmake-modules ]; } diff --git a/pkgs/desktops/kde-5/frameworks/kconfigwidgets/default.nix b/pkgs/desktops/kde-5/frameworks/kconfigwidgets/default.nix index 1e6976113de..f507abe2991 100644 --- a/pkgs/desktops/kde-5/frameworks/kconfigwidgets/default.nix +++ b/pkgs/desktops/kde-5/frameworks/kconfigwidgets/default.nix @@ -1,15 +1,14 @@ { kdeFramework, lib, extra-cmake-modules, kauth, kcodecs, kconfig -, kdoctools, kguiaddons, ki18n, kwidgetsaddons, makeQtWrapper +, kdoctools, kguiaddons, ki18n, kwidgetsaddons }: kdeFramework { name = "kconfigwidgets"; meta = { maintainers = [ lib.maintainers.ttuegel ]; }; - nativeBuildInputs = [ extra-cmake-modules kdoctools makeQtWrapper ]; + nativeBuildInputs = [ extra-cmake-modules kdoctools ]; propagatedBuildInputs = [ kauth kconfig kcodecs kguiaddons ki18n kwidgetsaddons ]; patches = [ ./0001-qdiriterator-follow-symlinks.patch ]; postInstall = '' moveToOutput "bin/preparetips5" "$dev" - wrapQtProgram "$dev/bin/preparetips5" ''; } diff --git a/pkgs/desktops/kde-5/frameworks/kcoreaddons.nix b/pkgs/desktops/kde-5/frameworks/kcoreaddons.nix index 846b187c866..94b4136df3d 100644 --- a/pkgs/desktops/kde-5/frameworks/kcoreaddons.nix +++ b/pkgs/desktops/kde-5/frameworks/kcoreaddons.nix @@ -1,4 +1,4 @@ -{ kdeFramework, lib, makeQtWrapper +{ kdeFramework, lib , extra-cmake-modules , shared_mime_info }: @@ -6,9 +6,6 @@ kdeFramework { name = "kcoreaddons"; meta = { maintainers = [ lib.maintainers.ttuegel ]; }; - nativeBuildInputs = [ extra-cmake-modules makeQtWrapper ]; + nativeBuildInputs = [ extra-cmake-modules ]; propagatedBuildInputs = [ shared_mime_info ]; - postInstall = '' - wrapQtProgram "$out/bin/desktoptojson" - ''; } diff --git a/pkgs/desktops/kde-5/frameworks/kdbusaddons.nix b/pkgs/desktops/kde-5/frameworks/kdbusaddons.nix index d2ceab31d14..eadd645fb99 100644 --- a/pkgs/desktops/kde-5/frameworks/kdbusaddons.nix +++ b/pkgs/desktops/kde-5/frameworks/kdbusaddons.nix @@ -1,17 +1,11 @@ { kdeFramework, lib , extra-cmake-modules -, makeQtWrapper , qtx11extras }: kdeFramework { name = "kdbusaddons"; - nativeBuildInputs = [ extra-cmake-modules makeQtWrapper ]; + meta = { maintainers = [ lib.maintainers.ttuegel ]; }; + nativeBuildInputs = [ extra-cmake-modules ]; propagatedBuildInputs = [ qtx11extras ]; - postInstall = '' - wrapQtProgram "$out/bin/kquitapp5" - ''; - meta = { - maintainers = [ lib.maintainers.ttuegel ]; - }; } diff --git a/pkgs/desktops/kde-5/frameworks/kdeclarative.nix b/pkgs/desktops/kde-5/frameworks/kdeclarative.nix index af9a009b82e..8db1b73c91a 100644 --- a/pkgs/desktops/kde-5/frameworks/kdeclarative.nix +++ b/pkgs/desktops/kde-5/frameworks/kdeclarative.nix @@ -1,18 +1,15 @@ { kdeFramework, lib, extra-cmake-modules, epoxy, kconfig , kglobalaccel, kguiaddons, ki18n, kiconthemes, kio, kpackage -, kwidgetsaddons, kwindowsystem, makeQtWrapper, pkgconfig +, kwidgetsaddons, kwindowsystem, pkgconfig , qtdeclarative }: kdeFramework { name = "kdeclarative"; meta = { maintainers = [ lib.maintainers.ttuegel ]; }; - nativeBuildInputs = [ extra-cmake-modules makeQtWrapper ]; + nativeBuildInputs = [ extra-cmake-modules ]; propagatedBuildInputs = [ epoxy kconfig kglobalaccel kguiaddons ki18n kiconthemes kio kpackage kwidgetsaddons kwindowsystem qtdeclarative ]; - postInstall = '' - wrapQtProgram "$out/bin/kpackagelauncherqml" - ''; } diff --git a/pkgs/desktops/kde-5/frameworks/kdesignerplugin.nix b/pkgs/desktops/kde-5/frameworks/kdesignerplugin.nix index a99587bbf04..8e17a1a60c8 100644 --- a/pkgs/desktops/kde-5/frameworks/kdesignerplugin.nix +++ b/pkgs/desktops/kde-5/frameworks/kdesignerplugin.nix @@ -1,4 +1,4 @@ -{ kdeFramework, lib, makeQtWrapper +{ kdeFramework, lib , extra-cmake-modules , kcompletion , kconfig @@ -18,12 +18,9 @@ kdeFramework { name = "kdesignerplugin"; meta = { maintainers = [ lib.maintainers.ttuegel ]; }; - nativeBuildInputs = [ extra-cmake-modules kdoctools makeQtWrapper ]; + nativeBuildInputs = [ extra-cmake-modules kdoctools ]; propagatedBuildInputs = [ kcompletion kconfig kconfigwidgets kcoreaddons kiconthemes kio kitemviews kplotting ktextwidgets kwidgetsaddons kxmlgui sonnet ]; - postInstall = '' - wrapQtProgram "$out/bin/kgendesignerplugin" - ''; } diff --git a/pkgs/desktops/kde-5/frameworks/kdoctools/default.nix b/pkgs/desktops/kde-5/frameworks/kdoctools/default.nix index 0ed249da9a4..99fc4c7d023 100644 --- a/pkgs/desktops/kde-5/frameworks/kdoctools/default.nix +++ b/pkgs/desktops/kde-5/frameworks/kdoctools/default.nix @@ -1,5 +1,5 @@ { kdeFramework, lib, extra-cmake-modules, docbook_xml_dtd_45 -, docbook5_xsl, karchive, ki18n, makeQtWrapper, perl, perlPackages +, docbook5_xsl, karchive, ki18n, perl, perlPackages }: kdeFramework { @@ -7,7 +7,7 @@ kdeFramework { meta = { maintainers = [ lib.maintainers.ttuegel ]; }; nativeBuildInputs = [ extra-cmake-modules ]; propagatedBuildInputs = [ karchive ki18n ]; - propagatedNativeBuildInputs = [ makeQtWrapper perl perlPackages.URI ]; + propagatedNativeBuildInputs = [ perl perlPackages.URI ]; cmakeFlags = [ "-DDocBookXML4_DTD_DIR=${docbook_xml_dtd_45}/xml/dtd/docbook" "-DDocBookXSL_DIR=${docbook5_xsl}/xml/xsl/docbook" diff --git a/pkgs/desktops/kde-5/frameworks/kglobalaccel.nix b/pkgs/desktops/kde-5/frameworks/kglobalaccel.nix index 79db990f191..4743d0b8f1b 100644 --- a/pkgs/desktops/kde-5/frameworks/kglobalaccel.nix +++ b/pkgs/desktops/kde-5/frameworks/kglobalaccel.nix @@ -5,18 +5,14 @@ , kcrash , kdbusaddons , kwindowsystem -, makeQtWrapper , qtx11extras }: kdeFramework { name = "kglobalaccel"; meta = { maintainers = [ lib.maintainers.ttuegel ]; }; - nativeBuildInputs = [ extra-cmake-modules makeQtWrapper ]; + nativeBuildInputs = [ extra-cmake-modules ]; propagatedBuildInputs = [ kconfig kcoreaddons kcrash kdbusaddons kwindowsystem qtx11extras ]; - postInstall = '' - wrapQtProgram "$out/bin/kglobalaccel5" - ''; } diff --git a/pkgs/desktops/kde-5/frameworks/kiconthemes/default.nix b/pkgs/desktops/kde-5/frameworks/kiconthemes/default.nix index 825b15c8177..6102bb0d4b5 100644 --- a/pkgs/desktops/kde-5/frameworks/kiconthemes/default.nix +++ b/pkgs/desktops/kde-5/frameworks/kiconthemes/default.nix @@ -1,5 +1,5 @@ { kdeFramework, lib, copyPathsToStore -, extra-cmake-modules, makeQtWrapper +, extra-cmake-modules , karchive, kconfigwidgets, ki18n, breeze-icons, kitemviews, qtsvg }: @@ -7,9 +7,6 @@ kdeFramework { name = "kiconthemes"; meta = { maintainers = [ lib.maintainers.ttuegel ]; }; patches = copyPathsToStore (lib.readPathsFromFile ./. ./series); - nativeBuildInputs = [ extra-cmake-modules makeQtWrapper ]; + nativeBuildInputs = [ extra-cmake-modules ]; propagatedBuildInputs = [ breeze-icons kconfigwidgets karchive ki18n kitemviews qtsvg ]; - postInstall = '' - wrapQtProgram "$out/bin/kiconfinder5" - ''; } diff --git a/pkgs/desktops/kde-5/frameworks/kio/default.nix b/pkgs/desktops/kde-5/frameworks/kio/default.nix index 7e4317a3f09..cb67c845903 100644 --- a/pkgs/desktops/kde-5/frameworks/kio/default.nix +++ b/pkgs/desktops/kde-5/frameworks/kio/default.nix @@ -3,14 +3,14 @@ , kbookmarks, kcompletion, kconfig, kconfigwidgets, kcoreaddons , kdbusaddons, kdoctools, ki18n, kiconthemes, kitemviews , kjobwidgets, knotifications, kservice, ktextwidgets, kwallet -, kwidgetsaddons, kwindowsystem, kxmlgui, makeQtWrapper +, kwidgetsaddons, kwindowsystem, kxmlgui , qtscript, qtx11extras, solid }: kdeFramework { name = "kio"; meta = { maintainers = [ lib.maintainers.ttuegel ]; }; - nativeBuildInputs = [ extra-cmake-modules kdoctools makeQtWrapper ]; + nativeBuildInputs = [ extra-cmake-modules kdoctools ]; propagatedBuildInputs = [ acl karchive kbookmarks kcompletion kconfig kconfigwidgets kcoreaddons kdbusaddons ki18n kiconthemes kitemviews kjobwidgets knotifications kservice @@ -18,10 +18,4 @@ kdeFramework { qtx11extras ]; patches = copyPathsToStore (lib.readPathsFromFile ./. ./series); - postInstall = '' - wrapQtProgram "$out/bin/kcookiejar5" - wrapQtProgram "$out/bin/ktelnetservice5" - wrapQtProgram "$out/bin/ktrash5" - wrapQtProgram "$out/bin/protocoltojson" - ''; } diff --git a/pkgs/desktops/kde-5/frameworks/kjs.nix b/pkgs/desktops/kde-5/frameworks/kjs.nix index 1a8750ea74f..abdc15ce8df 100644 --- a/pkgs/desktops/kde-5/frameworks/kjs.nix +++ b/pkgs/desktops/kde-5/frameworks/kjs.nix @@ -1,14 +1,10 @@ { kdeFramework, lib , extra-cmake-modules , kdoctools -, makeQtWrapper }: kdeFramework { name = "kjs"; meta = { maintainers = [ lib.maintainers.ttuegel ]; }; - nativeBuildInputs = [ extra-cmake-modules kdoctools makeQtWrapper ]; - postInstall = '' - wrapQtProgram "$out/bin/kjs5" - ''; + nativeBuildInputs = [ extra-cmake-modules kdoctools ]; } diff --git a/pkgs/desktops/kde-5/frameworks/kjsembed.nix b/pkgs/desktops/kde-5/frameworks/kjsembed.nix index 7611b831007..95bc02422f1 100644 --- a/pkgs/desktops/kde-5/frameworks/kjsembed.nix +++ b/pkgs/desktops/kde-5/frameworks/kjsembed.nix @@ -1,14 +1,10 @@ { kdeFramework, lib, extra-cmake-modules, kdoctools, ki18n, kjs -, makeQtWrapper, qtsvg +, qtsvg }: kdeFramework { name = "kjsembed"; meta = { maintainers = [ lib.maintainers.ttuegel ]; }; - nativeBuildInputs = [ extra-cmake-modules kdoctools makeQtWrapper ]; + nativeBuildInputs = [ extra-cmake-modules kdoctools ]; propagatedBuildInputs = [ ki18n kjs qtsvg ]; - postInstall = '' - wrapQtProgram "$out/bin/kjscmd5" - wrapQtProgram "$out/bin/kjsconsole" - ''; } diff --git a/pkgs/desktops/kde-5/frameworks/kpackage/default.nix b/pkgs/desktops/kde-5/frameworks/kpackage/default.nix index 874bb380d73..a39a672574b 100644 --- a/pkgs/desktops/kde-5/frameworks/kpackage/default.nix +++ b/pkgs/desktops/kde-5/frameworks/kpackage/default.nix @@ -5,16 +5,12 @@ , kcoreaddons , kdoctools , ki18n -, makeQtWrapper }: kdeFramework { name = "kpackage"; meta = { maintainers = [ lib.maintainers.ttuegel ]; }; - nativeBuildInputs = [ extra-cmake-modules kdoctools makeQtWrapper ]; + nativeBuildInputs = [ extra-cmake-modules kdoctools ]; propagatedBuildInputs = [ karchive kconfig kcoreaddons ki18n ]; patches = copyPathsToStore (lib.readPathsFromFile ./. ./series); - postInstall = '' - wrapQtProgram "$out/bin/kpackagetool5" - ''; } diff --git a/pkgs/desktops/kde-5/frameworks/ktexteditor/default.nix b/pkgs/desktops/kde-5/frameworks/ktexteditor/default.nix index e1a5e8b2339..a35af2e7fbf 100644 --- a/pkgs/desktops/kde-5/frameworks/ktexteditor/default.nix +++ b/pkgs/desktops/kde-5/frameworks/ktexteditor/default.nix @@ -1,5 +1,5 @@ { kdeFramework, lib, copyPathsToStore -, extra-cmake-modules, makeQtWrapper, perl +, extra-cmake-modules, perl , karchive, kconfig, kguiaddons, kiconthemes, kparts , libgit2 , qtscript, qtxmlpatterns @@ -9,7 +9,7 @@ kdeFramework { name = "ktexteditor"; meta = { maintainers = [ lib.maintainers.ttuegel ]; }; - nativeBuildInputs = [ extra-cmake-modules makeQtWrapper perl ]; + nativeBuildInputs = [ extra-cmake-modules perl ]; propagatedBuildInputs = [ karchive kconfig kguiaddons ki18n kiconthemes kio kparts libgit2 qtscript qtxmlpatterns sonnet diff --git a/pkgs/desktops/kde-5/frameworks/kwallet.nix b/pkgs/desktops/kde-5/frameworks/kwallet.nix index 3bb99df39a7..f02c6138df7 100644 --- a/pkgs/desktops/kde-5/frameworks/kwallet.nix +++ b/pkgs/desktops/kde-5/frameworks/kwallet.nix @@ -1,18 +1,14 @@ { kdeFramework, lib, extra-cmake-modules, kconfig, kconfigwidgets , kcoreaddons , kdbusaddons, kdoctools, ki18n, kiconthemes , knotifications , kservice, kwidgetsaddons, kwindowsystem, libgcrypt -, makeQtWrapper }: +}: kdeFramework { name = "kwallet"; meta = { maintainers = [ lib.maintainers.ttuegel ]; }; - nativeBuildInputs = [ extra-cmake-modules kdoctools makeQtWrapper ]; + nativeBuildInputs = [ extra-cmake-modules kdoctools ]; propagatedBuildInputs = [ kconfig kconfigwidgets kcoreaddons kdbusaddons ki18n kiconthemes knotifications kservice kwidgetsaddons kwindowsystem libgcrypt ]; - postInstall = '' - wrapQtProgram "$out/bin/kwalletd5" - wrapQtProgram "$out/bin/kwallet-query" - ''; } diff --git a/pkgs/desktops/kde-5/frameworks/plasma-framework.nix b/pkgs/desktops/kde-5/frameworks/plasma-framework.nix index 2a8762c814f..a4138148653 100644 --- a/pkgs/desktops/kde-5/frameworks/plasma-framework.nix +++ b/pkgs/desktops/kde-5/frameworks/plasma-framework.nix @@ -2,19 +2,16 @@ , kconfig, kconfigwidgets, kcoreaddons, kdbusaddons, kdeclarative , kdoctools, kglobalaccel, kguiaddons, ki18n, kiconthemes, kio , knotifications, kpackage, kservice, kwindowsystem, kxmlgui -, makeQtWrapper, qtscript, qtx11extras +, qtscript, qtx11extras }: kdeFramework { name = "plasma-framework"; meta = { maintainers = [ lib.maintainers.ttuegel ]; }; - nativeBuildInputs = [ extra-cmake-modules kdoctools makeQtWrapper ]; + nativeBuildInputs = [ extra-cmake-modules kdoctools ]; propagatedBuildInputs = [ kactivities karchive kconfig kconfigwidgets kcoreaddons kdbusaddons kdeclarative kglobalaccel kguiaddons ki18n kiconthemes kio knotifications kpackage kservice kwindowsystem kxmlgui qtscript qtx11extras ]; - postInstall = '' - wrapQtProgram "$out/bin/plasmapkg2" - ''; } diff --git a/pkgs/desktops/kde-5/frameworks/solid.nix b/pkgs/desktops/kde-5/frameworks/solid.nix index f1db5c35c10..c4f580fe1c2 100644 --- a/pkgs/desktops/kde-5/frameworks/solid.nix +++ b/pkgs/desktops/kde-5/frameworks/solid.nix @@ -1,15 +1,11 @@ { kdeFramework, lib , extra-cmake-modules -, makeQtWrapper , qtdeclarative }: kdeFramework { name = "solid"; meta = { maintainers = [ lib.maintainers.ttuegel ]; }; - nativeBuildInputs = [ extra-cmake-modules makeQtWrapper ]; + nativeBuildInputs = [ extra-cmake-modules ]; propagatedBuildInputs = [ qtdeclarative ]; - postInstall = '' - wrapQtProgram "$out/bin/solid-hardware5" - ''; } diff --git a/pkgs/desktops/kde-5/plasma/plasma-workspace/default.nix b/pkgs/desktops/kde-5/plasma/plasma-workspace/default.nix index bb65e1af937..190003ca5c7 100644 --- a/pkgs/desktops/kde-5/plasma/plasma-workspace/default.nix +++ b/pkgs/desktops/kde-5/plasma/plasma-workspace/default.nix @@ -1,19 +1,21 @@ -{ plasmaPackage, lib, copyPathsToStore -, extra-cmake-modules, kdoctools -, baloo, kactivities, kcmutils, kconfig, kcrash, kdbusaddons, kdeclarative -, kdelibs4support, kdesu, kglobalaccel, kidletime, kjsembed, knewstuff -, knotifyconfig, kpackage, krunner, ktexteditor, ktextwidgets, kwallet, kwayland -, kwin, kxmlrpcclient, libkscreen, libksysguard, networkmanager-qt, phonon -, plasma-framework, qtquickcontrols, qtscript, qtx11extras, solid -, isocodes, libdbusmenu, libSM, libXcursor, pam, wayland +{ + plasmaPackage, lib, copyPathsToStore, + + extra-cmake-modules, kdoctools, + + baloo, kactivities, kcmutils, kconfig, kcrash, kdbusaddons, kdeclarative, + kdelibs4support, kdesu, kglobalaccel, kidletime, kjsembed, knewstuff, + knotifyconfig, kpackage, krunner, ktexteditor, ktextwidgets, kwallet, kwayland, + kwin, kxmlrpcclient, libkscreen, libksysguard, networkmanager-qt, phonon, + plasma-framework, qtquickcontrols, qtscript, qtx11extras, solid, isocodes, + libdbusmenu, libSM, libXcursor, pam, wayland }: plasmaPackage { name = "plasma-workspace"; nativeBuildInputs = [ - extra-cmake-modules - kdoctools + extra-cmake-modules kdoctools ]; buildInputs = [ baloo kactivities kcmutils kconfig kcrash kdbusaddons kdeclarative @@ -37,21 +39,4 @@ plasmaPackage { rm "$out/lib/libexec/startplasma" rm -r "$out/share/wayland-sessions" ''; - - preFixup = '' - wrapQtProgram $out/bin/kcheckrunning - wrapQtProgram $out/bin/kcminit - wrapQtProgram $out/bin/kcminit_startup - wrapQtProgram $out/bin/kdostartupconfig5 - wrapQtProgram $out/bin/klipper - wrapQtProgram $out/bin/krunner - wrapQtProgram $out/bin/ksmserver - wrapQtProgram $out/bin/ksplashqml - wrapQtProgram $out/bin/kstartupconfig5 - wrapQtProgram $out/bin/kuiserver5 - wrapQtProgram $out/bin/plasmashell - wrapQtProgram $out/bin/plasmawindowed - wrapQtProgram $out/bin/systemmonitor - wrapQtProgram $out/bin/xembedsniproxy - ''; } From d3747a2261515c1463517cd5963e7ab73fbd7fbf Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Fri, 15 Jul 2016 12:10:54 -0500 Subject: [PATCH 07/12] kinit: use a setuid wrapper for start_kdeinit --- .../modules/services/x11/desktop-managers/kde5.nix | 8 ++------ pkgs/desktops/kde-5/frameworks/kinit/default.nix | 10 ++++++---- .../kde-5/frameworks/kinit/kinit-libpath.patch | 8 ++++---- pkgs/desktops/kde-5/frameworks/kinit/series | 1 + .../kde-5/frameworks/kinit/start_kdeinit-path.patch | 13 +++++++++++++ 5 files changed, 26 insertions(+), 14 deletions(-) create mode 100644 pkgs/desktops/kde-5/frameworks/kinit/start_kdeinit-path.patch diff --git a/nixos/modules/services/x11/desktop-managers/kde5.nix b/nixos/modules/services/x11/desktop-managers/kde5.nix index f94e1b6559a..9b07dfed3bd 100644 --- a/nixos/modules/services/x11/desktop-managers/kde5.nix +++ b/nixos/modules/services/x11/desktop-managers/kde5.nix @@ -54,16 +54,12 @@ in owner = "root"; setuid = true; } - # ttuegel: Disabled until I can figure out how to propagate the - # necessary environment variables. - /* { - program = "start_kdeinit_wrapper"; - source = "${kde5.kinit.out}/lib/libexec/kf5/start_kdeinit_wrapper"; + program = "start_kdeinit"; + source = "${kde5.kinit.out}/lib/libexec/kf5/start_kdeinit"; owner = "root"; setuid = true; } - */ ]; environment.systemPackages = diff --git a/pkgs/desktops/kde-5/frameworks/kinit/default.nix b/pkgs/desktops/kde-5/frameworks/kinit/default.nix index 08901010de8..b965f761e92 100644 --- a/pkgs/desktops/kde-5/frameworks/kinit/default.nix +++ b/pkgs/desktops/kde-5/frameworks/kinit/default.nix @@ -1,13 +1,15 @@ -{ kdeFramework, lib, copyPathsToStore, extra-cmake-modules, kconfig, kcrash -, kdoctools, ki18n, kio, kservice, kwindowsystem, libcap +{ + kdeFramework, lib, copyPathsToStore, + extra-cmake-modules, kdoctools, + kconfig, kcrash, ki18n, kio, kservice, kwindowsystem }: kdeFramework { name = "kinit"; meta = { maintainers = [ lib.maintainers.ttuegel ]; }; - nativeBuildInputs = [ extra-cmake-modules kdoctools libcap.out ]; + nativeBuildInputs = [ extra-cmake-modules kdoctools ]; propagatedBuildInputs = [ - kconfig kcrash ki18n kio kservice kwindowsystem libcap + kconfig kcrash ki18n kio kservice kwindowsystem ]; patches = copyPathsToStore (lib.readPathsFromFile ./. ./series); } diff --git a/pkgs/desktops/kde-5/frameworks/kinit/kinit-libpath.patch b/pkgs/desktops/kde-5/frameworks/kinit/kinit-libpath.patch index 47538fbe456..a5c76fca248 100644 --- a/pkgs/desktops/kde-5/frameworks/kinit/kinit-libpath.patch +++ b/pkgs/desktops/kde-5/frameworks/kinit/kinit-libpath.patch @@ -1,8 +1,8 @@ -Index: kinit-5.21.0/src/kdeinit/kinit.cpp +Index: kinit-5.24.0/src/kdeinit/kinit.cpp =================================================================== ---- kinit-5.21.0.orig/src/kdeinit/kinit.cpp -+++ kinit-5.21.0/src/kdeinit/kinit.cpp -@@ -657,19 +657,16 @@ static pid_t launch(int argc, const char +--- kinit-5.24.0.orig/src/kdeinit/kinit.cpp ++++ kinit-5.24.0/src/kdeinit/kinit.cpp +@@ -672,19 +672,16 @@ static pid_t launch(int argc, const char if (!libpath.isEmpty()) { if (libpath_relative) { diff --git a/pkgs/desktops/kde-5/frameworks/kinit/series b/pkgs/desktops/kde-5/frameworks/kinit/series index 5faa456366b..576b8a935bf 100644 --- a/pkgs/desktops/kde-5/frameworks/kinit/series +++ b/pkgs/desktops/kde-5/frameworks/kinit/series @@ -1 +1,2 @@ kinit-libpath.patch +start_kdeinit-path.patch diff --git a/pkgs/desktops/kde-5/frameworks/kinit/start_kdeinit-path.patch b/pkgs/desktops/kde-5/frameworks/kinit/start_kdeinit-path.patch new file mode 100644 index 00000000000..fbecf9433f6 --- /dev/null +++ b/pkgs/desktops/kde-5/frameworks/kinit/start_kdeinit-path.patch @@ -0,0 +1,13 @@ +Index: kinit-5.24.0/src/start_kdeinit/start_kdeinit_wrapper.c +=================================================================== +--- kinit-5.24.0.orig/src/start_kdeinit/start_kdeinit_wrapper.c ++++ kinit-5.24.0/src/start_kdeinit/start_kdeinit_wrapper.c +@@ -23,7 +23,7 @@ + #include + #include + +-#define EXECUTE CMAKE_INSTALL_FULL_LIBEXECDIR_KF5 "/start_kdeinit" ++#define EXECUTE "/var/setuid-wrappers/start_kdeinit" + + #if KDEINIT_OOM_PROTECT + From 32c1f05aedb978e6b9ea643e8a41f5776414272f Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Fri, 15 Jul 2016 17:59:17 -0500 Subject: [PATCH 08/12] nixos/kde5: install missing frameworks --- .../services/x11/desktop-managers/kde5.nix | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/nixos/modules/services/x11/desktop-managers/kde5.nix b/nixos/modules/services/x11/desktop-managers/kde5.nix index 9b07dfed3bd..d8697238ee5 100644 --- a/nixos/modules/services/x11/desktop-managers/kde5.nix +++ b/nixos/modules/services/x11/desktop-managers/kde5.nix @@ -65,7 +65,45 @@ in environment.systemPackages = [ kde5.frameworkintegration + kde5.kactivities + kde5.kauth + kde5.kcmutils + kde5.kconfig + kde5.kconfigwidgets + kde5.kcoreaddons + kde5.kdbusaddons + kde5.kdeclarative + kde5.kded + kde5.kdesu + kde5.kdnssd + kde5.kemoticons + kde5.kfilemetadata + kde5.kglobalaccel + kde5.kguiaddons + kde5.kiconthemes + kde5.kidletime + kde5.kimageformats kde5.kinit + kde5.kio + kde5.kjobwidgets + kde5.knewstuff + kde5.knotifications + kde5.knotifyconfig + kde5.kpackage + kde5.kparts + kde5.kpeople + kde5.krunner + kde5.kservice + kde5.ktextwidgets + kde5.kwallet + kde5.kwayland + kde5.kwidgetsaddons + kde5.kxmlgui + kde5.kxmlrpcclient + kde5.plasma-framework + kde5.solid + kde5.sonnet + kde5.threadweaver kde5.breeze kde5.kde-cli-tools From 475ad4c7c3e458480bf4fa562eb4b3add5b710d7 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Fri, 15 Jul 2016 18:25:15 -0500 Subject: [PATCH 09/12] kde5.startkde: update script based on plasma-workspace-5.7.1 --- .../kde-5/plasma/startkde/startkde.sh | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/pkgs/desktops/kde-5/plasma/startkde/startkde.sh b/pkgs/desktops/kde-5/plasma/startkde/startkde.sh index a626fdc2b5a..18cf08081c4 100755 --- a/pkgs/desktops/kde-5/plasma/startkde/startkde.sh +++ b/pkgs/desktops/kde-5/plasma/startkde/startkde.sh @@ -77,7 +77,7 @@ kcminputrc Mouse cursorTheme 'breeze_cursors' kcminputrc Mouse cursorSize '' ksplashrc KSplash Theme Breeze ksplashrc KSplash Engine KSplashQML -kdeglobals KScreen ScaleFactor 1 +kdeglobals KScreen ScreenScaleFactors '' kcmfonts General forceFontDPI 0 EOF @@ -157,20 +157,6 @@ xsetroot -cursor_name left_ptr dl=$DESKTOP_LOCKED unset DESKTOP_LOCKED # Don't want it in the environment -# Make sure that D-Bus is running -# D-Bus autolaunch is broken -if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then - eval $(dbus-launch --sh-syntax --exit-with-session) -fi -if qdbus >/dev/null 2>/dev/null; then - : # ok -else - echo 'startkde: Could not start D-Bus. Can you call qdbus?' 1>&2 - test -n "$ksplash_pid" && kill "$ksplash_pid" 2>/dev/null - xmessage -geometry 500x100 "Could not start D-Bus. Can you call qdbus?" - exit 1 -fi - ksplash_pid= if test -z "$dl"; then # the splashscreen and progress indicator @@ -209,6 +195,16 @@ done echo 'startkde: Starting up...' 1>&2 +# Make sure that D-Bus is running +if $qdbus >/dev/null 2>/dev/null; then + : # ok +else + echo 'startkde: Could not start D-Bus. Can you call qdbus?' 1>&2 + test -n "$ksplash_pid" && kill "$ksplash_pid" 2>/dev/null + xmessage -geometry 500x100 "Could not start D-Bus. Can you call qdbus?" + exit 1 +fi + # Mark that full KDE session is running (e.g. Konqueror preloading works only # with full KDE running). The KDE_FULL_SESSION property can be detected by # any X client connected to the same X session, even if not launched @@ -255,7 +251,7 @@ if test -n "$PAM_KWALLET5_LOGIN" ; then fi # At this point all environment variables are set, let's send it to the DBus session server to update the activation environment -ksyncdbusenv +dbus-update-activation-environment --systemd --all if test $? -ne 0; then # Startup error echo 'startkde: Could not sync environment to dbus.' 1>&2 @@ -275,6 +271,8 @@ if test $? -ne 0; then exit 1 fi +qdbus org.kde.KSplash /KSplash org.kde.KSplash.setStage kinit + # (NixOS) Run kbuildsycoca5 before starting the user session because things # may be missing or moved if they have run nixos-rebuild and it may not be # possible for them to start Konsole to run it manually! From b2cf5aabb0df860e5eff4e9692e2239b9c94b2cf Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Fri, 15 Jul 2016 18:27:00 -0500 Subject: [PATCH 10/12] nixos/kde5: add missing Plasma packages --- nixos/modules/services/x11/desktop-managers/kde5.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nixos/modules/services/x11/desktop-managers/kde5.nix b/nixos/modules/services/x11/desktop-managers/kde5.nix index d8697238ee5..9f9bbe24623 100644 --- a/nixos/modules/services/x11/desktop-managers/kde5.nix +++ b/nixos/modules/services/x11/desktop-managers/kde5.nix @@ -106,7 +106,9 @@ in kde5.threadweaver kde5.breeze + kde5.kactivitymanagerd kde5.kde-cli-tools + kde5.kdecoration kde5.kdeplasma-addons kde5.kgamma5 kde5.khelpcenter @@ -114,12 +116,16 @@ in kde5.kinfocenter kde5.kmenuedit kde5.kscreen + kde5.kscreenlocker kde5.ksysguard kde5.kwayland kde5.kwin kde5.kwrited + kde5.libkscreen + kde5.libksysguard kde5.milou kde5.oxygen + kde5.plasma-integration kde5.polkit-kde-agent kde5.systemsettings From 78e7f444886379607b29cf27ae6ac7bd84ed6d20 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Sat, 16 Jul 2016 08:59:43 -0500 Subject: [PATCH 11/12] qt5.makeQtWrapper: do not inherit Qt search paths --- .../extra-cmake-modules/setup-hook.sh | 27 ++++++++----- .../libraries/qt-5/5.5/make-qt-wrapper.sh | 39 +------------------ .../libraries/qt-5/5.6/make-qt-wrapper.sh | 26 ++++++------- 3 files changed, 31 insertions(+), 61 deletions(-) mode change 100644 => 120000 pkgs/development/libraries/qt-5/5.5/make-qt-wrapper.sh diff --git a/pkgs/desktops/kde-5/frameworks/extra-cmake-modules/setup-hook.sh b/pkgs/desktops/kde-5/frameworks/extra-cmake-modules/setup-hook.sh index aab0625bf61..6c8199f17d4 100644 --- a/pkgs/desktops/kde-5/frameworks/extra-cmake-modules/setup-hook.sh +++ b/pkgs/desktops/kde-5/frameworks/extra-cmake-modules/setup-hook.sh @@ -1,22 +1,31 @@ _ecmSetXdgDirs() { addToSearchPathOnce XDG_DATA_DIRS "$1/share" addToSearchPathOnce XDG_CONFIG_DIRS "$1/etc/xdg" - addToSearchPathOnce NIX_WRAP_XDG_CONFIG_DIRS "$1/etc/xdg" + addToSearchPathOnce RUNTIME_XDG_CONFIG_DIRS "$1/etc/xdg" } _ecmSharePaths=( \ + "appdata" \ + "applications" \ "config.cfg" \ + "dbus-1" \ + "desktop-directories" \ + "doc" \ + "icons" \ + "info" \ "kconf_update" \ "kservices5" \ "kservicetypes5" \ "knotifications5" \ - "applications" \ - "desktop-directories" \ + "kxmlgui5" \ + "locale" \ + "man" \ "mime" \ - "dbus-1" \ - "interfaces" \ - "services" \ - "system-services" ) + "polkit-1" \ + "sounds" \ + "templates" \ + "wallpapers" \ + ) _ecmPropagateNative() { for dir in ${_ecmSharePaths[@]}; do @@ -24,7 +33,7 @@ _ecmPropagateNative() { propagateOnce propagatedNativeBuildInputs "$1" if [ -z "$crossConfig" ]; then propagateOnce propagatedUserEnvPkgs "$1" - addToSearchPathOnce NIX_WRAP_XDG_DATA_DIRS "$1/share" + addToSearchPathOnce RUNTIME_XDG_DATA_DIRS "$1/share" fi break fi @@ -38,7 +47,7 @@ _ecmPropagate() { if [ -d "$1/share/$dir" ]; then propagateOnce propagatedBuildInputs "$1" propagateOnce propagatedUserEnvPkgs "$1" - addToSearchPathOnce NIX_WRAP_XDG_DATA_DIRS "$1/share" + addToSearchPathOnce RUNTIME_XDG_DATA_DIRS "$1/share" break fi done diff --git a/pkgs/development/libraries/qt-5/5.5/make-qt-wrapper.sh b/pkgs/development/libraries/qt-5/5.5/make-qt-wrapper.sh deleted file mode 100644 index 3b537430371..00000000000 --- a/pkgs/development/libraries/qt-5/5.5/make-qt-wrapper.sh +++ /dev/null @@ -1,38 +0,0 @@ -wrapQtProgram() { - local prog="$1" - shift - wrapProgram "$prog" \ - --prefix QT_PLUGIN_PATH : "$QT_PLUGIN_PATH" \ - --prefix QML_IMPORT_PATH : "$QML_IMPORT_PATH" \ - --prefix QML2_IMPORT_PATH : "$QML2_IMPORT_PATH" \ - --prefix XDG_CONFIG_DIRS : "$NIX_WRAP_XDG_CONFIG_DIRS" \ - --prefix XDG_DATA_DIRS : "$NIX_WRAP_XDG_DATA_DIRS" \ - "$@" -} - -makeQtWrapper() { - local old="$1" - local new="$2" - shift - shift - makeWrapper "$old" "$new" \ - --prefix QT_PLUGIN_PATH : "$QT_PLUGIN_PATH" \ - --prefix QML_IMPORT_PATH : "$QML_IMPORT_PATH" \ - --prefix QML2_IMPORT_PATH : "$QML2_IMPORT_PATH" \ - --prefix XDG_CONFIG_DIRS : "$NIX_WRAP_XDG_CONFIG_DIRS" \ - --prefix XDG_DATA_DIRS : "$NIX_WRAP_XDG_DATA_DIRS" \ - "$@" -} - -_makeQtWrapperSetup() { - # cannot use addToSearchPath because these directories may not exist yet - export QT_PLUGIN_PATH="$QT_PLUGIN_PATH${QT_PLUGIN_PATH:+:}${!outputLib}/lib/qt5/plugins" - export QML_IMPORT_PATH="$QML_IMPORT_PATH${QML_IMPORT_PATH:+:}${!outputLib}/lib/qt5/imports" - export QML2_IMPORT_PATH="$QML2_IMPORT_PATH${QML2_IMPORT_PATH:+:}${!outputLib}/lib/qt5/qml" - export XDG_CONFIG_DIRS="$XDG_CONFIG_DIRS${XDG_CONFIG_DIRS:+:}${!outputLib}/etc/xdg" - export XDG_DATA_DIRS="$XDG_DATA_DIRS${XDG_DATA_DIRS:+:}${!outputLib}/share" - export NIX_WRAP_XDG_CONFIG_DIRS="$NIX_WRAP_XDG_CONFIG_DIRS${NIX_WRAP_XDG_CONFIG_DIRS:+:}${!outputLib}/etc/xdg" - export NIX_WRAP_XDG_DATA_DIRS="$NIX_WRAP_XDG_DATA_DIRS${NIX_WRAP_XDG_DATA_DIRS:+:}${!outputLib}/share" -} - -prePhases+=(_makeQtWrapperSetup) diff --git a/pkgs/development/libraries/qt-5/5.5/make-qt-wrapper.sh b/pkgs/development/libraries/qt-5/5.5/make-qt-wrapper.sh new file mode 120000 index 00000000000..90d9b349fed --- /dev/null +++ b/pkgs/development/libraries/qt-5/5.5/make-qt-wrapper.sh @@ -0,0 +1 @@ +../5.6/make-qt-wrapper.sh \ No newline at end of file diff --git a/pkgs/development/libraries/qt-5/5.6/make-qt-wrapper.sh b/pkgs/development/libraries/qt-5/5.6/make-qt-wrapper.sh index 3b537430371..b0d0bec9e3f 100644 --- a/pkgs/development/libraries/qt-5/5.6/make-qt-wrapper.sh +++ b/pkgs/development/libraries/qt-5/5.6/make-qt-wrapper.sh @@ -2,11 +2,11 @@ wrapQtProgram() { local prog="$1" shift wrapProgram "$prog" \ - --prefix QT_PLUGIN_PATH : "$QT_PLUGIN_PATH" \ - --prefix QML_IMPORT_PATH : "$QML_IMPORT_PATH" \ - --prefix QML2_IMPORT_PATH : "$QML2_IMPORT_PATH" \ - --prefix XDG_CONFIG_DIRS : "$NIX_WRAP_XDG_CONFIG_DIRS" \ - --prefix XDG_DATA_DIRS : "$NIX_WRAP_XDG_DATA_DIRS" \ + --set QT_PLUGIN_PATH "$QT_PLUGIN_PATH" \ + --set QML_IMPORT_PATH "$QML_IMPORT_PATH" \ + --set QML2_IMPORT_PATH "$QML2_IMPORT_PATH" \ + --prefix XDG_DATA_DIRS : "$RUNTIME_XDG_DATA_DIRS" \ + --prefix XDG_CONFIG_DIRS : "$RUNTIME_XDG_CONFIG_DIRS" \ "$@" } @@ -16,11 +16,11 @@ makeQtWrapper() { shift shift makeWrapper "$old" "$new" \ - --prefix QT_PLUGIN_PATH : "$QT_PLUGIN_PATH" \ - --prefix QML_IMPORT_PATH : "$QML_IMPORT_PATH" \ - --prefix QML2_IMPORT_PATH : "$QML2_IMPORT_PATH" \ - --prefix XDG_CONFIG_DIRS : "$NIX_WRAP_XDG_CONFIG_DIRS" \ - --prefix XDG_DATA_DIRS : "$NIX_WRAP_XDG_DATA_DIRS" \ + --set QT_PLUGIN_PATH "$QT_PLUGIN_PATH" \ + --set QML_IMPORT_PATH "$QML_IMPORT_PATH" \ + --set QML2_IMPORT_PATH "$QML2_IMPORT_PATH" \ + --prefix XDG_DATA_DIRS : "$RUNTIME_XDG_DATA_DIRS" \ + --prefix XDG_CONFIG_DIRS : "$RUNTIME_XDG_CONFIG_DIRS" \ "$@" } @@ -29,10 +29,8 @@ _makeQtWrapperSetup() { export QT_PLUGIN_PATH="$QT_PLUGIN_PATH${QT_PLUGIN_PATH:+:}${!outputLib}/lib/qt5/plugins" export QML_IMPORT_PATH="$QML_IMPORT_PATH${QML_IMPORT_PATH:+:}${!outputLib}/lib/qt5/imports" export QML2_IMPORT_PATH="$QML2_IMPORT_PATH${QML2_IMPORT_PATH:+:}${!outputLib}/lib/qt5/qml" - export XDG_CONFIG_DIRS="$XDG_CONFIG_DIRS${XDG_CONFIG_DIRS:+:}${!outputLib}/etc/xdg" - export XDG_DATA_DIRS="$XDG_DATA_DIRS${XDG_DATA_DIRS:+:}${!outputLib}/share" - export NIX_WRAP_XDG_CONFIG_DIRS="$NIX_WRAP_XDG_CONFIG_DIRS${NIX_WRAP_XDG_CONFIG_DIRS:+:}${!outputLib}/etc/xdg" - export NIX_WRAP_XDG_DATA_DIRS="$NIX_WRAP_XDG_DATA_DIRS${NIX_WRAP_XDG_DATA_DIRS:+:}${!outputLib}/share" + export RUNTIME_XDG_DATA_DIRS="$XDG_DATA_DIRS${XDG_DATA_DIRS:+:}${!outputBin}/share" + export RUNTIME_XDG_CONFIG_DIRS="$XDG_CONFIG_DIRS${XDG_CONFIG_DIRS:+:}${!outputBin}/etc/xdg" } prePhases+=(_makeQtWrapperSetup) From 560c4a59275c237b64158bff7f6cfa66883204d3 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Sat, 16 Jul 2016 10:01:38 -0500 Subject: [PATCH 12/12] kde5.kservice: remove unused setup hook --- .../kde-5/frameworks/kservice/setup-hook.sh | 43 ------------------- 1 file changed, 43 deletions(-) delete mode 100644 pkgs/desktops/kde-5/frameworks/kservice/setup-hook.sh diff --git a/pkgs/desktops/kde-5/frameworks/kservice/setup-hook.sh b/pkgs/desktops/kde-5/frameworks/kservice/setup-hook.sh deleted file mode 100644 index c28e862ff8a..00000000000 --- a/pkgs/desktops/kde-5/frameworks/kservice/setup-hook.sh +++ /dev/null @@ -1,43 +0,0 @@ -addServicePkg() { - local propagated - for dir in "share/kservices5" "share/kservicetypes5"; do - if [[ -d "$1/$dir" ]]; then - propagated= - for pkg in $propagatedBuildInputs; do - if [[ "z$pkg" == "z$1" ]]; then - propagated=1 - break - fi - done - if [[ -z $propagated ]]; then - propagatedBuildInputs="$propagatedBuildInputs $1" - fi - - propagated= - for pkg in $propagatedUserEnvPkgs; do - if [[ "z$pkg" == "z$1" ]]; then - propagated=1 - break - fi - done - if [[ -z $propagated ]]; then - propagatedUserEnvPkgs="$propagatedUserEnvPkgs $1" - fi - - break - fi - done -} - -envHooks+=(addServicePkg) - -local propagated -for pkg in $propagatedBuildInputs; do - if [[ "z$pkg" == "z@out@" ]]; then - propagated=1 - break - fi -done -if [[ -z $propagated ]]; then - propagatedBuildInputs="$propagatedBuildInputs @out@" -fi