2019-07-05 16:41:41 +01:00
|
|
|
ecmEnvHook() {
|
2017-02-26 12:49:15 +00:00
|
|
|
addToSearchPath XDG_DATA_DIRS "$1/share"
|
|
|
|
addToSearchPath XDG_CONFIG_DIRS "$1/etc/xdg"
|
2016-04-21 16:32:21 +01:00
|
|
|
}
|
2019-07-05 16:41:41 +01:00
|
|
|
addEnvHooks "$targetOffset" ecmEnvHook
|
2016-04-21 16:32:21 +01:00
|
|
|
|
2019-07-05 16:41:41 +01:00
|
|
|
ecmPostHook() {
|
2016-04-21 16:32:21 +01:00
|
|
|
# Because we need to use absolute paths here, we must set *all* the paths.
|
|
|
|
cmakeFlags+=" -DKDE_INSTALL_EXECROOTDIR=${!outputBin}"
|
|
|
|
cmakeFlags+=" -DKDE_INSTALL_BINDIR=${!outputBin}/bin"
|
|
|
|
cmakeFlags+=" -DKDE_INSTALL_SBINDIR=${!outputBin}/sbin"
|
|
|
|
cmakeFlags+=" -DKDE_INSTALL_LIBDIR=${!outputLib}/lib"
|
2019-07-05 16:41:41 +01:00
|
|
|
cmakeFlags+=" -DKDE_INSTALL_LIBEXECDIR=${!outputLib}/libexec"
|
2016-04-21 16:32:21 +01:00
|
|
|
cmakeFlags+=" -DKDE_INSTALL_CMAKEPACKAGEDIR=${!outputDev}/lib/cmake"
|
|
|
|
cmakeFlags+=" -DKDE_INSTALL_INCLUDEDIR=${!outputInclude}/include"
|
|
|
|
cmakeFlags+=" -DKDE_INSTALL_LOCALSTATEDIR=/var"
|
2016-07-30 22:16:36 +01:00
|
|
|
cmakeFlags+=" -DKDE_INSTALL_DATAROOTDIR=${!outputBin}/share"
|
|
|
|
cmakeFlags+=" -DKDE_INSTALL_DATADIR=${!outputBin}/share"
|
|
|
|
cmakeFlags+=" -DKDE_INSTALL_DOCBUNDLEDIR=${!outputBin}/share/doc/HTML"
|
|
|
|
cmakeFlags+=" -DKDE_INSTALL_KCFGDIR=${!outputBin}/share/config.kcfg"
|
|
|
|
cmakeFlags+=" -DKDE_INSTALL_KCONFUPDATEDIR=${!outputBin}/share/kconf_update"
|
|
|
|
cmakeFlags+=" -DKDE_INSTALL_KSERVICES5DIR=${!outputBin}/share/kservices5"
|
|
|
|
cmakeFlags+=" -DKDE_INSTALL_KSERVICETYPES5DIR=${!outputBin}/share/kservicetypes5"
|
|
|
|
cmakeFlags+=" -DKDE_INSTALL_KXMLGUI5DIR=${!outputBin}/share/kxmlgui5"
|
|
|
|
cmakeFlags+=" -DKDE_INSTALL_KNOTIFY5RCDIR=${!outputBin}/share/knotifications5"
|
|
|
|
cmakeFlags+=" -DKDE_INSTALL_ICONDIR=${!outputBin}/share/icons"
|
2017-05-22 19:49:07 +01:00
|
|
|
cmakeFlags+=" -DKDE_INSTALL_LOCALEDIR=${!outputLib}/share/locale"
|
2016-07-30 22:16:36 +01:00
|
|
|
cmakeFlags+=" -DKDE_INSTALL_SOUNDDIR=${!outputBin}/share/sounds"
|
|
|
|
cmakeFlags+=" -DKDE_INSTALL_TEMPLATEDIR=${!outputBin}/share/templates"
|
|
|
|
cmakeFlags+=" -DKDE_INSTALL_WALLPAPERDIR=${!outputBin}/share/wallpapers"
|
|
|
|
cmakeFlags+=" -DKDE_INSTALL_APPDIR=${!outputBin}/share/applications"
|
|
|
|
cmakeFlags+=" -DKDE_INSTALL_DESKTOPDIR=${!outputBin}/share/desktop-directories"
|
|
|
|
cmakeFlags+=" -DKDE_INSTALL_MIMEDIR=${!outputBin}/share/mime/packages"
|
|
|
|
cmakeFlags+=" -DKDE_INSTALL_METAINFODIR=${!outputBin}/share/appdata"
|
|
|
|
cmakeFlags+=" -DKDE_INSTALL_MANDIR=${!outputBin}/share/man"
|
|
|
|
cmakeFlags+=" -DKDE_INSTALL_INFODIR=${!outputBin}/share/info"
|
|
|
|
cmakeFlags+=" -DKDE_INSTALL_DBUSDIR=${!outputBin}/share/dbus-1"
|
|
|
|
cmakeFlags+=" -DKDE_INSTALL_DBUSINTERFACEDIR=${!outputBin}/share/dbus-1/interfaces"
|
|
|
|
cmakeFlags+=" -DKDE_INSTALL_DBUSSERVICEDIR=${!outputBin}/share/dbus-1/services"
|
|
|
|
cmakeFlags+=" -DKDE_INSTALL_DBUSSYSTEMSERVICEDIR=${!outputBin}/share/dbus-1/system-services"
|
|
|
|
cmakeFlags+=" -DKDE_INSTALL_SYSCONFDIR=${!outputBin}/etc"
|
|
|
|
cmakeFlags+=" -DKDE_INSTALL_CONFDIR=${!outputBin}/etc/xdg"
|
|
|
|
cmakeFlags+=" -DKDE_INSTALL_AUTOSTARTDIR=${!outputBin}/etc/xdg/autostart"
|
2017-05-15 12:44:33 +01:00
|
|
|
|
2019-11-22 08:44:39 +00:00
|
|
|
if [ -n "${qtPluginPrefix-}" ]; then
|
2017-05-15 12:44:33 +01:00
|
|
|
cmakeFlags+=" -DKDE_INSTALL_QTPLUGINDIR=${!outputBin}/$qtPluginPrefix"
|
|
|
|
cmakeFlags+=" -DKDE_INSTALL_PLUGINDIR=${!outputBin}/$qtPluginPrefix"
|
|
|
|
fi
|
|
|
|
|
2019-11-22 08:44:39 +00:00
|
|
|
if [ -n "${qtQmlPrefix-}" ]; then
|
2017-05-15 12:44:33 +01:00
|
|
|
cmakeFlags+=" -DKDE_INSTALL_QMLDIR=${!outputBin}/$qtQmlPrefix"
|
|
|
|
fi
|
2016-04-21 16:32:21 +01:00
|
|
|
}
|
2019-07-05 16:41:41 +01:00
|
|
|
postHooks+=(ecmPostHook)
|
|
|
|
|
2019-09-23 16:07:09 +01:00
|
|
|
xdgDataSubdirs=( \
|
|
|
|
"config.kcfg" "kconf_update" "kservices5" "kservicetypes5" \
|
2019-07-05 16:41:41 +01:00
|
|
|
"kxmlgui5" "knotifications5" "icons" "locale" "sounds" "templates" \
|
|
|
|
"wallpapers" "applications" "desktop-directories" "mime" "appdata" "dbus-1" \
|
|
|
|
)
|
|
|
|
|
|
|
|
ecmHostPathSeen=( )
|
|
|
|
|
|
|
|
ecmUnseenHostPath() {
|
|
|
|
for pkg in "${ecmHostPathSeen[@]}"
|
|
|
|
do
|
|
|
|
if [ "${pkg:?}" == "$1" ]
|
|
|
|
then
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
ecmHostPathSeen+=("$1")
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
ecmHostPathHook() {
|
|
|
|
ecmUnseenHostPath "$1" || return 0
|
|
|
|
|
|
|
|
local xdgConfigDir="$1/etc/xdg"
|
|
|
|
if [ -d "$xdgConfigDir" ]
|
|
|
|
then
|
|
|
|
qtWrapperArgs+=(--prefix XDG_CONFIG_DIRS : "$xdgConfigDir")
|
|
|
|
fi
|
|
|
|
|
|
|
|
for xdgDataSubdir in "${xdgDataSubdirs[@]}"
|
|
|
|
do
|
|
|
|
if [ -d "$1/share/$xdgDataSubdir" ]
|
|
|
|
then
|
|
|
|
qtWrapperArgs+=(--prefix XDG_DATA_DIRS : "$1/share")
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
local manDir="$1/man"
|
|
|
|
if [ -d "$manDir" ]
|
|
|
|
then
|
|
|
|
qtWrapperArgs+=(--prefix MANPATH : "$manDir")
|
|
|
|
fi
|
|
|
|
|
|
|
|
local infoDir="$1/info"
|
|
|
|
if [ -d "$infoDir" ]
|
|
|
|
then
|
|
|
|
qtWrapperArgs+=(--prefix INFOPATH : "$infoDir")
|
|
|
|
fi
|
2019-09-23 16:07:09 +01:00
|
|
|
|
|
|
|
if [ -d "$1/dbus-1" ]
|
|
|
|
then
|
|
|
|
propagatedUserEnvPkgs+=" $1"
|
|
|
|
fi
|
2019-07-05 16:41:41 +01:00
|
|
|
}
|
2019-09-23 16:56:42 +01:00
|
|
|
addEnvHooks "$targetOffset" ecmHostPathHook
|