Difference between revisions of "Installing Code::Blocks from source on Mac OS X"

From Code::Blocks
m
Line 8: Line 8:
  
 
== Check Autotools versions ==
 
== Check Autotools versions ==
 +
 +
http://www.gnu.org/software/autoconf/
 +
http://www.gnu.org/software/automake/
 +
http://www.gnu.org/software/libtool/
  
 
== Build wxWidgets 2.6 ==
 
== Build wxWidgets 2.6 ==
Line 14: Line 18:
  
 
== Install Subversion client ==
 
== Install Subversion client ==
 +
 +
http://subversion.tigris.org/
  
 
== Build CodeBlocks from SVN ==
 
== Build CodeBlocks from SVN ==
 +
 +
https://www.codeblocks.org/source_code.shtml
  
 
== Bundle application for Mac ==
 
== Bundle application for Mac ==
Line 75: Line 83:
 
<pre>
 
<pre>
 
CodeBlocks.app
 
CodeBlocks.app
 +
CodeBlocks.app/Contents/
 
CodeBlocks.app/Contents/Info.plist
 
CodeBlocks.app/Contents/Info.plist
CodeBlocks.app/Contents/MacOS
+
CodeBlocks.app/Contents/MacOS/
 
CodeBlocks.app/Contents/MacOS/CodeBlocks
 
CodeBlocks.app/Contents/MacOS/CodeBlocks
CodeBlocks.app/Contents/Resources
+
CodeBlocks.app/Contents/Resources/
 
CodeBlocks.app/Contents/Resources/CodeBlocks.icns
 
CodeBlocks.app/Contents/Resources/CodeBlocks.icns
CodeBlocks.app/Contents/bin
+
CodeBlocks.app/Contents/bin/
CodeBlocks.app/Contents/lib
+
CodeBlocks.app/Contents/lib/
CodeBlocks.app/Contents/share/codeblocks
+
CodeBlocks.app/Contents/share/codeblocks/
 
</pre>
 
</pre>
  
 
The CodeBlocks application can now be moved with the Finder, and started up like a regular Mac application.
 
The CodeBlocks application can now be moved with the Finder, and started up like a regular Mac application.

Revision as of 19:48, 21 February 2006


Install Xcode Tools

http://developer.apple.com/tools/

Check Autotools versions

http://www.gnu.org/software/autoconf/ http://www.gnu.org/software/automake/ http://www.gnu.org/software/libtool/

Build wxWidgets 2.6

http://wxwidgets.org/dl_mac2.htm

Install Subversion client

http://subversion.tigris.org/

Build CodeBlocks from SVN

https://www.codeblocks.org/source_code.shtml

Bundle application for Mac

After building codeblocks in the regular Unix way, you need to bundle it with the icons and various other info that it needs to make a regular stand-alone Macintosh application.

There are two ways of accomplishing this, old Mac OS-style resource or NeXT-style bundle. The old resources are handy while developing, while bundles are more suitable for release.

1. Mac OS (resource)

Handy while developing, as you only need to add an icon.

Files needed:

First we install the program to the PREFIX directory of your choice:

$PREFIX/bin
$PREFIX/lib
$PREFIX/share/codeblocks

Add a custom icon to the application, to make it receive events:

gunzip CodeBlocks.r.gz
sudo /Developer/Tools/Rez -d __DARWIN__ -t APPL -d __WXMAC__ \
                          CodeBlocks.r Carbon.r -o $PREFIX/bin/codeblocks
sudo /Developer/Tools/SetFile -a C $PREFIX/bin/codeblocks

Start the application with a small prefix shell wrapper like this:

DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$PREFIX/lib
export DYLD_LIBRARY_PATH

$PREFIX/bin/codeblocks --prefix=$PREFIX


2. NeXT (bundle)

This does not involve resources, and is more relocatable.

Files needed:

Traditionally it would involve Frameworks and Resources, but we'll just avoid those here and use "lib" and "share/codeblocks" instead. The MacOS program will be a shell wrapper that calls "bin/codeblocks", like above.

Setup a hierarchy like this, and copy the files from the regular build/install and the above file list to it:

CodeBlocks.app
CodeBlocks.app/Contents/
CodeBlocks.app/Contents/Info.plist
CodeBlocks.app/Contents/MacOS/
CodeBlocks.app/Contents/MacOS/CodeBlocks
CodeBlocks.app/Contents/Resources/
CodeBlocks.app/Contents/Resources/CodeBlocks.icns
CodeBlocks.app/Contents/bin/
CodeBlocks.app/Contents/lib/
CodeBlocks.app/Contents/share/codeblocks/

The CodeBlocks application can now be moved with the Finder, and started up like a regular Mac application.