Merge branch 'kde-propagate'

This commit is contained in:
Thomas Tuegel 2016-06-09 12:40:04 -05:00
commit 04ad2ebfb2
4 changed files with 67 additions and 21 deletions

View File

@ -170,7 +170,9 @@ in
services.xserver.displayManager.sddm = { services.xserver.displayManager.sddm = {
theme = "breeze"; theme = "breeze";
themes = [ themes = [
kde5.extra-cmake-modules # for the setup-hook
kde5.plasma-workspace kde5.plasma-workspace
kde5.breeze-icons
(kde5.oxygen-icons or kde5.oxygen-icons5) (kde5.oxygen-icons or kde5.oxygen-icons5)
]; ];
}; };

View File

@ -68,14 +68,19 @@ in
stdenv.mkDerivation { stdenv.mkDerivation {
name = "sddm-${version}"; name = "sddm-${version}";
phases = "installPhase";
nativeBuildInputs = [ lndir makeQtWrapper ]; nativeBuildInputs = [ lndir makeQtWrapper ];
buildInputs = [ unwrapped ] ++ themes; buildInputs = [ unwrapped ] ++ themes;
themes = map (pkg: pkg.out or pkg) themes; themes = map (pkg: pkg.out or pkg) themes;
inherit unwrapped; inherit unwrapped;
unpackPhase = "true";
configurePhase = "runHook preConfigure; runHook postConfigure";
buildPhase = "runHook preBuild; runHook postBuild";
installPhase = '' installPhase = ''
runHook preInstall
makeQtWrapper "$unwrapped/bin/sddm" "$out/bin/sddm" makeQtWrapper "$unwrapped/bin/sddm" "$out/bin/sddm"
mkdir -p "$out/share/sddm" mkdir -p "$out/share/sddm"
@ -85,6 +90,8 @@ stdenv.mkDerivation {
lndir -silent "$sddmDir" "$out/share/sddm" lndir -silent "$sddmDir" "$out/share/sddm"
fi fi
done done
runHook postInstall
''; '';
inherit (unwrapped) meta; inherit (unwrapped) meta;

View File

@ -4,8 +4,7 @@ _ecmSetXdgDirs() {
addToSearchPathOnce NIX_WRAP_XDG_CONFIG_DIRS "$1/etc/xdg" addToSearchPathOnce NIX_WRAP_XDG_CONFIG_DIRS "$1/etc/xdg"
} }
_ecmPropagateSharedData() { _ecmSharePaths=( \
local sharedPaths=( \
"config.cfg" \ "config.cfg" \
"kconf_update" \ "kconf_update" \
"kservices5" \ "kservices5" \
@ -18,15 +17,35 @@ _ecmPropagateSharedData() {
"interfaces" \ "interfaces" \
"services" \ "services" \
"system-services" ) "system-services" )
for dir in ${sharedPaths[@]}; do
_ecmPropagateNative() {
for dir in ${_ecmSharePaths[@]}; do
if [ -d "$1/share/$dir" ]; then if [ -d "$1/share/$dir" ]; then
addToSearchPathOnce NIX_WRAP_XDG_DATA_DIRS "$1/share" propagateOnce propagatedNativeBuildInputs "$1"
if [ -z "$crossConfig" ]; then
propagateOnce propagatedUserEnvPkgs "$1" propagateOnce propagatedUserEnvPkgs "$1"
addToSearchPathOnce NIX_WRAP_XDG_DATA_DIRS "$1/share"
fi
break break
fi fi
done done
} }
envHooks+=(_ecmSetXdgDirs _ecmPropagate)
_ecmPropagate() {
for dir in ${_ecmSharePaths[@]}; do
if [ -d "$1/share/$dir" ]; then
propagateOnce propagatedBuildInputs "$1"
propagateOnce propagatedUserEnvPkgs "$1"
addToSearchPathOnce NIX_WRAP_XDG_DATA_DIRS "$1/share"
break
fi
done
}
crossEnvHooks+=(_ecmPropagate)
_ecmConfig() { _ecmConfig() {
# Because we need to use absolute paths here, we must set *all* the paths. # Because we need to use absolute paths here, we must set *all* the paths.
cmakeFlags+=" -DKDE_INSTALL_EXECROOTDIR=${!outputBin}" cmakeFlags+=" -DKDE_INSTALL_EXECROOTDIR=${!outputBin}"
@ -70,5 +89,4 @@ _ecmConfig() {
cmakeFlags+=" -DKDE_INSTALL_AUTOSTARTDIR=${!outputLib}/etc/xdg/autostart" cmakeFlags+=" -DKDE_INSTALL_AUTOSTARTDIR=${!outputLib}/etc/xdg/autostart"
} }
envHooks+=(_ecmSetXdgDirs _ecmPropagateSharedData)
preConfigureHooks+=(_ecmConfig) preConfigureHooks+=(_ecmConfig)

View File

@ -24,7 +24,7 @@ propagateOnce() {
addToSearchPathOnceWithCustomDelimiter ' ' "$@" addToSearchPathOnceWithCustomDelimiter ' ' "$@"
} }
_qtPropagateRuntimeDependencies() { _qtPropagate() {
for dir in "lib/qt5/plugins" "lib/qt5/qml" "lib/qt5/imports"; do for dir in "lib/qt5/plugins" "lib/qt5/qml" "lib/qt5/imports"; do
if [ -d "$1/$dir" ]; then if [ -d "$1/$dir" ]; then
propagateOnce propagatedBuildInputs "$1" propagateOnce propagatedBuildInputs "$1"
@ -37,7 +37,26 @@ _qtPropagateRuntimeDependencies() {
addToSearchPathOnce QML2_IMPORT_PATH "$1/lib/qt5/qml" 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"
if [ -z "$crossConfig" ]; then
propagateOnce propagatedUserEnvPkgs "$1"
fi
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() { _qtMultioutDevs() {
# This is necessary whether the package is a Qt module or not # This is necessary whether the package is a Qt module or not