@@ -4,29 +4,48 @@ _ecmSetXdgDirs() {
44 addToSearchPathOnce NIX_WRAP_XDG_CONFIG_DIRS "$1/etc/xdg"
55}
66
7−_ecmPropagateSharedData() {
8− local sharedPaths=( \
9− "config.cfg" \
10− "kconf_update" \
11− "kservices5" \
12− "kservicetypes5" \
13− "knotifications5" \
14− "applications" \
15− "desktop-directories" \
16− "mime" \
17− "dbus-1" \
18− "interfaces" \
19− "services" \
20− "system-services" )
21− for dir in ${sharedPaths[@]}; do
7+_ecmSharePaths=( \
8+ "config.cfg" \
9+ "kconf_update" \
10+ "kservices5" \
11+ "kservicetypes5" \
12+ "knotifications5" \
13+ "applications" \
14+ "desktop-directories" \
15+ "mime" \
16+ "dbus-1" \
17+ "interfaces" \
18+ "services" \
19+ "system-services" )
20+
21+_ecmPropagateNative() {
22+ for dir in ${_ecmSharePaths[@]}; do
2223 if [ -d "$1/share/$dir" ]; then
23− addToSearchPathOnce NIX_WRAP_XDG_DATA_DIRS "$1/share"
24+ propagateOnce propagatedNativeBuildInputs "$1"
25+ if [ -z "$crossConfig" ]; then
26+ propagateOnce propagatedUserEnvPkgs "$1"
27+ addToSearchPathOnce NIX_WRAP_XDG_DATA_DIRS "$1/share"
28+ fi
29+ break
30+ fi
31+ done
32+}
33+
34+envHooks+=(_ecmSetXdgDirs _ecmPropagate)
35+
36+_ecmPropagate() {
37+ for dir in ${_ecmSharePaths[@]}; do
38+ if [ -d "$1/share/$dir" ]; then
39+ propagateOnce propagatedBuildInputs "$1"
2440 propagateOnce propagatedUserEnvPkgs "$1"
41+ addToSearchPathOnce NIX_WRAP_XDG_DATA_DIRS "$1/share"
2542 break
2643 fi
2744 done
2845}
2946
47+crossEnvHooks+=(_ecmPropagate)
48+
3049_ecmConfig() {
3150 # Because we need to use absolute paths here, we must set *all* the paths.
3251 cmakeFlags+=" -DKDE_INSTALL_EXECROOTDIR=${!outputBin}"
@@ -70,5 +89,4 @@ _ecmConfig() {
7089 cmakeFlags+=" -DKDE_INSTALL_AUTOSTARTDIR=${!outputLib}/etc/xdg/autostart"
7190}
7291
73−envHooks+=(_ecmSetXdgDirs _ecmPropagateSharedData)
7492preConfigureHooks+=(_ecmConfig)