[PyKDE] sip-x11-gpl-4.0pre1 and MacOSX
Rune Hansen
rune.hansen at viventus.no
Sun Oct 19 01:38:01 BST 2003
Just a short summary for Qt/sip/pyqt on MacOSX.
Compilation of Qt takes a long time, a very long time. Compilation
"fails" after a while, just restart it to build designer, linguist and
so on.
On my 12" 867mhz pb, compilation finished after 3-4 hrs.
sip4.0pre1 Run build.py. After build.py edit siplib/Makefile and add
"-framework Python" to the end of the LFLAGS option. The line should
read:
LFLAGS -bundle -framework Python
Run make, and make install.
PyQt
Read README.MacOSX
I've found that PyQT builds cleanly with these modifications and the
december developer tools (gcc3.3).
Add, as noted in README.MacOSX, "macx:QMAKE_LFLAGS += -framework
Python" to:
qtcanvasmod.sip
qtextmod.sip
qtglmod.sip
qtnetworkmod.sip
qtsqlmod.sip
qttablemod.sip
qtuimod.sip
qtxmlmod.sip
The line "macx:QMAKE_CXXFLAGS += -Wno-long-double -no-cpp-precomp
-fno-common" does not seem to be necessary. Your mileage may vary.
Create a file in the sip folder within your pyqt source catalog named
"qwindowdefs_macx.sip"
This is the contents of my qwindowdefs_macx.sip:
%If (WS_MACX)
typedef unsigned WId;
typedef void *HANDLE;
%End
I do not remember where I got this file from. It is quite possibly
wrong.
Edit build.py. Find the "if" sentences near line or at line 567 and
comment them out.
Add the line: plattag = "WS_MACX"
Run build.py with the -c switch. Without the -c switch my machine
spends almost three hrs compiling pyqt versus >30 min with the option.
Edit qt/Makefile and add "-framework Python" to the end of the LFLAGS
option. There are several other makefiles in sub directories of your
pyqt source. You should check the LFALGS option of these files to make
sure -framework Python is present.
Run make and make install
The site-packages folder now contains several qt*.dylib files and
sip.dylib. The files needs to have a .so extension. Rename every file
replacing .dylib with .so
Your build should now be complete.
I've tried building PyQt-x11-gpl-snapshot-2003101/sip-x11-gpl-4.0pre1
against qt-mac-free-3.1.2 and qt-mac-free-3.2.2. Both builds worked
fine.
The only issues so far is that "from qt import *" takes aprox 8 seconds
on my machine and Qt-mac seems to do strange things with menus.
Especially the preferences menu option..
regards
/rune
More information about the PyQt
mailing list