[Kde-bindings] [Bug 174806] python stuff pretends to be installed in the system python prefix

Michael Witten mfwitten at gmail.com
Sun Mar 15 03:22:31 UTC 2009


https://bugs.kde.org/show_bug.cgi?id=174806





--- Comment #9 from Michael Witten <mfwitten gmail com>  2009-03-15 04:22:30 ---
Created an attachment (id=32118)
 --> (http://bugs.kde.org/attachment.cgi?id=32118)
This updates kdebase to make use of the changes in kdelibs, so that python
modules are handled better

PLEASE SEE MY ABOVE PATCH FOR kdelibs AS WELL. THEY BOTH APPLY TO revision
939041

I've got *2* patch that tries to make this whole enterprise as transparent as
possible.

The crux of the problem is that KDE developers like to configure
CMAKE_INSTALL_PREFIX so that it points to some directory under ${HOME}, while
python has traditinally dictated that modules be installed to a system-wide
site-packages directory. This causes a clash of permissions: `make install'
can't install to this system-wide site-packages directory without special
priveleges (for instance, `sudo make install').

For those with python>=2.6, the attached patches provides a complete fix. For
those with python<2.6 installed, the attached patches provide help via cmake
control.

Python>2.6 implements PEP 370, which provides for a per-user site-packages
directory. Here's how the patches make use of this new functionality:

If the user has configured CMAKE_INSTALL_PREFIX such that it points to a
directory that is not underneath ${HOME}, then cmake selects the system-wide
site-packages directories for installing the python modules; this behavior is
the same as it has always been.

If the user has configured CMAKE_INSTALL_PREFIX such that it points to a
directory underneath the user's ${HOME}, then cmake assumes the user is a KDE
developer and therefore intends to run `make install' without special
priveleges, so cmake asks python for a path to the user's site-packages
directory. If this succeeds, then everything is installed as expected, and the
whole process is transparent.

However, if cmake finds that python doesn't know about user-specific
site-packages directories, then cmake will message the user to explain the
situation and to offer a partial solution: The user can force a directory to be
used as the user's site-packages directory by specifying
-DPYTHON_SITE_PACKAGES_INSTALL_DIR=$some_path on the command line.

The attached patches preserve PYTHON_SITE_PACKAGES_DIR and add 2 new variables:
PYTHON_USER_SITE_PACKAGES_DIR to hold the user-specific site-packages directory
of the user configuring KDE, and PYTHON_SITE_PACKAGES_INSTALL_DIR to multiplex
between those 2 variables (it can always be overridden on the command line).

I have tested every scenario but 2: (1) systems without python and (2) systems
with python<2.6. However, I'm fairly sure the code will work perfectly ;-)

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Kde-bindings mailing list