From: Eric W. <scr...@gm...> - 2006-11-26 20:07:00
|
Hi all, I have a need to build appbundles on the mac, but was finding the PerlWrapper process a bit lacking when in comes to fitting into dotReader's automated cross-platform build system. Introducing the Module::Build::Plugins::MacBundle and ExtUtils::MacMaker modules. http://scratchcomputing.com/svn/Module-Build-Plugins-MacBundle/trunk This was only started a few days ago, so I'm still in the process of defining how we control the behavior for variations on the build. Currently, it takes the first thing (in glob order) out of your bin/ directory or whatever is explicit as "main_pl_file => 'foo'" in your Build->new parameters. It uses Module::ScanDeps to bundle all of your dependencies and otool/install_name_tool to discover and rewrite all of the references in a bundled libperl.dylib and any .bundle dependencies and related .dylibs. By default, the resultant appbundle will run on an os-x without perl. I'm building on 10.4.8 and have tested the resultant .app on a bare 10.3.9 mac. It was a huge headache to figure out how to get it to play nice with the finder. I will never forgive apple for the last couple days of searching their documentation and unnecessarily convoluted C hacking just to get hold of what should be in argv[1]. Currently, this ignores argv, so doesn't work from the command line. I think that could be fixed by looking at the "looks like a process number" -p4558 (or whatever it is) and changing behavior based on that, but this is meant to work with the gui more than with the command line, so that's pretty low priority for me. In any case, now you can get the filename(s?) that the user selected or dropped on your app as long as your main_pl_file includes a main::main() sub. If you don't have main::main, the behavior is the same as the old PerlWrapper. Documentation is a bit sparse for now. Please see the demo directory in the repository, read the code, and/or poke around in the resultant blib/macbuild/build/Default/YourAppName.app. If someone is interested in using ExtUtils::MacMaker for a different build system or some command-line tools, I would love to hear about it. Anyone with more Mac/C experience than me might find some atrocities in main.c, etc. Please send patches. Thanks, Eric -- Turns out the optimal technique is to put it in reverse and gun it. --Steven Squyres (on challenges in interplanetary robot navigation) --------------------------------------------------- http://scratchcomputing.com --------------------------------------------------- |