Re: [Pythonmac-SIG] Use py2app: GTK+-based application/addinggenerated files/X11
Bill Janssen [EMAIL PROTECTED] wrote: Indeed the folks at http://developer.imendio.com/wiki/Gtk_Mac_OS_X have ported GTK+ 2 to the Mac. I have it on my still-give-it-a-try list. The sources for this have been folded back into the regular GTK+ source tree. But looking at the gtk-dev mailing list, it looks like it's not quite a finished product yet. I managed to build and install the native Mac port of GTK+. They already did a great job. I even got pygtk running on top (had to comment out some X11-specific fuctions). .. But it crashed after some interaction... I think it's a serious option, within half a year or so. Regards, Arjan Bill ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Use py2app: GTK+-based application/adding generated files/X11
David Warde-Farley [EMAIL PROTECTED] wrote: On 22-May-06, at 1:37 PM, Bill Janssen wrote: Note that by default, X11 is not available on a Mac. It's an optional install. Yup, but it's easy enough to direct your users on the download page to install X11 off the Apple CDs. They're not paying anything for Gaphor so they shouldn't whine :) Well said ;-) Lots of projects do this, like Gimp.app, Inkscape and OpenOffice. Gimp.app even themes its GTK to look Cocoa-ish, which is kind of neat. As I said earlier you might also consider putting together a little AppleScript (or PyObjC voodoo) that pops up an error dialog if X11 fails to launch. That brings me back to my last question: * Gaphor generates some files from its setup.py. What's the best way to add those to the application package? I have to add some generated files (one of which is the data model of Gaphor) into the py2app distribution. The file is generated (as part of the build target), but is not added to the .app. What's the proper way to tell py2app to take those files into consideration? Regards, Arjan Dave ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] py2app corrupting libraries -- patch for bug in py2app 2.5
This is a patch and explanation (written by one of my co-workers) related to a question I posted to this list on 5/10. We have a Python application with a number of C++ extension modules, some of which dynamically load other C++ modules, all of which reference additional C++ frameworks we've built. The module dependency graph gets complex. We've recently begun building those C++ pieces as Universal, and have upgraded to py2app 2.5 to construct a Universal app bundle. We're passing: setup( app=['blobs.py'], data_files=[...], options=dict( py2app=dict( archs=ppc,i386, ...))) However, we're getting an error of the form: Thinning /Users/nat/cbtr/blobs/Python/dist/Cosmic Blobs.app/Contents/Frameworks/Events.framework/Versions/A/Events to ppc, i386 /usr/bin/lipo: -extract ppc specified but fat file: /Users/nat/cbtr/blobs/Python/dist/Cosmic Blobs.app/Contents/Frameworks/Events.framework/Versions/A/Events does not contain that architecture Examining previous output shows this some 25 lines above: Thinning /Users/nat/cbtr/blobs/Python/dist/Cosmic Blobs.app/Contents/MacOS/../Frameworks/Events.framework/Versions/A/Event s to i386 That shouldn't be happening. We inserted a test in util.thin_to_archs() to detect the case of a call that fails to specify both 'ppc' and 'i386', and tracked it back up into MachOStandalone.run(). That function constructs an archs dict that maps filenames to lists of architecture keywords. Then it looks up the architecture list for each file of interest. Among the entries in that dict are: '/Users/nat/cbtr/blobs/Python/dist/Cosmic Blobs.app/Contents/Frameworks/Events.framework/Versions/A/Events': ['ppc', 'i386'], ... '/Users/nat/cbtr/blobs/Python/dist/Cosmic Blobs.app/Contents/MacOS/../Frameworks/Events.framework/Versions/A/Event s': ['i386'], with other similar duplications. I'm guessing that it should work better to call os.path.realpath() on the filenames, both when constructing and when accessing that archs dict. For instance: *** /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-pac kages/py2app/macholib/MachOStandalone.py~ Thu May 18 14:26:59 2006 --- /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-pac kages/py2app/macholib/MachOStandalone.pyMon May 22 15:14:43 2006 *** *** 117,130 mm = self.mms[arch] for node in mm.flatten(has_filename_filter): machfiles[node.filename] = node ! archs.setdefault(node.filename, []) ! archs[node.filename].append(arch) dest = os.path.join(contents, node.filename[len(skipcontents):]) changemap[node.filename] = dest for node in machfiles.itervalues(): filename = node.filename ! nodearchs = archs[node.filename] changed = False for arch in nodearchs: mm = self.mms[arch] --- 117,129 mm = self.mms[arch] for node in mm.flatten(has_filename_filter): machfiles[node.filename] = node ! archs.setdefault(os.path.realpath(node.filename), []).append(arch) dest = os.path.join(contents, node.filename[len(skipcontents):]) changemap[node.filename] = dest for node in machfiles.itervalues(): filename = node.filename ! nodearchs = archs[os.path.realpath(node.filename)] changed = False for arch in nodearchs: mm = self.mms[arch] Unfortunately this starts producing: Thinning /Users/nat/cbtr/blobs/Python/dist/Cosmic Blobs.app/Contents/Frameworks/MathUtils.framework/Versions/A/MathUtils to ppc, i386, i386 Thinning /Users/nat/cbtr/blobs/Python/dist/Cosmic Blobs.app/Contents/MacOS/../MacOS/../Frameworks/Python.framework/Version s/2.4/Python to ppc, ppc, ppc, i386, i386, i386 /usr/bin/lipo: -extract ppc specified multiple times ValueError: Error 1 returned by: '/usr/bin/lipo' '/Users/nat/cbtr/blobs/Python/dist/Cosmic Blobs.app/Contents/MacOS/../MacOS/../Frameworks/Python.framework/Version s/2.4/Python' '-output' '/tmp/tmpoYncVt' '-extract' 'ppc' '-extract' 'ppc' '-extract' 'ppc' '-extract' 'i386' '-extract' 'i386' '-extract' 'i386' So maybe it would work better if, instead of a list of architectures, we were to use a set instead: *** /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-pac kages/py2app/macholib/MachOStandalone.py~ Thu May 18 14:26:59 2006 --- /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-pac kages/py2app/macholib/MachOStandalone.pyMon May 22 15:25:19 2006 *** *** 117,130 mm = self.mms[arch] for node in mm.flatten(has_filename_filter): machfiles[node.filename] = node ! archs.setdefault(node.filename, []) !
Re: [Pythonmac-SIG] py2app corrupting libraries -- patch for bug in py2app 2.5
On 23-mei-2006, at 14:56, Kent Quirk wrote: This is a patch and explanation (written by one of my co-workers) related to a question I posted to this list on 5/10. It might be just me, but I don't really understand why py2app tries to thin architectures in the first place. The only file it may have to thin is its own executable stub, because the OS uses that to decide if an application can run natively or not (that's not entirely true, but good enough). I want to do a new release of PyObjC soon, but want to check the universal binary support in py2app first. That code seems to have some rough edges at the moment. Ronald ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] Latest Py2app?
Hi all (and particularly Bob) Where can I get the latest Py2app? This page is pretty out of date: http://undefined.org/python/py2app.html It sounds like we need to do a little more testing of Py2app with the Universal build, and I'd love to do that, plus, I need it! -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/ORR/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception [EMAIL PROTECTED] ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] py2app corrupting libraries -- patch for bug in py2app 2.5
On May 23, 2006, at 2:09 PM, Ronald Oussoren wrote: On 23-mei-2006, at 14:56, Kent Quirk wrote: This is a patch and explanation (written by one of my co-workers) related to a question I posted to this list on 5/10. It might be just me, but I don't really understand why py2app tries to thin architectures in the first place. The only file it may have to thin is its own executable stub, because the OS uses that to decide if an application can run natively or not (that's not entirely true, but good enough). It doesn't even need to do that, because you can specify which architecture to use by way of an Info.plist key. I didn't write any of the universal support in that branch, so I'm not sure why it's doing what it's doing. I'd like to go through it and audit or rewrite, but I won't have time until at least after the need for speed sprint. BTW: have you looked at getting ctypes to build on Mac OS X i386? I was going to take a look at ctypes performance, but I can't build it on my MacBook Pro. -bob ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Latest Py2app?
On May 23, 2006, at 4:00 PM, Christopher Barker wrote: Hi all (and particularly Bob) Where can I get the latest Py2app? This page is pretty out of date: http://undefined.org/python/py2app.html It sounds like we need to do a little more testing of Py2app with the Universal build, and I'd love to do that, plus, I need it! The universal branch of py2app is most easily obtained from the PyObjC trunk. The reason the page is out of date is because there isn't a new release. The universal branch clearly still has a bunch of issues, but it's here in svn if you want to grab it directly: http://svn.red-bean.com/bob/py2app/branches/py2app-0.2-maint -bob ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] py2app corrupting libraries -- patch for bug in py2app 2.5
On 23-mei-2006, at 18:08, Bob Ippolito wrote: On May 23, 2006, at 2:09 PM, Ronald Oussoren wrote: On 23-mei-2006, at 14:56, Kent Quirk wrote: This is a patch and explanation (written by one of my co-workers) related to a question I posted to this list on 5/10. It might be just me, but I don't really understand why py2app tries to thin architectures in the first place. The only file it may have to thin is its own executable stub, because the OS uses that to decide if an application can run natively or not (that's not entirely true, but good enough). It doesn't even need to do that, because you can specify which architecture to use by way of an Info.plist key. I didn't write any of the universal support in that branch, so I'm not sure why it's doing what it's doing. I'd like to go through it and audit or rewrite, but I won't have time until at least after the need for speed sprint. I'll probably have a look this thursday. BTW: have you looked at getting ctypes to build on Mac OS X i386? I was going to take a look at ctypes performance, but I can't build it on my MacBook Pro. I haven't looked at this yet, I'm trying to keep python2.5 working first. It should be possible to use a copy of the libffi in pyobjc to get ctypes going, or at least the object files that pyobjc generates. Ronald ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] [Matplotlib-users] Matplotlib Universal Package
Yeah, mpl 0.87.2 was built with numpy 0.9.6. I don't think a new matplotlib release is in the near future unless the new numpy warrants a minor bump. - Charlie On 5/23/06, Samuel M. Smith [EMAIL PROTECTED] wrote: Charlie, I finally had some time to update my python matplotlib installation. I installed Universal Python 2.4.3-2006-04-07.dmg numpy 0.9.8 from source wxPython2.6-osx-unicode-2.6.3.2rc2-universal10.4-py.2.4.dmg wxPython2.6-osx-ansi-2.6.3.2rc2-universal10.4.py2.4.dmg Iipython 0.7.1.fix1 was already installed I tried a test of matplotlib using ipython and get a segmentation fault. ipython -pylab loaded rc file /Users/smithsm/.matplotlib/matplotlibrc matplotlib version 0.87.2 verbose.level helpful interactive is False platform is darwin numerix numpy 0.9.8 Segmentation fault I am guessing that you used a different version of numpy? If I just do python from terminal and import matplotlob then no segmentation fault import matplotlib loaded rc file /Users/smithsm/.matplotlib/matplotlibrc matplotlib version 0.87.2 verbose.level helpful interactive is False platform is darwin Anybody have any ideas what is happening? On 03 May, 2006, at 20:09, Charlie Moad wrote: I posted a universal build of matplotlib 0.87.2 on sourceforge in egg and mpkg format. It is compiled against the latest numarray, numpy, and Numeric as well as Tk and the new wxPython-rc2 universal. Libpng and freetype2 are statically linked in. Please post or link to either/both at http://pythonmac.org/packages/py24-fat/;. http://sourceforge.net/project/showfiles.php? group_id=80706package_id=82474 ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] [Matplotlib-users] Matplotlib Universal Package
Charlie, I finally had some time to update my python matplotlib installation. I installed Universal Python 2.4.3-2006-04-07.dmg numpy 0.9.8 from source wxPython2.6-osx-unicode-2.6.3.2rc2-universal10.4-py.2.4.dmg wxPython2.6-osx-ansi-2.6.3.2rc2-universal10.4.py2.4.dmg Iipython 0.7.1.fix1 was already installed I tried a test of matplotlib using ipython and get a segmentation fault. ipython -pylab loaded rc file /Users/smithsm/.matplotlib/matplotlibrc matplotlib version 0.87.2 verbose.level helpful interactive is False platform is darwin numerix numpy 0.9.8 Segmentation fault I am guessing that you used a different version of numpy? If I just do python from terminal and import matplotlob then no segmentation fault import matplotlib loaded rc file /Users/smithsm/.matplotlib/matplotlibrc matplotlib version 0.87.2 verbose.level helpful interactive is False platform is darwin Anybody have any ideas what is happening? On 03 May, 2006, at 20:09, Charlie Moad wrote: I posted a universal build of matplotlib 0.87.2 on sourceforge in egg and mpkg format. It is compiled against the latest numarray, numpy, and Numeric as well as Tk and the new wxPython-rc2 universal. Libpng and freetype2 are statically linked in. Please post or link to either/both at http://pythonmac.org/packages/py24-fat/;. http://sourceforge.net/project/showfiles.php? group_id=80706package_id=82474 ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] NSView.adjustScroll_ crashes
Hello, I am trying to adjust the scrolling of a custom NSTableView within the adjustScroll_ method. But my App crashes sooner or later when I overwrite this method (it crashes sooner if I draw a lot of NSBezierPaths in the table cells). I tried to return a newly created NSRect as well as a tuple of tuples with the adjusted values. But both fails. If somebody had the same problems or has an idea what could possibly go wrong, please let me know. Thanks in advance for any help, yours kodi ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] [Matplotlib-users] Matplotlib Universal Package
So I could either regress numpy or build Matplotlib from source. Since I like being able to get the latest bug fixes for Matplotlib and the last time I build it from svn it went without a hitch, I decided to try to build Matplotlib from source. Unfortunately it didn't work this time. I get the error shown below. I have a powerbook g4 with 10.4.6 and Universal Python 2.4.3-2006-04-07.dmg. What am I missing? svn co https://svn.sourceforge.net/svnroot/matplotlib/trunk/ matplotlib matplotlib Checked out revision 2411. edit darwin path in setupext.py basedir = { 'win32' : ['win32_static',], 'linux2' : ['/usr/local', '/usr',], 'linux' : ['/usr/local', '/usr',], 'cygwin' : ['/usr/local', '/usr',], 'darwin' : ['/usr/local','/opt/local','/usr'], 'freebsd4' : ['/usr/local', '/usr'], 'freebsd5' : ['/usr/local', '/usr'], 'freebsd6' : ['/usr/local', '/usr'], 'sunos5' : [os.getenv('MPLIB_BASE') or '/usr/local',], 'gnukfreebsd5' : ['/usr/local', '/usr'], 'gnukfreebsd6' : ['/usr/local', '/usr'], } from terminal export WX_CONFIG=usr/local/lib/wxPython-ansi-2.6.3.2rc2/bin/wx-config cd matplotlib python setup.py build gcc: src/_ns_cntr.c In file included from /usr/include/math.h:26, from /Library/Frameworks/Python.framework/Versions/ 2.4/include/python2.4/pyport.h:90, from /Library/Frameworks/Python.framework/Versions/ 2.4/include/python2.4/Python.h:55, from src/_ns_cntr.c:17: /usr/include/architecture/ppc/math.h:477: warning: conflicting types for built-in function 'scalb' In file included from src/_ns_cntr.c:28: /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- packages/numpy/core/include/numpy/arrayobject.h:139: error: redefinition of typedef 'ushort' /usr/include/sys/types.h:85: error: previous declaration of 'ushort' was here /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- packages/numpy/core/include/numpy/arrayobject.h:140: error: redefinition of typedef 'uint' /usr/include/sys/types.h:86: error: previous declaration of 'uint' was here In file included from src/_ns_cntr.c:28: /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- packages/numpy/core/include/numpy/arrayobject.h:139: error: redefinition of typedef 'ushort' /usr/include/sys/types.h:85: error: previous declaration of 'ushort' was here /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- packages/numpy/core/include/numpy/arrayobject.h:140: error: redefinition of typedef 'uint' /usr/include/sys/types.h:86: error: previous declaration of 'uint' was here lipo: can't figure out the architecture type of: /var/tmp//ccR0VtyV.out In file included from /usr/include/math.h:26, from /Library/Frameworks/Python.framework/Versions/ 2.4/include/python2.4/pyport.h:90, from /Library/Frameworks/Python.framework/Versions/ 2.4/include/python2.4/Python.h:55, from src/_ns_cntr.c:17: /usr/include/architecture/ppc/math.h:477: warning: conflicting types for built-in function 'scalb' In file included from src/_ns_cntr.c:28: /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- packages/numpy/core/include/numpy/arrayobject.h:139: error: redefinition of typedef 'ushort' /usr/include/sys/types.h:85: error: previous declaration of 'ushort' was here /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- packages/numpy/core/include/numpy/arrayobject.h:140: error: redefinition of typedef 'uint' /usr/include/sys/types.h:86: error: previous declaration of 'uint' was here In file included from src/_ns_cntr.c:28: /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- packages/numpy/core/include/numpy/arrayobject.h:139: error: redefinition of typedef 'ushort' /usr/include/sys/types.h:85: error: previous declaration of 'ushort' was here /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- packages/numpy/core/include/numpy/arrayobject.h:140: error: redefinition of typedef 'uint' /usr/include/sys/types.h:86: error: previous declaration of 'uint' was here lipo: can't figure out the architecture type of: /var/tmp//ccR0VtyV.out error: Command gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/ MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -I/Library/ Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/ numpy/core/include -I/usr/local/include -I/opt/local/include -I/usr/ include -I. -I/Library/Frameworks/Python.framework/Versions/2.4/ include/python2.4 -c src/_ns_cntr.c -o build/temp.macosx-10.4-fat-2.4/ src/_ns_cntr.o -DSCIPY=1 failed with exit status 1 albook:smithsm$ On 23 May, 2006, at 11:52, Charlie Moad wrote: Yeah, mpl 0.87.2 was built with numpy 0.9.6. I don't think a new matplotlib release is in the near future unless the
Re: [Pythonmac-SIG] [Matplotlib-users] Matplotlib Universal Package
Well, I gave up. I regressed and installed numpy 0.9.6 from the package installer and looks like matplotlib works now. It sure blows my confidence when two months go by and there are enough changes that I can't install from source anymore. I would like to try again but it would be nice to know what you did to get it to work since what I did last time no longer works. Sam ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig