Opened 7 years ago

Closed 7 years ago

#35506 closed defect (fixed)

py27-pyqt4 @4.9.1 Failed to install

Reported by: sahaimic@… Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version: 2.1.2
Keywords: Cc: nij2003@…
Port: py27-pyqt4

Description (last modified by mf2k (Frank Schima))

After installing python 27 with macports and qt4-mac, the installation of pyqt fails. All ports should be up-to-date as I called selfupdate before starting the installation. I am using Xcode 3.2.6 on MacOs10.6.8. From the log file it seems that the first error is a failure to fetch a file from the archive:

":msg:archivefetch --->  Attempting to fetch py27-pyqt4-4.9.1_0.darwin_10.x86_64.tbz2 from http://packages.macports.org/py27-pyqt4
:debug:archivefetch Fetching archive failed:: The requested URL returned error: 404"

I attach the log file.

Any help would be appreciated.

Thanks

Attachments (1)

main.log (44.7 KB) - added by sahaimic@… 7 years ago.
Log file

Download all attachments as: .zip

Change History (22)

Changed 7 years ago by sahaimic@…

Attachment: main.log added

Log file

comment:1 Changed 7 years ago by mf2k (Frank Schima)

Description: modified (diff)
Keywords: pyqt4 removed
Owner: changed from macports-tickets@… to michaelld@…

In the future, please Cc the port maintainer(s).

The fetch failing is not the error. Fortunately you attached the log with the actual error.

comment:2 in reply to:  1 Changed 7 years ago by sahaimic@…

Replying to macsforever2000@…:

In the future, please Cc the port maintainer(s).

The fetch failing is not the error. Fortunately you attached the log with the actual error.

Hi, this is the first time using Macports so I'm sorry if I made mistakes in logging the ticket. Any help in understanding the error and how to get around it would be appreciated.

Thanks.

comment:3 Changed 7 years ago by sahaimic@…

Cc: sahaimic@… added

Cc Me!

comment:4 Changed 7 years ago by michaelld (Michael Dickens)

You did the right things; I think we're pretty busy getting everything working with 10.8. The actual issue is:

:debug:configure Executing command line:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_python_py-pyqt4/py27-pyqt4/work/PyQt-mac-gpl-4.9.1" && /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 configure.py -q /opt/local/bin/qmake --verbose --confirm-license -e QtGui -e QtHelp -e QtMultimedia -e QtNetwork -e QtDeclarative -e QtOpenGL -e QtScript -e QtScriptTools -e QtSql -e QtSvg -e QtTest -e QtWebKit -e QtXml -e QtXmlPatterns -e QAxContainer --no-qsci-api -e QtDesigner LFLAGS="-F/opt/local/Library/Frameworks -L/opt/local/lib" 
:info:configure Error: Failed to determine the layout of your Qt installation. Try again using

which says that PyQt's 'configure' script isn't detecting Qt correctly for some reason. Can you verify that "/opt/local/bin/qmake" exists? Hopefully I'll get far enough along on my 10.8 qt4-mac to be able to help more soon on this ticket, but let's start with the above.

comment:5 in reply to:  4 Changed 7 years ago by sahaimic@…

Replying to michaelld@…:

You did the right things; I think we're pretty busy getting everything working with 10.8. The actual issue is:

:debug:configure Executing command line:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_python_py-pyqt4/py27-pyqt4/work/PyQt-mac-gpl-4.9.1" && /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 configure.py -q /opt/local/bin/qmake --verbose --confirm-license -e QtGui -e QtHelp -e QtMultimedia -e QtNetwork -e QtDeclarative -e QtOpenGL -e QtScript -e QtScriptTools -e QtSql -e QtSvg -e QtTest -e QtWebKit -e QtXml -e QtXmlPatterns -e QAxContainer --no-qsci-api -e QtDesigner LFLAGS="-F/opt/local/Library/Frameworks -L/opt/local/lib" 
:info:configure Error: Failed to determine the layout of your Qt installation. Try again using

