Hi, I'm trying to build the gfx module so I can read PDF files from Python. I've tried three different approaches and each has ended with a dead end for me. My environment is Mac OSX 10.6, Python 2.6.
1) The build instructions for Mac OSX recommend installation via fink, but there's not yet a fink binary available for OSX 10.6. You can build fink yourself from source, but doing so requires a now outdated version of XCode (3.X), which is no longer available from Apple (AFAICT). 2) I have managed to build gfx.bundle manually from sources using XCode 4.X, but it's not clear to me how a .bundle file can be imported into Python -- a suggestion elsewhere that you should be able to copy that file into your local directory and import it as a module (e.g., >> import gfx) for me merely generates "ImportError: No module named gfx" 3) Trying to build from sources using distutils (i.e., env ARCHFLAGS="-arch i386 -arch x86_64" python setup.py build_ext) eventually dies with the linker complaining: gcc-4.2 -Wl,-F. -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 build/temp.macosx-10.6-universal-2.6/lib/python/SWF.o build/temp.macosx-10.6-universal-2.6/lib/python/taglist.o build/temp.macosx-10.6-universal-2.6/lib/python/tag.o build/temp.macosx-10.6-universal-2.6/lib/python/image.o build/temp.macosx-10.6-universal-2.6/lib/python/tags.o build/temp.macosx-10.6-universal-2.6/lib/python/tagmap.o build/temp.macosx-10.6-universal-2.6/lib/python/action.o build/temp.macosx-10.6-universal-2.6/lib/python/primitives.o build/temp.macosx-10.6-universal-2.6/lib/python/pyutils.o build/temp.macosx-10.6-universal-2.6/lib/q.o build/temp.macosx-10.6-universal-2.6/lib/utf8.o build/temp.macosx-10.6-universal-2.6/lib/png.o build/temp.macosx-10.6-universal-2.6/lib/jpeg.o build/temp.macosx-10.6-universal-2.6/lib/wav.o build/temp.macosx-10.6-universal-2.6/lib/mp3.o build/temp.macosx-10.6-universal-2.6/lib/os.o build/temp.macosx-10.6-universal-2.6/lib/bitio.o build/temp.macosx-10.6-universal-2.6/lib/log.o build/temp.macosx-10.6-universal-2.6/lib/mem.o build/temp.macosx-10.6-universal-2.6/lib/modules/swfaction.o build/temp.macosx-10.6-universal-2.6/lib/modules/swfbits.o build/temp.macosx-10.6-universal-2.6/lib/modules/swfbutton.o build/temp.macosx-10.6-universal-2.6/lib/modules/swfcgi.o build/temp.macosx-10.6-universal-2.6/lib/modules/swfdraw.o build/temp.macosx-10.6-universal-2.6/lib/modules/swfdump.o build/temp.macosx-10.6-universal-2.6/lib/modules/swffilter.o build/temp.macosx-10.6-universal-2.6/lib/modules/swffont.o build/temp.macosx-10.6-universal-2.6/lib/modules/swfobject.o build/temp.macosx-10.6-universal-2.6/lib/modules/swfrender.o build/temp.macosx-10.6-universal-2.6/lib/modules/swfshape.o build/temp.macosx-10.6-universal-2.6/lib/modules/swfsound.o build/temp.macosx-10.6-universal-2.6/lib/modules/swftext.o build/temp.macosx-10.6-universal-2.6/lib/modules/swftools.o build/temp.macosx-10.6-universal-2.6/lib/rfxswf.o build/temp.macosx-10.6-universal-2.6/lib/drawer.o build/temp.macosx-10.6-universal-2.6/lib/MD5.o build/temp.macosx-10.6-universal-2.6/lib/h.263/dct.o build/temp.macosx-10.6-universal-2.6/lib/h.263/h263tables.o build/temp.macosx-10.6-universal-2.6/lib/h.263/swfvideo.o build/temp.macosx-10.6-universal-2.6/lib/action/assembler.o build/temp.macosx-10.6-universal-2.6/lib/action/compile.o build/temp.macosx-10.6-universal-2.6/lib/action/lex.swf4.o build/temp.macosx-10.6-universal-2.6/lib/action/lex.swf5.o build/temp.macosx-10.6-universal-2.6/lib/action/libming.o build/temp.macosx-10.6-universal-2.6/lib/action/swf4compiler.tab.o build/temp.macosx-10.6-universal-2.6/lib/action/swf5compiler.tab.o build/temp.macosx-10.6-universal-2.6/lib/action/actioncompiler.o build/temp.macosx-10.6-universal-2.6/lib/as3/abc.o build/temp.macosx-10.6-universal-2.6/lib/as3/code.o build/temp.macosx-10.6-universal-2.6/lib/as3/pool.o build/temp.macosx-10.6-universal-2.6/lib/as3/files.o build/temp.macosx-10.6-universal-2.6/lib/as3/opcodes.o build/temp.macosx-10.6-universal-2.6/lib/as3/scripts.o build/temp.macosx-10.6-universal-2.6/lib/as3/common.o build/temp.macosx-10.6-universal-2.6/lib/as3/builtin.o build/temp.macosx-10.6-universal-2.6/lib/as3/compiler.o build/temp.macosx-10.6-universal-2.6/lib/as3/expr.o build/temp.macosx-10.6-universal-2.6/lib/as3/import.o build/temp.macosx-10.6-universal-2.6/lib/as3/initcode.o build/temp.macosx-10.6-universal-2.6/lib/as3/parser.tab.o build/temp.macosx-10.6-universal-2.6/lib/as3/registry.o build/temp.macosx-10.6-universal-2.6/lib/as3/tokenizer.yy.o /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PIL/_imaging.so -L/System/Library/Frameworks/Python.framework/Versions/2.6/lib -L/opt/local/lib -ljpeg -lz -lfreetype -o build/lib.macosx-10.6-universal-2.6/SWF.so ld: in /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PIL/_imaging.so, can't link with bundle (MH_BUNDLE) only dylibs (MH_DYLIB) for architecture i386 collect2: ld returned 1 exit status ld: in /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PIL/_imaging.so, can't link with bundle (MH_BUNDLE) only dylibs (MH_DYLIB) for architecture x86_64 collect2: ld returned 1 exit status 4) I've also tried installing via MacPorts, and, while that apparently succeeds (I can use the swftools command line utilities), it doesn't seem to produce the Python gfx module. So the question is: what seems like the best way to proceed? I hope that I'm missing something simple, but would appreciate any guidance regardless. Thanks! -Todd
