summaryrefslogtreecommitdiff
blob: f23dc0230e1c86a29e8f146c6086d6a82a6a271d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
diff -Naur kdebase-startkde-4.2.0-orig/startkde.cmake kdebase-startkde-4.2.0/startkde.cmake
--- kdebase-startkde-4.2.0-orig/startkde.cmake	2009-01-17 05:00:28.000000000 -0600
+++ kdebase-startkde-4.2.0/startkde.cmake	2009-02-21 12:52:02.000000000 -0600
@@ -7,6 +7,35 @@
 # because we still need to do some cleanup.
 trap 'echo GOT SIGHUP' HUP
 
+_KDEDIR=@GENTOO_PORTAGE_EPREFIX@@REPLACE_PREFIX@
+if [ "$_KDEDIR" != "@GENTOO_PORTAGE_EPREFIX@/usr" ]; then
+	export PATH=${_KDEDIR}/bin:$(echo ${PATH} | sed 's/$/:/g;s#@GENTOO_PORTAGE_EPREFIX@/usr/kde/[^/]*/s\?bin/\?:##g;s/:$//g')
+	export ROOTPATH=${_KDEDIR}/sbin:${_KDEDIR}/bin:$(echo ${PATH} | sed 's/$/:/g;s#@GENTOO_PORTAGE_EPREFIX@/usr/kde/[^/]*/s\?bin/\?:##g;s/:$//g')
+fi
+@REPLACE_LDPATH@
+export STRIGI_PLUGIN_PATH="${_KDEDIR}/@REPLACE_LIBDIR@/strigi:${STRIGI_PLUGIN_PATH}"
+export XDG_DATA_DIRS=${_KDEDIR}/share:$(echo ${XDG_DATA_DIRS} | sed 's/$/:/g;s#@GENTOO_PORTAGE_EPREFIX@/usr/kde/[^/]*/share/\?:##g;s/:$//g')
+
+if [ -z "$HOME" ]; then
+	xmessage "HOME is unset. Your user config seems to be broken. Aborting."
+	exit 1
+fi
+
+# Gentoo: handle the possible home directory layout for config directory
+# Note that we change the default KDEHOME in kdelibs to .kde4 or .kde${SLOT}
+# for -kdeprefix and +kdeprefix respectively.
+if [ "${_KDEDIR}" = "@GENTOO_PORTAGE_EPREFIX@/usr" ]; then
+	# If the directory doesn't exist make it
+	[ -e "${HOME}/.kde4" ] || mkdir "$HOME/.kde4"
+else
+	# Use multiple directories based upon the KDE directory
+	[ -e "$HOME/.kde$(basename $_KDEDIR)" ] || mkdir "$HOME/.kde$(basename $_KDEDIR)"
+	if [ ! -d "$HOME/.kde$(basename $_KDEDIR)" ]; then
+		xmessage "$HOME/.kde$(basename $_KDEDIR) exists but is not a dir. Aborting."
+		exit 1
+	fi
+fi
+
 # Check if a KDE session already is running and whether it's possible to connect to X
 kcheckrunning
 kcheckrunning_result=$?
@@ -214,6 +243,13 @@
   done
 done
 
+# Gentoo part for FHS installs
+if [ "${_KDEDIR}" = "@GENTOO_PORTAGE_EPREFIX@/usr" ]; then
+  for file in "@GENTOO_PORTAGE_EPREFIX@/etc/kde/startup/"*.sh; do
+    test -r "${file}" && . "${file}"
+  done
+fi
+
 # Set the path for Qt plugins provided by KDE
 if test -n "$QT_PLUGIN_PATH"; then
   QT_PLUGIN_PATH="$QT_PLUGIN_PATH:`kde4-config --path qtplugins`"
@@ -427,6 +463,13 @@
   done
 done
 
+# Gentoo part for FHS installs
+if [ "${_KDEDIR}" = "@GENTOO_PORTAGE_EPREFIX@/usr" ]; then
+  for file in "@GENTOO_PORTAGE_EPREFIX@/etc/kde/shutdown/"*.sh; do
+    test -r "${file}" && . "${file}"
+  done
+fi
+
 unset KDE_FULL_SESSION
 xprop -root -remove KDE_FULL_SESSION
 unset KDE_SESSION_VERSION