which says that PyQt's 'configure' script isn't detecting Qt correctly for some reason. Can you verify that "/opt/local/bin/qmake" exists? Hopefully I'll get far enough along on my 10.8 qt4-mac to be able to help more soon on this ticket, but let's start with the above.

Hi, Thanks! Yes "/opt/local/bin/qmake" does indeed exist.

comment:6 Changed 7 years ago by michaelld (Michael Dickens)

Ah; you're using "qt4-mac +framework" ... that might make a difference. Do you really need Qt installed as Frameworks? If not, you might consider not using that variant. That said, let me install that variant & see what happens.

comment:7 Changed 7 years ago by sahaimic@…

Cc: sahaimic@… removed

Cc Me!

comment:8 in reply to:  6 Changed 7 years ago by sahaimic@…

Replying to michaelld@…:

Ah; you're using "qt4-mac +framework" ... that might make a difference. Do you really need Qt installed as Frameworks? If not, you might consider not using that variant. That said, let me install that variant & see what happens.

Hi. Unfortunately not so easy as I do require +Frameworks with Qt for the end program installation (Openstructure -> http://www.openstructure.org/docs/1.2/install/)

comment:9 Changed 7 years ago by michaelld (Michael Dickens)

OK; no problems; just thought it was worth asking. I'm building the +framework variant right now and will use it to work through PyQt4's issues once I get there. !@#$ Qt takes forever t build ...

comment:10 in reply to:  9 Changed 7 years ago by sahaimic@…

Replying to michaelld@…:

OK; no problems; just thought it was worth asking. I'm building the +framework variant right now and will use it to work through PyQt4's issues once I get there. !@#$ Qt takes forever t build ...

LOL

comment:11 Changed 7 years ago by michaelld (Michael Dickens)

It's finally built, and I can recreate your issue. Now, how to solve it ... hmmmm.

comment:12 in reply to:  11 Changed 7 years ago by sahaimic@…

Would it help to see the set of commands I tried to execute before the problem arose? Here are the steps:

  1. Install macports
  2. Install python: sudo port install python27

sudo port install python_select sudo port select --set python python27

  1. Install eigen: sudo port install eigen
  2. Install numpy and matplotlib: sudo port install py27-numpy py27-matplotlib
  3. Install scipy: sudo port install py27-scipy
  4. Install boost, linked to your python: sudo port install boost +python27
  5. Install qt4-mac and PyQt: sudo port install qt4-mac +framework py27-pyqt4 +phonon +scintilla <----- macports failed here.....
  6. Install remaining libraries: sudo port install tiff fftw-3-single libpng

comment:13 Changed 7 years ago by michaelld (Michael Dickens)

I know where the issue is in my patches to QMake's code; it's just a matter of tweaking it to work. But, thanks for thinking of that; sometimes it does work!

comment:14 Changed 7 years ago by michaelld (Michael Dickens)

BTW> This is related to the non-OP's issue found in ticket #34864; just for completeness. I fixed the OP's issue, and asked that they open another ticket for the framework issue. But, this ticket now covers that issue, so no new ticket is necessary.

comment:15 in reply to:  14 Changed 7 years ago by sahaimic@…

Replying to michaelld@…:

BTW> This is related to the non-OP's issue found in ticket #34864; just for completeness. I fixed the OP's issue, and asked that they open another ticket for the framework issue. But, this ticket now covers that issue, so no new ticket is necessary.

Oh ok. Thanks!

comment:16 Changed 7 years ago by michaelld (Michael Dickens)

The issue is with QMake; here's the patch, which you can apply to ${prefix}/share/qt4/... to test out if you want; I'm compiling PyQt4 right now using Qt+framework; we'll see if this is all that's required.

--- mkspecs/common/mac.conf.orig	2012-08-14 15:49:12.000000000 -0400
+++ mkspecs/common/mac.conf	2012-08-14 15:49:25.000000000 -0400
@@ -9,6 +9,7 @@
 QMAKE_LIBDIR		=
 QMAKE_INCDIR_QT		= $$[QT_INSTALL_HEADERS]
 QMAKE_LIBDIR_QT		= $$[QT_INSTALL_LIBS]
+QMAKE_FRAMEWORKDIR_QT	= $$[QT_INSTALL_FRAMEWORKS]
 QMAKE_INCDIR_OPENGL	= /System/Library/Frameworks/OpenGL.framework/Headers \
 	/System/Library/Frameworks/AGL.framework/Headers/
 

comment:17 Changed 7 years ago by michaelld (Michael Dickens)

Nope; but it's a start. I think PyQt4's configure script isn't "doing the right thing" with frameworks. I'll keep hacking ...

comment:18 Changed 7 years ago by michaelld (Michael Dickens)

So, I don't know how to fix this yet, but here's the issue at hand. I'm partly writing this to notify others on this ticket of what's going on, and partly to keep a reminder for myself in case I have to do something else for a while & come back to this later. I hope to hack through this in the next couple of days, but you never know ... :)

