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

Michael Witten mfwitten at gmail.com
Wed Mar 25 02:32:53 UTC 2009


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


Michael Witten <mfwitten at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #32117|0                           |1
        is obsolete|                            |
  Attachment #32118|0                           |1
        is obsolete|                            |




--- Comment #11 from Michael Witten <mfwitten gmail com>  2009-03-25 03:32:49 ---
Created an attachment (id=32379)
 --> (http://bugs.kde.org/attachment.cgi?id=32379)
Patches for kdelibs, kdebase, and kdebindings.

Sorry for getting back WAY too late on this one. I've got excuses, but who
cares... ;-)

I've attached a tarball that contains 3 pataches: kdelibs.patch, kdebase.patch,
kdebindings.patch.

The main patch is kdelibs.patch, which cleans up some cruft and adds 3 new
CMake commands: PARSE_ARGS(), ADD_PYTHON(), and INSTALL_PYTHON().

If I may boast, these are very cool and they do The Right Thing.

ADD_PYTHON() creates a target for compiling python modules (as well as whole
packages) and INSTALL_PYTHON() allows for easily installing the results.
Whereas before, there was just one always-out-of-date target to which all
compilation commands (everywhere) were appended, it is now possible to create
any number of named targets with outputs that only need to be rebuilt when
necessary. More interesting is that the handling of packages and the
preservation of relative paths might allow for a more pythonic organization of
the python source code. In short, It's Awesome.

The patches to kdebase and kdebindings simply make use of the new commands
where CURRENTLY appropriate, which---unfortunately---is not that many places:
Both kdebase and kdelibs (and probably a lot of others) handle python modules
improperly; python byte-code is specific to each version of the python
interpreter. This is why python has interpreter-specific site-packages
directories. Until many of the python modules are converted to modules that can
be properly installed in versioned site-packages directories, you can't
byte-compile the python and feel proud about it (and more importantly, you
can't make use of the shiny new commands provided by kdelibs.patch ;-) As it is
now, the misused compilation has been converted to direct installation of the
.py files only.

Because of the large additions, the patches are kind of hard to read. I
recommend applying them and then reading the affected files. The
comments/documentation are pretty darn thorough. I would particularly point
people to read about PARSE_ARGS(), which I think could be very helpful for
further cmakery.

Also, as a very small footnote that can hopefully be disregarded, I didn't
actually test my changes to kdebindings. I've compiled my qt-copy out of
source, and my guess is that kdebindings makes a lot of egregious assumptions
to the contrary (written in lurid tab-and-space-mixed perl, no less! Probably
some emacs user). Needless to say, I couldn't get kdebindings to compile and
install, but at least cmake ran and it's output looks suitable.
Furthermore---and perhaps worse---I imagine that there are many more projects
out there that will break, because I have thrown out the old PYTHON_INSTALL().
This is a good thing, for the path to the future is laid on the ruins of the
past!

-- 
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