Re: Newbie: Bundling Perl script and modules in a Mac OS X app?



Bondo wrote:
Is it possible to bundle a Mac OS X application with a Perl script and
a number of required modules, stored in the application package (folder
hierarchy) - and then, from within the application, running the Perl
script that's relying on these modules?

Ideally I would like the application to include the required modules.

Have a look at CamelBones: <http://camelbones.sourceforge.net>

When a CamelBones app runs, the Resources/, Resources/$version, and Resources/$version/$architecture folders within the .app bundle are added to @INC. So, you can bundle portable pure-Perl modules, modules that require a specific Perl version, and XS modules that require a specific version and architecture in your .app bundle.

This is necessary because different versions of Mac OS X ship with different Perls - 5.6.0 with Jaguar, 5.8.1 with Panther, and 5.8.6 with Tiger. So, for instance, if you wanted to include an XS module that would run on all three versions, you'd wind up with a folder hierarchy that looked in part like this:

    MyApp.app/
        Contents/
            Resources/
                5.6.0/
                    darwin/
                        auto/
                            MyModule/
                                MyModule.bs
                                MyModule.bundle
                        MyModule.pm
                5.8.1/
                    darwin-thread-multi-2level/
                        auto/
                            MyModule/
                                MyModule.bs
                                MyModule.bundle
                        MyModule.pm
                5.8.6/
                    darwin-thread-multi-2level/
                        auto/
                            MyModule/
                                MyModule.bs
                                MyModule.bundle
                        MyModule.pm

ObDisclaimer: I wrote CamelBones, so I won't even pretend to be objective about it. ;-)

sherm--

--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
.



Relevant Pages

  • RE: Re[2]: Problem with GD::Graph
    ... tried to recompile the GD-2.35 and the tests failed. ... I have installed all the required modules. ... Well it would seem to be an build type problem and you are going to have ... Perl 5.8.0 seems a bit old as does the i486 type ...
    (perl.beginners)
  • Module::Install cant locate required modules
    ... # Define metadata (we read it from the script) ... All the required modules are available: ... How can I make Modules::Install find the same modules as the perl ...
    (comp.lang.perl.misc)