With the release of qt4-mac 4.8, I switched where Qt's frameworks were installed from ${prefix}/lib to ${prefix}/Library/Frameworks -- makes sense, right? This switch was by "popular demand", and the QMake hacking wasn't too difficult. Basically, I added a set of variables that replicated LIBDIR for FRAMEWORKDIR. From the above patch, I missed that one's initial setting, but otherwise the system works. MacPorts' Qt4 provides both LIBDIR and FRAMEWORKDIR, such that if Qt is installed as libraries one should use LIBDIR and if as frameworks then FRAMEWORKDIR; ditto for installing other projects that link with Qt4. And, these are well and correctly defined if using QMake, PKGCONFIG, and/or GNU LIBTOOL. Which covers, I think, most projects and ports. Internally, QMake's initial settings include one for "installed as framework" which is easy to test for and use. I think if using PKGCONFIG and/or GNU LIBTOOL it would not be difficult to determine whether Qt was installed as libraries or frameworks (e.g., check LDFLAGS for "framework").

PyQt4's initial test for QtCore uses QMake, which with the above patch will succeed in finding, linking, and executing a Qt-based application (which prints out a bunch of Qt variables, which are then parsed internally). All the rest of PyQt4's tests -- for QtGUI and so forth -- rely on SIP instead of QMake (installed as py-sip etc). SIP does all of its Qt library / framework determination internally, not relying on QMake, PKGCONFIG, and/or GNU LIBTOOL. Hence, its assumptions about where Qt's frameworks are installed are not correct with regard to the framework location change I made to Qt 4.8. PyQt4 actually assumes that Qt is installed as libraries, I think, but it does contain a "Qt as framework" flag that I can easily patch in and hack to select that option.

So all of this means I have to go and hack on SIP for a bit to get it's internal representation of Qt4's install locations correct. Then, I have to hack on PyQt4 a bit to get it to recognize "Qt as framework" and also pass the correct flags to SIP. I think there are actually very few changes required to do this, but I have to find them through reading code, patches, and testing -- to some degree "trial and error". Hence, it'll take me a bit to get this all worked through, given the complexity of the situation.

comment:19 in reply to:  18 Changed 7 years ago by sahaimic@…

Whoa. Ok lots of meticulous work then. I'll keep my fingers crossed but thanks in advance and good luck? :)

comment:20 Changed 7 years ago by michaelld (Michael Dickens)

Partially fixed in r96669 (the py27-pyqt4 part); I still need to check in the tweak above to qt4-mac (mkspecs/common/mac.conf), but I'm combining it with some other changes hence it'll probably be this afternoon before I actually get it finished.

comment:21 Changed 7 years ago by michaelld (Michael Dickens)

Resolution: fixed
Status: newclosed

Should be fully fixed in r96896, with a change to the qt4-mac part. The initial changes from r96669 might have worked well enough, so I'm not going to rev-bump py-pyqt4 unless need be.

Note: See TracTickets for help on using tickets.