This forum has been archived. All content is frozen. Please use KDE Discuss instead.

KDE services in /usr/local directory

Tags: None
(comma "," separated)
nttKDE
Registered Member
Posts
3
Karma
0
OS
Hi all,

I really really prefer to installed self-compiled KDE programs in the /usr/local directory instead of the distro-maintained /usr directory. One of these is KMyMoney4 (KMM for short). My distro is Kubuntu 10, and my KDE is 4.4.2

When I lauch KMM, it complains that KMyMoneyPlugin service not found. I
guess this is because the KDE service manager doesn't look into
/usr/local/share/kde4 directory. Is there a way to fix this problem without installing KMM into /usr?

I've googled, and look at all possible KDE configuration files, but could not locate the place where I can add additional search dir for KDE service manager. I'd appreciate any helps. THanks
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
You need to ensure that KDEDIRS is set to "/usr/:/usr/local" before KDE is started. You may be able to do this using ~/.profile or ~/.bashrc. Note that you may also need to set LD_LIBRARY_PATH to "/usr/local" to ensure newer KDE libraries are found. You may also wish to set PATH to "/usr/local:$PATH" to ensure that self compiled KDE applications are found first.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
ostroffjh
Registered Member
Posts
253
Karma
0
OS
I have a similar problem, but I want to install the svn version KMM under ~/local/. Since the distro provided KMM is already within /usr, I don't want all of KDE to see the new KDEDIRS. I've seen a suggestion to write a shell script that resets KDEDIRS, runs kbuildsycoca4, and then runs the ~/local/bin/kmymoney. This seems to be finding the correct program and libraries, but not finding the local version of the manual (in .../local/share/foc/HTML/en/kmymoney/).

So - the basic question - is it possible to have both the distro provided and a locally compiled version of the same KDE program installed in different locations on the same machine, and have scripts set up the environment to run the selected version?

Jack
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
In general, KDEDIRS should not be changed whilst KDE is running. This is why the documentation is not being found, as the help system is being spawned with the old KDEDIRS value, and doesn't know about your locally compiled KMM.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
ostroffjh
Registered Member
Posts
253
Karma
0
OS
So is it possible to have two versions of an app installed - one in /usr/ (the distro provided version) and one in /usr/local/ or /home/user/local/ (self compiled from SVN)?

It seems that simply putting both in KDEDIRS before starting KDE will let KDE find one set of resources or the other, but not selectively depending on which executable is actually run.

Related question, just for my understanding: given the above constraint, is there any effect at all of running kbuildsycoca4 while KDE is running? Is it that it will pick up new resources, but it won't change where it looks for them?
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
That is possible yes.

kbuildsycoca4 does have an effect when KDE is running. It uses the local KDEDIRS variable to determine where to look.

The problem with changing KDEDIRS is that if any files change in the directories which KDEDIRS was set to, then KDE Daemon ( kded4 ) will automatically run kbuildsycoca4 which may cause problems for the applications which are running from directories that were previously set in it.

This is because environment variables do not propagate from children to parent, but only from parent to children, and only when the child is run.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
ostroffjh
Registered Member
Posts
253
Karma
0
OS
I'm not getting the results I expect, so although it is possible something is broken, I think it more likely that I'm just not understanding exactly what it happening and I'm either missing something or doing something wrong.

My basic (distro provided) KDE is under /usr, including KMyMoney. I download the svn version of KMM and compile and install with a prefix of ~/local. It is the only KDE program in ~/local. I have a shell script which does three things:
Code: Select all
 export KDEDIRS=~/local:/usr
 kbuildsycoca4
 ~/local/bin/kmymoney

So I see no big danger for other KDE programs, since there is nothing in ~/local to confuse them or cause problems. I understand that if I run /usr/bin/kmymoney, it will see my local resources, so I plan to make a script to undo these changes, once I get this one doing what I want. The only danger I see for running ~/local/bin/kmymoney is that if the system triggers kbuildsycoca4 to run, it will lose my local resources, since it will run on its original KDEDIRS, which is /usr only. I can accept that risk.

Based on some output from KMM, I can see that it is picking up its libraries from ~/local, but even if I immediately open the manual, it opens the system version, not the local version. (I have explicitly made a change to the local version just so I can test this.)

Now that I've written all this - is the problem specifically with help:/ and all other resources are actually doing what I expect? (Unless I change an icon, I'm not sure I have an easy way to tell.)

Thanks for your patience in explaining.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
The help:/ KIO slave and KHelpCenter will be launched by klauncher or kdeinit4, so will not have the updated KDEDIRS variable. As such, the system documentation will be loaded instead.

Changing the application icon, name, etc. will work however, as the icons/names are loaded from the Sycoca, where as the documentation has to be looked up relative to paths in KDEDIRS by help:/ which is why it doesn't find the local documentation.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
ostroffjh
Registered Member
Posts
253
Karma
0
OS
Well, that explains what is happening, so thanks again for helping me understand. Am I correct that getting the local documentation found would either be impossible or would require for too much mucking with KDE internals to be worth the effort?
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
In order to have the local documentation found, you would simply need to set KDEDIRS appropriately so that the $HOME/local/ installation is listed when KDE starts up. This can be done in ~/.kde4/env/


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
ostroffjh
Registered Member
Posts
253
Karma
0
OS
I'm not sure you understand what I'm trying to do. I know I can switch between the distro and local versions of KMM by restarting KDE with the appropriate KDEDIRS for one or the other, but what I really want is to be able to run either one without having to restart KDE, and have each find it's own version of the docs.

Minor issue - I don't currently have a ~/.kde4/env. I assume it would just have a line like "KDEDIRS=$HOME/local:/usr"

(sorry for the delay - I somehow missed setting to get email when there was a new post)
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
What you are trying to achieve is in essence not possible. This is because the help:/ protocol is spawned from klauncher, which also executes other applications on behalf of applications in some cases.

klauncher is executed when the KDE session is started, and thus has the environment variables of the KDE startup procedure.

Therefore, the help center is not affected by local terminal variables, as documentation loading is done through the help:/ protocol. This causes it to load the documentation indicated by the environment variables set at KDE startup.

With regards to ~/.kde4/env, you may need to create this folder. Executable scripts placed in there will be sourced by the KDE startup procedure very early on. It could also be under ~/.kde/


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
ostroffjh
Registered Member
Posts
253
Karma
0
OS
Again - thanks for the explanation and confirmation. If I wanted to log this as a wish-list request, what would be the clearest context to put it in? What I mean is what app/component should I use in filing the bug. I know it would not likely end up a high priority.

I don't have a .kde, so it appears I don't have or need a ~/.kde4/env.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
The component to file this against would be kdeinit or klauncher. Do note however that KDE is not designed to run like this.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
ostroffjh
Registered Member
Posts
253
Karma
0
OS
I understand. That's why I plan to file it as a wish list and not a bug.


Bookmarks



Who is online

Registered users: Bing [Bot], blue_bullet, Google [Bot], rockscient, Yahoo [Bot]