KDE changes

Moritz Heiber moe at lunar-linux.org
Tue May 16 22:23:45 UTC 2006


Florin,

I just commited an update to arts. I finally fixes the issues that
there are with KDE modules using arbitary paths. Here's a short
overview over the changes and why I made them. I strongly recommend you
apply them to ALL KDE modules. I would do it myself but I have no means
of testing my changes (no KDE installed). If you have any question then
please ask.

Here we go:

-  export  PATH=${QT_PREFIX:-$QTDIR}/bin:$PATH
-  export  LD_LIBRARY_PATH=${QT_PREFIX:-$QTDIR}/lib
-  export  KDE_PREFIX=${KDE_PREFIX:-/opt/lunar/kde/3}
+
+  # Needed for KDE apps to see QT
+  . /etc/profile.d/qt3.rc

Pretty simple. All of the above values are defined inside qt3.rc which
is installed alongside qt3. Notice that do NOT honor QT_PREFIX here
since that should be entirely reserved for the qt3/4 modules. QTDIR
does it just fine and we KNOW that it is defined.

Also, for any other module than arts you MUST source kde3.rc installed
by arts too. A full changelog for any other module should look like
this:

-  export  PATH=${QT_PREFIX:-$QTDIR}/bin:$PATH
-  export  LD_LIBRARY_PATH=${QT_PREFIX:-$QTDIR}/lib
-  export  KDE_PREFIX=${KDE_PREFIX:-/opt/lunar/kde/3}
+
+  # Needed for KDE apps to see QT
+  . /etc/profile.d/qt3.rc
+  . /etc/profile.d/kde3.rc

Note: '.' and 'source' have the same functionality. They both "source"
a bash file .. much like C's include statements. Basicly, you're
telling bash to include qt3.rc and kde3.rc (which defines important
values for our compile process).

-  ./configure  --prefix=${KDE_PREFIX:-$KDEDIR}     \
-               --with-qt-dir=${QT_PREFIX:-$QTDIR}  \
-               --enable-final                      \
-               --disable-debug                     \
-               --with-xinerama                     \
-               $OPTS                              &&
+  OPTS="--with-qt-dir=${QTDIR} --enable-final --disable-debug
--with-xinerama $OPTS" && 
-  default_make
+  default_build &&

Okay, this goes along with the modifications I made to the DETAILS file:

+   MODULE_PREFIX=${KDE_PREFIX:-/opt/lunar/kde/3}

MODULE_PREFIX is set inside DETAILS and is automatically set as the
prefix if default_build is run. Thus we do it that way. Any other
optional configure flag can be passed as OPTS. This is how it should be
done .. I know, GNOME and Xfce both don't do it that way yet. But this
is efficient and flexible.

Now, this is the "official" part which should be applied to _EVERY_ KDE
module. That way we will get rid of the usual "Login to make changes in
your PATH take effect" deadlocks. I'm pretty sure this will even get
every user to install kde3 by just using 'lin kde3'.

And here we go for the 'arts'-specific changes (those only apply to the
arts module):

-  if ! grep -q "${KDE_PREFIX}/lib" /etc/ld.so.conf; then
-    echo "${KDE_PREFIX}/lib" >> /etc/ld.so.conf  
-  fi 
+  if ! grep -q "${MODULE_PREFIX}/lib" /etc/ld.so.conf; then
+    echo "${MODULE_PREFIX}/lib" >> /etc/ld.so.conf  
+  fi &&
 
-  if ! grep -q "${KDE_PREFIX}/lib/kde3" /etc/ld.so.conf; then
-    echo "${KDE_PREFIX}/lib/kde3" >> /etc/ld.so.conf
-  fi

I made that part honor $MODULE_PREFIX. Also, you don't need lib/ and
lib/kde3 both inside ld.so.conf .. ldconfig looks into any
subdirectories under lib/.

+  mkdir -p ${MODULE_PREFIX}/lib/pkgconfig &&

-  mkdir -p ${KDE_PREFIX:-$KDEDIR}/lib/pkgconfig

Same here. Use $MODULE_PREFIX.

+  echo "export KDEDIR=\"${MODULE_PREFIX}\"" >>
$SOURCE_DIRECTORY/kde3.rc &&
+  echo export PATH=\"'${KDEDIR}'/bin:'$PATH'\" >>
$SOURCE_DIRECTORY/kde3.rc &&
+  echo export PKG_CONFIG_PATH=
\"'${KDEDIR}'/lib/pkgconfig:'$PKG_CONFIG_PATH'\" >>
$SOURCE_DIRECTORY/kde3.rc && 
-  echo "export KDEDIR=$KDE_PREFIX" > /etc/profile.d/kde3.rc
-  echo "export PATH=\$KDEDIR/bin:\$PATH" >> /etc/profile.d/kde3.rc
-  echo "export PKG_CONFIG_PATH=$KDEDIR/lib/pkgconfig:\
$PKG_CONFIG_PATH" >> /etc/profile.d/kde3.rc
+  install -m644 $SOURCE_DIRECTORY/kde3.rc /etc/profile.d/

Now, these are the same changes I did to the qt modules. It makes
installwatch track the rc files too so we can actually change them.
Notice how I make use of $MODULE_PREFIX and _NOT_ $KDE_PREFIX.
$MODULE_PREFIX is the way to go .. anything else is redundant and
should be discarded. Anyhow, what you get is an rc file that is tracked
and set up properly.

I've tested my changes to arts. All of the prefixes are retained, the
rc file is installed properly and all the paths are picked up right.
These changes finally will make path problems be a thing of the past.

As I said before .. I'd do it myself but I don't have the means to test
my changes .. and I'm lazy :p

If you have any questions .. fire away!

Regards,

Moritz

PS: Auke, I want a cookie!


More information about the Lunar-dev mailing list