-
-
Notifications
You must be signed in to change notification settings - Fork 11.3k
help needed: Updating pyqt to 4.11.1 #30881
Conversation
fname = os.environ["QMAKESPEC"] | ||
|
||
- if not os.path.dirname(fname): | ||
+ if not os.path.dirname(fname) or fname.startswith('unsupported'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least this line is already included upstream in 4.11.1
Where this came up downstream: http://answers.ros.org/question/186630/indigo-rqt_image_view-depends-on-build_isolated/?answer=186648#post-id-186648 |
The problem seems to stem from first running
Does anyone have insight in whether this still applies? |
- the custom QMAKESPEC hacks for Mavericks seem to not be needed any longer - creating the `pyconfig.py` file by running `python configure.py` in a different folder seems to work, but I am not sure if this is actually still needed, so for now I commented this out. I have sucessfully built and used PyQWT even without this generated `pyqtconfig.py`. It's use is deprecated anyway it seems. I don't know if not having it breaks other stuff, which is why I left the code in the formula for now, albeit commented out.
I have a working formula. Can someone test if it builds on lion and mountain lion? I have these notes on the changes to the formula:
|
|
Fixed. I need to remember to run |
@NikolausDemmel wrote:
Please do not remove or comment-out the generation of The solution here is to work upstream with Phil Thompson to get the missing bits into Good thinking to just configure to a separate directory with |
Thanks for explaining the need for |
if ENV.compiler == :clang and MacOS.version >= :mavericks | ||
ENV.append "QMAKESPEC", "unsupported/macx-clang-libc++" | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the custom qt makespec since on my system it seems to compile fine with libc++; this however is with configure-ng.py; @dakcarto, do you believe the custom makespec is still needed such that the generated pyqtconfig.py is generated correctly? Do you have a way of testing it, maybe with QGIS?
(lib/"python#{version}/site-packages/PyQt4").install "pyqtconfig.py" | ||
end | ||
ensure | ||
remove_entry_secure dir | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just make a subdirectory in the existing build tree rather than create a separate tmpdir?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess yes. Do you have a ruby snippet to copy everything to subdirectory (excluding the subdirectory)?
@jensenb: It seems you originally introduced the patch concerning the macro parsing. Do you have any insight if the custom makespec is still needed (it seems qt now defaults to clang+libc++ on mavericks), and without it, is this patch still needed? |
Maybe setting the
|
Whatever we decide to do here can we please add comments to every patch explaining why it's needed and where it has been submitted upstream? @dakcarto can you confirm that for the patch you need too? |
The main rational behind the macro parsing was discussed #25225 . I also submitted the issue upstream http://www.riverbankcomputing.com/pipermail/pyqt/2013-December/033537.html , but it seems only the first part of the patch has since been adopted upstream. The second part involving the stripping of the comments from the variables (for example here: https://github.com/mirror/qt/blob/4.8/mkspecs/unsupported/macx-clang-libc%2B%2B/qmake.conf) isn't necessary for building pyqt per se. It does however affect downstream projects that rely on the I am not sure if you still need to set the QMAKESPEC by hand, if I recall correctly pyqt defaults to gcc if not configured otherwise, but I need to reverify this. |
@jensenb Any bits that weren't accepted upstream should be refactored into using |
@MikeMcQuaid: is the |
@NikolausDemmel the |
yup both configure.py: 1823 if "QMAKESPEC" in list(os.environ.keys()):
fname = os.environ["QMAKESPEC"]
if not os.path.dirname(fname) or fname.startswith("unsupported"):
qt_macx_spec = fname
fname = os.path.join(qt_archdatadir, "mkspecs", fname)
elif sys.platform == "darwin":
# The Qt Mac binary installer defaults to xcode which we don't want.
# Use Qt5's macx-clang if it is available, otherwise fall back to
# macx-g++.
fname = os.path.join(qt_archdatadir, "mkspecs", "macx-clang")
if os.path.isdir(fname):
qt_macx_spec = "macx-clang"
else:
fname = os.path.join(qt_archdatadir, "mkspecs", "macx-g++")
qt_macx_spec = "macx-g++" configure-ng.py:2319 if spec == '':
# We only bother about Linux and OS/X.
if target_config.py_platform.startswith('linux'):
spec = 'linux-g++'
elif target_config.py_platform == 'darwin':
# It doesn't matter if the default was actually clang.
spec = 'macx-g++' Set explicitly setting the mkspec is still necessary. I am not sure what to do about the missing patch section upstream. I could write him again, maybe he didn't understand what it was for, and like I mentioned above, the errors only manifest themselves in further downstream projects that rely on pyqtconfig.py. But for the time being the patch is still necessary. |
@jensenb If it wasn't accepted upstream then we should remove it. It's not Homebrew's job to fix things up that upstream won't, I'm afraid. |
@MikeMcQuaid: I have to disagree here. IMHO it's homebrew's job to do its best to provide working packages on OSX. If the maintainers of some package fails to understand the necessity for a patch or it gets lost upstream in some issue tracker for poorly maintained software, that does not sound like a good reason to intentionally break things for our users by removing an already included and working patch. There is only so much time people have to poke maintainers upstream. |
I will contact Phil and at least see what the reason was for not accepting the patch in its entirety. |
@jensenb Thanks. |
I stand corrected, the remaining patch hunk is no longer needed either. It seems the functionality has been included after all, just not in PyQt directly, instead it has been added to SIP: http://www.riverbankcomputing.co.uk/hg/sip/rev/044852da62d4 and officially released in SIP 4.16. So just make sure that |
…re.py / configure-ng.py
Thanks @jensenb, I removed the patch. If someone can point out to me how to best copy the contents of a directory to a subdirectory (without that subdirectory itself) in ideomatic ruby then I can do the change that @jacknagel suggested. If it looks good after that I can squash and rebase. |
Any further comments on the current state of this PR? It passes tests and seems to work for me. Is this ready to be merged if I squash and rebase? |
# temporary directory and only retain the pyqtconfig.py from that. | ||
|
||
require "tmpdir" | ||
dir = Dir.mktmpdir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be done in a subdirectory of the current buildpath instead of a new temporary directory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can someone point out to me how to best copy the contents of a directory to a subdirectory (without that subdirectory itself) in ideomatic ruby?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, nevermind then; I didn't read what the code was doing very carefully.
Looks good to me. @jensenb any objections? |
Looks good to me. |
Thanks Mike. |
@NikolausDemmel Thanks for taking the time to work through this update. |
Unfortunately this fails to compile (on Mavericks) with the following linker error: http://pastebin.com/rWmepPhu
Possibly this is related to Homebrew building with the custom libc++ makespec.
Any ideas?