fixed: playlist type wasn't set for plugin listings with sortdetails set
[vuplus_xbmc] / README.osx
1 TOC
2 1. Introduction
3 2. Getting the source code
4 3. Install required libs
5   3.1. Install Xcode
6   3.2. Install MacPorts 1.7
7 4. How to compile and run
8         4.1 Using XCode
9         4.2 Using Command line
10 5. Packaging
11
12 -----------------------------------------------------------------------------
13 1. Introduction
14 -----------------------------------------------------------------------------
15
16 This is a platform port of XBMC for the Apple OSX operating system. Both 10.5
17 and 10.4 Intel development platforms are supported. The current build system
18 is Xcode 2.5 or Xcode 3.1.2 There are two ways to build XBMC for Mac.
19 1) command-line or
20 2) Xcode.
21
22 Generally, Xcode is the easiest as it presents the build system in a GUI environment.
23 The command-line build is still under development.
24
25 XBMC for Mac is composed of a main binary with numerous dynamic libraries and
26 codecs that support a multitude of music and video formats.
27
28 NOTE TO NEW OS X USERS: All lines that are prefixed with the '$' character are
29 commands that need to be typed into a Terminal window. Note that the '$'
30 character itself should NOT be typed as part of the command.
31
32
33 -----------------------------------------------------------------------------
34 2. Getting the source code
35 -----------------------------------------------------------------------------
36
37  $ cd $HOME
38  $ svn checkout https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk
39
40 -----------------------------------------------------------------------------
41 3.0 Install XCODE
42 -----------------------------------------------------------------------------
43 Install latest Xcode. You can download it from Apple's site after registration at
44 (http://developer.apple.com/tools/download). You also need to install the 10.4
45 sdk. If using Xcode 3.x, you MUST use Xcode 3.1.2 so update your existing version
46 if you are running a previous Xcode 3.x version. Xcode 3.x only runs on 10.5.
47
48
49 -----------------------------------------------------------------------------
50 3.1 Install MacPorts 1.7
51 -----------------------------------------------------------------------------
52
53 These build instructions depend on MacPorts 1.7.1 from xbmc-port-depends at 
54 http://code.google.com/p/xbmc-port-depends/ .
55 If you have another version of MacPorts installed, it's best to remove it and
56 install this 1.7.1 version. To remove a previous install of MacPorts, enter the
57 following from a terminal windows:
58
59  $ sudo rm -rf \
60     /opt/local \
61     /etc/manpaths.d/macports \
62     /etc/paths.d/macports \
63     /Applications/DarwinPorts \
64     /Applications/MacPorts \
65     /Library/LaunchDaemons/org.macports.* \
66     /Library/Receipts/DarwinPorts*.pkg \
67     /Library/Receipts/MacPorts*.pkg \
68     /Library/StartupItems/DarwinPortsStartup \
69     /Library/Tcl/darwinports1.0 \
70     /Library/Tcl/macports1.0
71
72 Install MacPorts 1.7.1 (see http://code.google.com/p/xbmc-port-depends/). No NOT
73 install the versions from http://www.macports.org, they were hopelessly broke
74 for XBMC usage when their devs released MacPorts 1.8. Change MacPorts's behavior
75 to always build universal against 10.4sdk using the following instructions.
76
77  1)
78    $ sudo nano /opt/local/etc/macports/macports.conf
79    a) change "universal_target  10.5" to "universal_target      10.4"
80
81    b) change "universal_sysroot /Developer/SDKs/MacOSX10.5.sdk" to
82      "universal_sysroot /Developer/SDKs/MacOSX10.4u.sdk"
83
84    c) change "universal_archs         ppc i386"
85      to reflect the arch you are building by removing the unused arch.
86
87  2) These are needed to build openssl (used by samba3 and mysql5) against 10.4sdk
88    $ sudo ln -s /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/dylib1.o /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/dylib1.10.5.o
89    $ sudo ln -s /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/crt1.o /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/crt1.10.5.o
90
91
92 Then install the following port packages (order is very important):
93
94  $ sudo port install pcre +universal
95  $ sudo port install expat +universal
96  $ sudo port install libiconv +universal
97  $ sudo port install gettext +universal
98  $ sudo port install libtool yasm cmake gmake pkgconfig
99
100  $ sudo port install lzo +universal
101  $ sudo port install lzo2 +universal
102  $ sudo port install bzip2 +universal
103  $ sudo port install fontconfig +universal
104  $ sudo port install boost +universal
105
106  $ sudo port install jpeg +universal
107  $ sudo port install tiff +universal
108  $ sudo port install libpng +universal
109  $ sudo port install libogg +universal
110  $ sudo port install libvorbis +universal
111  $ sudo port install libmad macosx_deployment_target=10.4
112  $ sudo port install fribidi +universal
113  $ sudo port install libmms +universal
114  $ sudo port install wavpack +universal
115  $ sudo port install libmpeg2 +no_sdl +no_x11 +universal
116
117  $ sudo port install glew +universal
118  $ sudo port install libcdio +universal
119  $ sudo port install openssl +universal
120  $ sudo port install samba3 macosx_deployment_target=10.4
121  $ sudo port install mysql5 +universal
122  $ sudo port install sqlite3 +universal
123  $ sudo port install libsamplerate +universal
124
125  $ sudo port install libsdl +no_x11 +universal
126  $ sudo port install smpeg +universal
127  $ sudo port install libsdl_mixer +universal
128  $ sudo port install libsdl_image +universal
129
130 If you understand the following two lines, you can run it to automate
131 the installation of the ports in the above order:
132
133   sudo bash
134   perl -ne 'print `port install $1` if /^ \$ sudo port install (.*)$/;' README.osx
135
136 Finally, fix the mysql package default install location with this symlink:
137
138  $ sudo ln -s /opt/local/include/mysql5/mysql/ /opt/local/include/mysql
139
140 -----------------------------------------------------------------------------
141 4. How to compile
142 -----------------------------------------------------------------------------
143 Both Xcode and Terminal compilation require that build environment be setup
144 first. This is a simple step and involves the following:
145
146  $ cd $HOME/XBMC
147  $ ./bootstrap
148  $ make -C lib/librtmp
149  $ sudo make -C lib/librtmp install
150  $ ./configure
151  $ make clean
152  $ make xcode_depends
153  $ make -C lib/addons/script.module.pil
154  $ make -C lib/addons/script.module.pysqlite
155  $ sh lib/librtmp/darwin_package_librtmp.sh
156
157 The configure operation will setup the build environment for codecs and
158 internal libraries that are used by XBMC. This step is required for both Xcode
159 and command-line building. The "make clean" ensures that there are no stale
160 binaries from svn that might cause problems The last step will pre-build
161 the majority of the codecs and libs:
162
163
164 The configure operation will default to building "debug". To build "release"
165 codecs and libraries for Xcode, do the configure step with "--disable-debug"
166 but remember that Xcode will need to be also built "Release":
167
168  $ ./configure --disable-debug
169
170 -----------------------------------------------------------------------------
171 4.1 Using Xcode
172 -----------------------------------------------------------------------------
173 Start XCode and open the XBMC project (XBMC.xcodeproj) located in $HOME/XBMC.
174 For development, XBMC is run from the $HOME/XBMC directory and needs to have
175 the XBMC_HOME environment variable set to know where that directory is located.
176 To set XBMC_HOME environment variable:
177
178 Menu -> Project -> Edit Active Executable "XBMC", click "Arguments" tab and
179 add "XBMC_HOME" as an enviroment variable. Set the value to the path to the
180 XBMC root folder. For example, "/Users/bigdog/Documents/XBMC"
181
182 There are two build targets "XBMC" and "XBMC.app" with debug and release
183 settings. The "XBMC" target is used for rapid build and debug cycles while
184 the "XBMC.app" target is used to build a self contained OSX application.
185
186 Set the build target to "XBMC" or "XBMC.app", then build. The build process
187 will take a long time when builting the first time. You can see the progress
188 in "Build Results". There are a large number of static and dynamic libaries
189 that will need to be built. Once these are built, subsequent builds will be
190 faster.
191
192 After the build, you can ether run XBMC for Mac from Xcode or run it from
193 the command-line. If you run it from the command-line, make sure your set
194 the XBMC_HOME environment variable (export XBMC_HOME=$HOME/XBMC). Then, to
195 run the debug version:
196
197 $ ./build/Debug/XBMC
198
199 Or the release version:
200
201 $ ./build/Release/XBMC
202
203 You can also build via Xcode from the command-line using the following:
204
205 $ xcodebuild -configuration Release -target "XBMC.app" -project XBMC.xcodeproj
206
207 You can specify "Release" instead of "Debug" as a configuration.
208
209 -----------------------------------------------------------------------------
210 4.2 Using Terminal (command-line) (this is a work in progress and might fail)
211 -----------------------------------------------------------------------------
212 There are two methods, a) make/Xcode and b) make (which might fail as it's under
213 construction).
214
215 If you want to build a cross-compiled version that can run under 10.5/10.4/AppleTV, 
216 then you'll need to follow the additional steps listed in $HOME/XBMC/tools/XBMCTex/README.osx
217 before running xcodebuild from the command-line.
218
219  a)
220  $ cd $HOME/XBMC
221  $ export XBMC_HOME=`pwd`
222  $ make xcode_depends
223  $ make -C lib/addons/script.module.pil
224  $ make -C lib/addons/script.module.pysqlite
225  $ sh lib/librtmp/darwin_package_librtmp.sh
226  $ xcodebuild -sdk macosx10.4 -project XBMC.xcodeproj -target XBMC.app -configuration Release build
227
228  b)
229  $ cd $HOME/XBMC
230  $ export XBMC_HOME=`pwd`
231  $ make xbmc
232  $ ./xbmc.bin
233
234 -----------------------------------------------------------------------------
235 5. Packaging
236 -----------------------------------------------------------------------------
237 This section describes how to package XBMC in a disk image for
238 distribution.
239
240   1. build XBMC.app from XCode so that the application bundle is correctly updated.
241
242   2. make -C tools/PackageMaker/
243
244   3. If completed successfully, a disk image named XBMC_for_Mac.dmg will be
245   present in the users XBMC build directory:
246
247 Remember to unmount/eject XBMC.dmg before attempting to recreate it,
248 otherwise dmgmaker.pl will fail.