HOW-TO compile XBMC for Mac from source code

From XBMC

Jump to: navigation, search
Image:Attention.png Note! This article documents a current event.
Information may change rapidly as the event progresses.

- XBMC Online Manual
- Introduction
-- About XBMC and The Project
-- Features, Formats & Codecs
-- The people behind XBMC
- Setup XBMC
-- Installing XBMC
--- Supported hardware
--- Installing XBMC for Linux
--- Installing XBMC for Mac
--- Installing XBMC for Mac on Apple TV
--- Installing XBMC for Windows
--- Installing XBMC for Xbox
--- Installing XBMC Live
--- Media Sources
--- - Adding Media Sources
- General Usage
-- Default Controls
-- The User Interface
--- General
--- - Shutdown Menu
--- Programs
--- - Using Trainers
--- Pictures
--- Videos
--- - Video Library
--- - Set Content
--- - TV Shows
--- - IMDB
--- - Music Videos
--- - Thumbnails
--- - FanArt
--- Music
--- - Music Library
--- - Music Navigation and Control
--- - LastFM
--- Weather
--- Settings
--- Plugins
--- Scripts
--- Filemanager
-- The Web Interface
- Advanced Topics ...
- FAQ'S ...
- XBMC's Inner Workings ...
- Appendixes ...

<<Edit this wiki toc>>


Note: XBMC is open source (GPL) software and as so the source code is available for anyone to modify and/or compile (under the rules of the GPL). This is only a copy and paste from the README.osx just to get this article started Please refer to the SVN version to be sure you got the latest edition!


TOC 1. Introduction 2. Getting the source code 3. Installing the required MacPorts packages 4. How to compile 4.1 Using XCode 4.2 Using Eclipse 4.3 Using Command line 5. How to run 6. Tips n' Tricks section 7. Endword


1. Introduction


This is a very early port of XBMC to OS X. It's target is developers and not end-users. We don't offer end-user support yet, and we're not really interested to hear about bugs unless you can help track it down and possibly help with fixing it. We currently recommend OS X 10.5.1 as a development platform.

NOTE TO NEW OS X USERS: All lines that are prefixed with the '$' character are commands that need to be typed into a Terminal window. Note that the '$' character itself should NOT be typed as part of the command.



2. Getting the source code


  $ cd $HOME
  $ svn checkout https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk/

3.0 Installing the required mpkgs or MacPorts packages


Install Xcode 3.0. You can download it from Apple's site after registration at (http://developer.apple.com/tools/download). You also need to install the 10.4 sdk.

it is important to make sure that any libs are also built using 10.4 sdk refs. It is not possible to build using MacPorts 1.6.0 to 10.4 sdk on a 10.5 system.

The best way to ensure this is to remove the existing MacPorts installation and install the required libs using MacPorts-mpkgs-1.1.zip download at

http://downloads.sourceforge.net/xbmc/MacPorts-mpkgs-1.1.zip

These libs are built to 10.4 sdk. You can still use MacPorts but the resulting binary will only run under 10.5 if built under 10.5.


3.1 Option A, Install the libraries mpkgs


Completly a previous install of MacPorts, enter the following from a terminal windows:

$ sudo rm -rf \ /opt/local \ /etc/manpaths.d/macports \ /etc/paths.d/macports \ /Applications/DarwinPorts \ /Applications/MacPorts \ /Library/LaunchDaemons/org.macports.* \ /Library/Receipts/DarwinPorts*.pkg \ /Library/Receipts/MacPorts*.pkg \ /Library/StartupItems/DarwinPortsStartup \ /Library/Tcl/darwinports1.0 \ /Library/Tcl/macports1.0

Download MacPorts-mpkgs-1.1.zip, unzip and install all packages.


3.2 Option B, Install MacPorts


Install MacPorts (http://www.macports.org/) again, then install the following packages from the Terminal window:

$ sudo port install lzo $ sudo port install glew $ sudo port install pcre $ sudo port install zlib $ sudo port install bzip2 $ sudo port install jam $ sudo port install boost $ sudo port install libogg $ sudo port install libmad $ sudo port install mysql5 $ sudo port install fribidi $ sudo port install libiconv $ sudo port install freetype $ sudo port install readline $ sudo port install fontconfig $ sudo port install libsdl $ sudo port install libsdl_image $ sudo port install libsdl_mixer

You will need to use samba3 version 3.0.28a so follow these instructions to setup MacPorts for a local dport repository:

(http://journal.bitshaker.com/articles/2007/10/20/install-old-versions-of-ports-using-macports/)

We will install the revision 34870 (version 3.0.28a). Edit /opt/local/etc/macports/sources.conf

and add "file:///Users/Shared/dports" BEFORE "rsync.macports.org". Then:

$ sudo mkdir /Users/Shared/dports $ cd /Users/Shared/dports $ svn co --revision 34870 http://svn.macports.org/repository/macports/trunk/dports/net/samba3 net/samba3 $ sudo portindex /Users/Shared/dports $ port list samba3 (in order to check if the new samba3 is listed) $ sudo port uninstall samba3 (if installed) $ sudo port clean samba3 $ sudo port install samba3@3.0.28a +darwin_8

Fix two MacPorts package default install locations with sym links

$ sudo ln -s /opt/local/include/mysql5/mysql/ /opt/local/include/mysql $ sudo ln -s /opt/local/Library/Frameworks/Python.framework/Versions/2.4/include/python2.4 /opt/local/include/python2.4


4. How to compile



4.1 Using Xcode


Start XCode and load the XBMC project.

Set the value to the path to the XBMC root folder. Project -> Edit Active Executable "XBMC", click "Arguments" tab and add "XBMC_HOME" as an enviroment variable. Set the value to the path to the XBMC root folder. For example, "/Users/bigdog/Documents/XBMC/linuxport/XBMC"

Build "configure", "python", Build "libraries", Build "XBMCHelper", then Build "XBMC".



4.2 Using Eclipse


Make sure you install support for C++ (the CDT plugins). Checkout the linuxport branch into your Eclipse project root. Right click on the project and select Build (note that this call out to the xcodebuild tool).


4.3 Using Terminal


Issue the following command from the top-level directory:

$ xcodebuild -parallelizeTargets -configuration Debug

You can also specify "Release" as a configuration.


5. How to run


Set the XBMC_HOME environment variable to point to a runtime environment (a good one is the directory inside XBMC.app, namely XBMC.app/Content/Resources/XBMC).

Then, to run the debug version:

$ build/Debug/XBMC

And the release version:

$ build/Release/XBMC


6. Tips n' Tricks section


Personal tools