By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release.

Bug 1188

Summary: Build issue: tde-guidance can not work
Product: TDE Reporter: Slávek Banko <slavek.banko>
Component: non-core programsAssignee: Timothy Pearson <kb9vqf>
Status: NEEDINFO ---    
Severity: major CC: albator78, bugwatch, darrella
Priority: P5    
Version: 3.5.13.x [Trinity]   
Hardware: All   
OS: Debian Squeeze   
Compiler Version: TDE Version String:
Application Version: Application Name:
Bug Depends on:    
Bug Blocks: 2968    
Attachments: pykdeextensions 3.5.13.2 : fix include directory for Trinity
pykdeextensions 3.5.13.2 : adds EXTRA_MODULE_DIR and PYQT_DIR variables in KCM code template

Description Slávek Banko 2012-08-27 13:31:46 CDT
Files from packages are installed into /opt/trinity/share, but files and links in /opt/trinity/bin refers to /usr/share.
Comment 1 Francois Andriot 2012-08-29 12:28:18 CDT
According to the "rules" files, many python files are copied from /opt/trinity/share/ to /usr/lib/pythonXXX/ , which is mandatory for python to find them.

Then, some of them are linked in /opt/trinity/bin to /usr/lib/pythonXX/...

This is on purpose.

What is your problem exactly ? Are the symlinks dead or not working ?
Comment 2 Slávek Banko 2012-08-29 13:34:05 CDT
In the debian package are python files installed in /opt/trinity/share/python-support. But symlinks in /opt/trinity/bin point to /usr/share/python-support ==> symlinks are unresolved.

KCM module reports errors to .xsession-errors:

Pythonize constructor -- pid = 5023
Python interpreter initialized!

Pythonize constructor -- pid = 5023
Traceback (most recent call last):
  File "/opt/trinity/share/python-support/kde-guidance-trinity/mountconfig.py", line 19, in <module>
    from qt import *
ImportError: /usr/lib/pymodules/python2.6/qt.so: undefined symbol: PyExc_NameError
Comment 3 Slávek Banko 2012-09-04 10:48:53 CDT
I tried to move folders from /opt/trinity/python-support to /usr/share/python-support. After this kde-guidance programs called from the command line works. But KCM modules still do not work. Still with the same error message - only with changed path - for example "/usr/lib/pymodules/python2.6/wineconfig.py".
Comment 4 Darrell 2013-04-13 14:37:30 CDT
Is this problem still valid?
Comment 5 Francois Andriot 2013-04-15 12:28:55 CDT
The "guidance" package, and its requirements (pykdeextensions) are hard to build.

As you found, there are 2 ways of running the guidance tools:
- As an application directly
- As a KCM module

Running as application is made possible by packaging the correct way, e.g. moving the .py files in the correct folders and/or setting environment variables such as PYTHONPATH. Apparently you've managed to make it work so no need to detail more here.

But, currently on 3.5.13.2, I have no way of making KCM work with guidance.
This is because the required hack using "EXTRA_MODULES_DIR" variable was removed, but apparently no other hack was done instead.

I will post the 2 patches I have to use in pykdeextensions 3.5.13.2 to make KCM work.
Comment 6 Francois Andriot 2013-04-15 12:30:04 CDT
Created attachment 1165 [details]
pykdeextensions 3.5.13.2 : fix include directory for Trinity
Comment 7 Francois Andriot 2013-04-15 12:39:40 CDT
Created attachment 1166 [details]
pykdeextensions 3.5.13.2 : adds EXTRA_MODULE_DIR and PYQT_DIR variables in KCM code template

The EXTRA_MODULE_DIR variable sucks, because it must be set at build time.
E.g, you must, in order:

1) patch, rebuild and reinstall pykdeextensions.

2) set variable EXTRA_MODULE_DIR, then rebuild Guidance.
E.g (adapt to your distro):
  export EXTRA_MODULE_DIR=/usr/lib/python2.6/kde-guidance
Then build and install Guidance tools.
  ./setup.py ...


The problem occurs because Guidance scripts/libraries are installed under a non-standard Python directory (/usr/lib/python2.6/kde-guidance) and Python script invoked by C++ code cannot find them by default.
(It would work without hack if we installed directory under standard directory /usr/lib/python2.6 ).

The attached patch simply adds and hard-codes the "/usr/lib/python2.6/kde-guidance" (or anything you set at build time in EXTRA_MODULES_DIR) in the C++ code generated for KCM modules.

(It also harcodes the "python-qt.so" library path because it is also in nonstandard path under some distros, but this is done automatically without environment variable)
Comment 8 Francois Andriot 2013-04-15 12:41:18 CDT
BTW removing the original hack was related to bug #999 .