[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 
LFLAGS -bundle -framework Python
Run make, and make install.

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:

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 
This is the contents of my qwindowdefs_macx.sip:
typedef unsigned WId;
typedef void *HANDLE;
I do not remember where I got this file from. It is quite possibly 

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 

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



More information about the PyQt mailing list