wxpython on mac and universal binary concept

Hi,

I have successfully deployed an app using python 2.6.6 and wxpython
2.8.10.1 on windows and linux.
There are couple of c-extensions created using cython.

Now I have to port the same app on Mac and I am newly introduced to
this platform. One of the most important factor is to produce a
universal package. I am on 10.5.5 Leopard Intel. By default python
2.5.1 is
installed on Mac and first thing I have to do is to install python
2.6.6. There is build available on python.org but I not sure that
build is universal or not. As per py2app docs you have to make sure
that you use universal build of python to make your app compatible for
both architecture(ppc and i686).

If the build available on python.org is not universal then how do I
produce a universal build of python 2.6.6?
Do I have to compile python from sources on Mac with some specific
instructions?

I am bit confused about this para of py2app:

http://svn.pythonmac.org/py2app/py2app/trunk/doc/index.html#id17

"If you are building your application with a version of Python that is
not universal, or have extensions that are not universal, then you
must set the LSPrefersPPC Info.plist key to True. This will force the
application to run translated with Rosetta by default. This is
necessary because the py2app bootstrap application is universal, so
Finder will try and launch naively by default."

If I correctly followed then you can use a build of python which is
not universal as well as create c-extensions normally. Only thing you
have to do is set "LSPrefersPPC" key and py2app will create a
universal package. Am I right here?

wxpython.org has a build of wxpython (wxPython2.8-osx-unicode-py2.6)
which is compatible on both architecture so there are no issues.

the whole idea is to create a package using py2app that is universal.

Cheers

Now I have to port the same app on Mac and I am newly introduced to
this platform. One of the most important factor is to produce a
universal package. I am on 10.5.5 Leopard Intel. By default python
2.5.1 is
installed on Mac and first thing I have to do is to install python
2.6.6. There is build available on python.org but I not sure that
build is universal or not.

Yes it is: 32 bit PPC an Intel.

I am bit confused about this para of py2app:

http://svn.pythonmac.org/py2app/py2app/trunk/doc/index.html#id17

"If you are building your application with a version of Python that is
not universal, or have extensions that are not universal, then you
must set the LSPrefersPPC Info.plist key to True. This will force the
application to run translated with Rosetta by default.

This is what you do if you have PPC-only components in your app -- you really don't want to do that these days.

If I correctly followed then you can use a build of python which is
not universal as well as create c-extensions normally. Only thing you
have to do is set "LSPrefersPPC" key and py2app will create a
universal package. Am I right here?

nope -- what LSPrefersPPC does is force the Mac to run the code under Rosetta --i.e. as PPC code. These days you are more likely to have INtel-only than PPC only. Anyway, that's not what you want.

wxpython.org has a build of wxpython (wxPython2.8-osx-unicode-py2.6)
which is compatible on both architecture so there are no issues.

correct.

the whole idea is to create a package using py2app that is universal.

If all you are using is Python, wxPython, and pure python code and modules, then you are all set -- eveything should "just work".

If you need any other compiled modules, you'll have to make sure they are universal too (and support older versions of OS-X if you need that). Many of the major projects provide binaries that fit the bill -- look for ones that are built for teh "python.org python".

If you have to compile your own extensions, then distutils will built them right for you. The tricky bit is if you need to link to third-party libs -- in that case, they need to be Universal, too, which can be a trick.

-Chris

···

On 2/10/11 12:32 AM, King wrote:

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

Hi,

Hi,

I have successfully deployed an app using python 2.6.6 and wxpython
2.8.10.1 on windows and linux.
There are couple of c-extensions created using cython.

Now I have to port the same app on Mac and I am newly introduced to
this platform. One of the most important factor is to produce a
universal package. I am on 10.5.5 Leopard Intel. By default python
2.5.1 is
installed on Mac and first thing I have to do is to install python
2.6.6. There is build available on python.org but I not sure that
build is universal or not. As per py2app docs you have to make sure
that you use universal build of python to make your app compatible for
both architecture(ppc and i686).

If the build available on python.org is not universal then how do I
produce a universal build of python 2.6.6?
Do I have to compile python from sources on Mac with some specific
instructions?

If you do `lipo -info /path/to/my/python` from the terminal, it will tell you what architectures are in the build. I just double-checked, and my python.org build of 2.6 has both i386 and ppc architectures in it. I suspect yours is as well.

I am bit confused about this para of py2app:

http://svn.pythonmac.org/py2app/py2app/trunk/doc/index.html#id17

"If you are building your application with a version of Python that is
not universal, or have extensions that are not universal, then you
must set the LSPrefersPPC Info.plist key to True. This will force the
application to run translated with Rosetta by default. This is
necessary because the py2app bootstrap application is universal, so
Finder will try and launch naively by default."

If I correctly followed then you can use a build of python which is
not universal as well as create c-extensions normally. Only thing you
have to do is set "LSPrefersPPC" key and py2app will create a
universal package. Am I right here?

Basically, but just to be clear, this is for if you build a python which is not universal *and* was built for the PPC architecture. If you build for the i386 architecture, you don't need to do this, but neither will you have PPC support.

wxpython.org has a build of wxpython (wxPython2.8-osx-unicode-py2.6)
which is compatible on both architecture so there are no issues.

the whole idea is to create a package using py2app that is universal.

You shouldn't have any issues so long as you have a universal Python, and that should be fine as long as you use the python.org builds.

Regards,

Kevin

···

On Feb 10, 2011, at 12:32 AM, King wrote:

Cheers

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en