[29 Jan 2008] Compiling for MacOS

Contains all messages from the Hollywood mailing list between 01/2006 and 08/2012
Locked
Robin
Posts: 16
Joined: Sun Feb 14, 2010 6:29 pm

[29 Jan 2008] Compiling for MacOS

Post by Robin »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Tue, 29 Jan 2008 13:06:13 +0100 (CET)

Hi :)

It's really great! The first app is running under Windows. But I've no clue how to make a binary for macos. When I use the commandline to create a binary my system (morphos) displays the file as a link which means its displayed as a dir. Uploading to a linux machine keeps this ...

Code: Select all

drwxr-xr-x 3 robin www-data   4096 2008-01-29 11:50 myKalah.bin.app
What can/should I do ? -- Robin - http://my.morphosi.net/
User avatar
airsoftsoftwair
Posts: 5834
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

[29 Jan 2008] Re: Compiling for MacOS

Post by airsoftsoftwair »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Tue, 29 Jan 2008 17:12:59 +0100
Hi :)

It's really great! The first app is running under Windows. But I've no clue how to make a binary for macos. When I use the commandline to create a binary my system (morphos) displays the file as a link which means its displayed as a dir. Uploading to a linux machine keeps this ...

drwxr-xr-x 3 robin www-data 4096 2008-01-29 11:50 myKalah.bin.app

What can/should I do ?
Mac OS X uses this weird "application bundle" format which means that under Mac OS X, every application is in fact a directory. The program executable is then in the subdirectory Contents/MacOS of the application bundle. Thus, when you compile a Hollywood script for Mac OS, you will get a whole directory as the result.

Example:

Code: Select all

Hollywood test.hws -compile ram:test -exetype macos
This will create a directory called ram:test.app.

The directory will contain the following files

Code: Select all

ram:test.app/Contents/MacOS/test     ---> this is the executable
ram:test.app/Contents/Info.plist    ---> this is an xml containing information
ram:test.app/Contents/Resources/test.icns   ---> icon for the application
Now when you copy the directory ram:test.app to Mac OS X, it will no longer be shown as a directory by the file system of Mac OS X. Although it still is a directory of course. But it will be listed as an application now because the file system recognized it as an application.

This might be a little bit confusing for Amiga and Windows users, but that's the way things work over at Apple :)

So, summing up, the following steps are necessary to compile for Mac OS X:

1) Compile your script with -exetype macos

2) Copy the whole directory created by Hollywood (e.g. test.app) to your Mac OS X installation

3) Last step. Very important. Set the "execute" file attribute. Once you've transferred test.app to Mac OS X, you need to change the attribute of the executable file (resides in test.app/Contents/MacOS) to "executable". This can be done using "chmod" from the console or using a file manager like DiskOrder.

Then you can simply double click on test.app and it will start.

Have a look at the directory Demoprgs_MacOS on the Hollywood CD-ROM. It contains some example programs for Mac OS X.
Robin
Posts: 16
Joined: Sun Feb 14, 2010 6:29 pm

[29 Jan 2008] Re: Compiling for MacOS

Post by Robin »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Tue, 29 Jan 2008 18:43:15 +0100 (CET)

Hi,
Then you can simply double click on test.app and it will start.

Have a look at the directory Demoprgs_MacOS on the Hollywood CD-ROM. It contains some example programs for Mac OS X.
Doh, stupid me :) Guess I should have clicked the dir to see that it's really a dir ;) Weired concept ... I once had MacOS installed on my Pegasos but I never felt comfortable with its way of handling stuff.

Thanks for your detailed info :)

Now I can add MacOS to myKalah, too. http://my.morphosi.net/?modul=download& ... ct=myKalah

-- Robin - http://my.morphosi.net/
User avatar
airsoftsoftwair
Posts: 5834
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

[31 Jan 2008] Re: Compiling for MacOS

Post by airsoftsoftwair »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Thu, 31 Jan 2008 22:29:48 +0100
Doh, stupid me :) Guess I should have clicked the dir to see that it's really a dir ;) Weired concept ... I once had MacOS installed on my Pegasos but I never felt comfortable with its way of handling stuff.

Thanks for your detailed info :)

Now I can add MacOS to myKalah, too. http://my.morphosi.net/?modul=download& ... ct=myKalah
By the way, the file extension for Hollywood applets is "hwa" not "hpa"

hws --> Hollywood script hwa --> Hollywood applet
Locked