CamelBones is a Cocoa / Perl bridge for Mac OS X. Like most bridges,
CamelBones is bidirectional - It makes Perl accessible from Objective-C,
as well as making Cocoa accessible from Perl. You can write a native
Cocoa database front-end using DBI for your corporate clients, embed
Perl as an application scripting language for your bespoke tool chain,
or build complete self-contained web-based apps using the included set
of Catalyst modules.
Exceptions are bidirectional now. You can catch Perl die() and other
errors using standard Objective-C exception handling.
The PAR module and its prerequisites are included with CamelBones for
10.3 (Panther) and 10.4 (Tiger). (The current PAR module is not compatible
with the Perl included with 10.2) So, you can include .par files in your
applications. Finding the .par modules needs to be done after CamelBones
initializes, so that NSBundle methods can be called to find the .app
bundle, like so:
# main.pl is a good home for this
BEGIN {
use CamelBones qw(:All);
my $resDir = NSBundle->mainBundle()->resourcePath();
eval "use PAR '$resDir/*.par'";
}
To bundle PAR packages into your app, just drag-n-drop them onto your Xcode
project, or choose the "Project/Add to Project..." menu item. Xcode will
add them automatically to the "Copy Resources" phase of your project.
Pure-Perl PARS are easy to create - they're just .zip files renamed to have
a .par extension instead. The directory structure inside of the .par file
must reflect the package name space, i.e. Foo::Bar would be:
Foo/Bar.pm
XS modules are more work to create; they need to include binary-compatible
versions for *all* of the OS versions you intend to support. Also, note
that XS modules for Tiger (and newer) OS versions will need to be Universal
if your app is to run as a Universal Binary. A tutorial listing the steps I
taok to create the UB modules found in the CamelBones module "kits" is
coming soon on the web site.
Module "kits" are now packaged as .par files, and greatly expanded. A full
list of the included modules is available on the web site, but in short:
DevKit - Modules useful in a variety of problem domains.
DBIKit - DBI, DBD::* drivers for MySQL, PostgreSQL, and SQLite, and
additional DBIx::* modules for database programming.
MacPerlKit - The latest Mac::Carbon.
XMLKit - Many XML::* modules for working with XML.
CatKit - Catalyst, its prerequisites, and many plugins.
The old "RendezvousBrowser" example from the 0.3 series has been updated
to CamelBones 1.0, and renamed to "NetService Browser".
A couple of memory-management bugs were fixed.
sherm--
--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
> What is CamelBones?
Sorry, a better question might be *where* is CamelBones? I didn't forget
the address, just buried it on the last line. :-(
In case you missed it:
<http://camelbones.sf.net>
>
> In case you missed it:
> <http://camelbones.sf.net>
i did the first step tuto, hello world, and i get errors at build :
Tool:0: pbxcp: error: open(): CamelBones.framework/Resources/5.8.1
[/SourceCache/pbx_tools/pbx_tools-628.1/pbxcp/file_utils.c:644]:
Permission denied
Tool:0: pbxcp: error: open(): CamelBones.framework/Resources/5.8.1
[\204Y 8c:22472] -- st_mode=0x281: Permission denied
however double clicking on the builded app bundle shows it up !
i'm running Tiger the latest.
--
Une Bévue
Sorry, it's an installer bug where permissions are set incorrectly on the
built-in PAR module directory tree. It won't actually cause you any problems
unless you try to bundle .par files with your app, but it does make noise
in the build window even so.
I'll roll a new installer when I get a chance, but meanwhile here's a work-
around to make the affected directories readable:
cd /Developer/CamelBones
sudo chmod -R go+r Bundle-Frameworks/CamelBones.framework/Resources/5.8.*
sudo chmod -R go+r Frameworks/CamelBones.framework/Resources/5.8.*
sudo chmod -R go+r /Library/Frameworks/CamelBones.framework/Resources/5.8.*
>
> I'll roll a new installer when I get a chance, but meanwhile here's a work-
> around to make the affected directories readable:
this works fine, thanks !
--
Une Bévue