Review Request 119302: Make FindPyQt4 work with PyQt's new build system.
Raphael Kubo da Costa
rakuco at FreeBSD.org
Wed Jul 16 14:23:08 BST 2014
> On July 16, 2014, 4:42 a.m., Scott Kitterman wrote:
> > This is the method used in qscintilla2's configure.py (which upstream has generally endorsed):
> >
> > #! /usr/bin/python
> >
> > import sys
> > import os
> >
> > if sys.platform == 'win32':
> > data_dir = sys.prefix
> > else:
> > data_dir = sys.prefix + '/share'
> >
> > py_sip_dir = os.path.join(data_dir, 'sip')
> >
> > # Note: Set this by hand since the logic to figure out if we're using PyQt4 or
> > # PyQt5 isn't relevant to the question (QScintilla does do this, but it's not
> > # germane).
> > pyqt = 'PyQt4'
> >
> > if pyqt is not None:
> > pyqt_sip_dir = os.path.join(py_sip_dir, pyqt)
> > else:
> > pyqt_sip_dir = None
> >
> > print(pyqt_sip_dir)
> > # prints /usr/share/sip/PyQt4
> >
> > We should use something similar.
>
> Scott Kitterman wrote:
> So markdown and python code comments don't mix. The bolded things all have a leading '#'.
>
> Luca Beltrame wrote:
> Good idea. Can this be done?
>
> Raphael Kubo da Costa wrote:
> I did look at QScintilla's build system when writing my patch, but chose not to follow this path: doing this only works for the default values (`sys.prefix/sip` on Windows, `sys.prefix/share/sip` elsewhere), which in the worst case can be a different installation unrelated to the one used by the PyQt version we're using. I didn't see much value in just working out of the box in some specific cases.
>
> Scott Kitterman wrote:
> I think working out of the box in the standard, default case using the upstream recommended method is much better than requiring the value to be set by hand in all cases. This change set is about adjusting to the new upstream approach to things, so using the upstream recommended solution seems only logical.
>
> If this doesn't get included upstream, I'll add it as a distro patch for Debian/Kubuntu as I think it's definitely a superior approach.
> I think working out of the box in the standard, default case using the upstream recommended method is much better than requiring the value to be set by hand in all cases. This change set is about adjusting to the new upstream approach to things, so using the upstream recommended solution seems only logical.
*shrug* Done in patch v2.
> If this doesn't get included upstream, I'll add it as a distro patch for Debian/Kubuntu
... ok?
- Raphael
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/119302/#review62457
-----------------------------------------------------------
On July 16, 2014, 4:21 p.m., Raphael Kubo da Costa wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/119302/
> -----------------------------------------------------------
>
> (Updated July 16, 2014, 4:21 p.m.)
>
>
> Review request for kdelibs, Alex Merry, Luca Beltrame, and Simon Edwards.
>
>
> Bugs: 337462
> http://bugs.kde.org/show_bug.cgi?id=337462
>
>
> Repository: kdelibs
>
>
> Description
> -------
>
> Since PyQt 4.10, PyQt.pyqtconfig is deprecated and not available unless
> PyQt is built using the old configure script.
>
> There is no direct replacement for it, as PyQt's new build system does
> not provide as much information as before by design. Luckily, most of
> the variables we are interested in can be obtained from PyQt's QtCore
> module itself even if its old build system is used.
>
> The only exception is pyqt_sip_dir, which cannot be determined at all if
> pyqtconfig is not available. In this case, the most we can do is guess
> the default path like QScintilla2 does, and fail if it does not exist.
> The user then needs to specify it manually via CMake with something like
> -DPYQT4_SIP_DIR=/usr/share/sip/PyQt4. To this effect, all variables set
> by FindPyQt4.cmake have been made cache variables, which means their
> values can be overriden by the user, thus ignoring the contents read via
> FindPyQt.py.
>
>
> Diffs
> -----
>
> cmake/modules/FindPyQt.py 5d2f9514d87553d5a16a95943618572316c92861
> cmake/modules/FindPyQt4.cmake b176b4f8cfee471a1b7aecdd2723d165b0496a85
>
> Diff: https://git.reviewboard.kde.org/r/119302/diff/
>
>
> Testing
> -------
>
> I was able to make Kate find PyQt by passing `-DPYQT4_SIP_DIR=<...>` with my PyQt installation without `pyqtconfig.py`, and calling `FindPyQt.py` by hand on a Debian system with `pyqtconfig.py` worked as before.
>
>
> Thanks,
>
> Raphael Kubo da Costa
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20140716/bab3003a/attachment.htm>
More information about the kde-core-devel
mailing list