|Keep It Simple, Stupid|
Getting a working Padre and Wx on Mac OS X (Snow Leopard) with Perl 5.14.0by kevbot (Chaplain)
|on Jun 17, 2011 at 23:18 UTC||Need Help??|
The release of Perl 5.14.0 left me with a desire to try it out. However, I am using Mac OS X, Snow Leopard (10.6.7), and I had a bit of trouble getting all of the goodies to work. I got things working, but there may be a better way! I would be interested to see if others have solved this or similar problems in other ways.
I wanted to use an up-to-date version of Padre (which requires a perl with thread support and wxWidgets). I am making this post, since this information is scattered around in various places and maybe this will help others.
I have taken the advice of the Monastery, and I never mess with the system perl. I currently have a 5.12.1 installation in my /usr/local. However, I have now learned how to use perlbrew (http://www.perlbrew.pl) and I think I will be using it for all of my non-system perl needs in the future.
In my attempts to get a working installation of Padre (from CPAN), I encountered various problems. The installation would succeed, but then I would get crashes when running Padre (for example, Padre would crash whenever I attempted a 'File->Save As'). I think some of the problems I encountered were related to issues with the system wxWidgets supplied with Snow Leopard. Also, the mixed 32-bit and 64-bit nature of Snow Leopard was making it difficult to troubleshoot the problems that I was having. There are 64-bit compatible wxWidgets versions out now (2.9 and higher), but when I attempted to use them with Padre I was running into problems. So to minimize the pain...I decided on 32-bit all the way.
I installed a 32-bit version of fink (http://www.finkproject.org/), and then I installed the wxgtk2.8 package (there are other wx packages, but I still encountered problems in Padre with those so I settled on wxgtk2.8). After the installation you need to be sure that the first wx in your path is the one from fink. If the fink installation directory is in your path you should get the fink version of wx-config. Use 'which' to see which installation of wx is first in your path:which wx-config
Then you should get output similar to this (/sw is the default installation directory for fink):/sw/bin/wx-config
I googled and found instructions for building a 32-bit perl on Snow Leopard in an article at http://ecocode.net - "Installing wxPerl on Snow Leopard (works also for 64bit processors)". However, the original link is now 404 (I happened to save a local copy). Using the command line args that I took from that article, I was able to get perlbrew to install a 32-bit, threaded, Perl 5.14.0.
perlbrew install perl-5.14.0 -Dusethreads -Dcc="gcc -m32" -Uloclibpth -Dlibpth=/usr/lib -Accflags="-arch i386 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -I/usr/local/include" -Aldflags="-arch i386 -L/usr/local/lib" -Alddlflags="-arch i386 -bundle -undefined dynamic_lookup -L/usr/local/lib" -d
Switch to the newly installed perl:perlbrew switch perl-5.14.0
Now, you should be able to install the Alien::wxWidgets and Wx modules using cpan.
Then, you should be able to install Padre.
Now that I have made this post, I can't forget how I got things working...and hopefully others find this information helpful.
UPDATE: Instructions for building Padre on Snow Leopard can be found here: http://wildperl.com/2011/07/padre-on-osx-dmg-now-on-leopard-snow-leopard-and-lion/. It also seems that the cause of the File->Save As.. crash has been identified (as detailed in this bug report, http://padre.perlide.org/trac/ticket/1272). I applied this patch (http://padre.perlide.org/trac/attachment/ticket/1272/diff.patch) and things seem to be working with perl 5.14.1, wxWidgets 2.8.12 for Mac OS X (no need for the gtk version of wx any longer), and Mac OS X 10.6.8. I assume this patch will make it into an upcoming version of Padre.