MythTV on Mac OSX build
- 1 Building Automatically
- 2 Contribute the build to the community
- 3 Building Manually
So you've decided that you want to compile Myth on your Mac under OS X. Normally, the easiest way to do that is to download the packager script (osx-packager.pl). Running the packager script then downloads several pre-requisites, the myth source and builds the application bundles. However, you must also have the XCode development environment installed on your Mac before you begin.
In order to run the build you will need the following:
- git (optional)
- Xcode for your OS X release
- MythTV packager
- Firewire SDK (optional)
- internet connection
Install this package. It installs the binaries into /usr/local/git/bin so you'll either need to update your path, or restart your terminal window, or logout and back in again (via ssh).
Xcode and Firewire SDK
XCode is essential since it installs the compiler, linker and other support utilities.
Xcode and the Firewire SDK are both available from the apple developer site. You will need to register as an apple developer. Select the 'Safari' option as its free :D
The Firewire SDK is needed if you a) intend to build the backend, and b) want the backend to be able to record from a firewire device.
Several critical pieces of Myth code are written in X86 assembler, using yasm, to obtain maximum performance. XCode, however, does not include yasm. Myth also provides alternate code so that yasm is not strictly necessary. However, things like the on screen display may be sluggish without it.
Yasm can be downloaded from http://www.tortall.net/projects/yasm/wiki/Download Unpack it, configure it with the defaults and install it.
The easiest way to build MythTV from source is to download the packager script. The packager scripts downloads the source and builds the release.
You need to obtain the correct packager for your release. After obtaining the packager you can comment out the packager lines disabling MMX.
Note that a new version of the build script was created in February 2012 ("osx-packager-10.7.pl"). The goal is to support different versions of Mac OS X (10.5, 10.6, 10.7 etc) together with their related versions of XCode (3.2, 4.2, 4.3). At this point, Myth 0.25 is nearing release and the new script supports building it. A major change is the requirement for QT 4.8 and note that the readme indicates that compiling QT 4.8 from source can require multiple tries. The rest of the documentation on this page is geared towards building 0.24.x and should be updated when 0.25 is released.
Stable release (recommended)
git clone -b OSX-fixes git://github.com/MythTV/packaging.git
git clone git://github.com/MythTV/packaging.git
Make a copy of osx-packager.pl in the directory you want to be the top-level for your build. Make the script executable, as follows:
chmod +x osx-packager.pl
If you run the script with either the -help or -man options, it will give a summary of the usage options.
Once you have obtained all of the pre-requisites you are ready to build. There are several command line options to the osx-packager.pl script that control exactly what all will be built.
Selecting a version to build
The MythTV developers use github, (formerly subversion) to manage the source code. There are three main subdivisions to consider:
- master (formerly trunk)
Use the 'git-rev' option to select the version to build. For example
Use osx-packager.pl's '-plugins' option to specify the plugins you want to include. Use
-pluginskip to supress building any plugins.
Currently, the following plugins won't work on Mac OS X:
- MythGame - no compatible games
- MythNetVision - not currently ported to Myth for Mac OS.
MythGallery requires exif and/or new-exif if you want to be able to see information related to camera settings that may be embedded in your pictures. The opengl option must be enabled if you want to have transition effects shown between pictures in a slide show. osx-packager.pl should have downloaded and built this code but you have to enable it, eg:
MythWeather requires Myth's Perl bindings. The Perl bindings, in turn, rely on certain perl modules that are not present by default. All the required perl modules can be obtained from the Comprehensive Perl Archive Network (CPAN). Read up on cpan to learn how to install these modules. (Hint: run cpan as the super users, ie 'sudo cpan Module::Name'.)
Putting it all together
The other relevant options are -verbose and -m32. The -verbose option will report a great deal of detail about the build which can be very helpful if there is a failure. The -m32 option prevents the creation of 64 bit code.
If you want the backend as well, use the -enable-backend flag. Use -enable-jobtools to build an application that will process jobs (eg commercial flagging) from the backend's job queue.
osx-packager.pl -gitrev OSX-fixes -enable-backend -enable-jobtools -plugins mythbrowser,mythgallery,mythmusic,mythnews,mythvideo,mythweather,opengl,exif,new-exif-m32 -verbose
Assuming all goes well, you should end up with at least three applications ready to test.
Building a release tag (recommended):
chmod +x osx-packager.pl ./osx-packager.pl -svntag release-0-24 | tee build24.log
Building a branch:
chmod +x osx-packager.pl ./osx-packager.pl -svnbranch release-0-24 | tee build24.log
Building the trunk (if you are prepared to bleed):
chmod +x osx-packager.pl ./osx-bundler.pl | tee buildSVN.log
Approximate Build Times
- Mac Mini: 3 hours
- Mac Pro: 45 minutes
Contribute the build to the community
Now you have a build and as I'm sure your mum always said 'you need to share' ;).
You can help the community by contributing your build to the sourceforge project MythTV for MacOSX which has been set up to host release build of MythTV for the Mac OSX. If you do this, please make sure your build has FireWire support.
You can find details on how to contribute your build on the contributors page.
Sadly, the packager script doesn't always work. Maybe one of the downloadable dependencies has been outdated, and someone needs to try building against a newer one. Maybe the MythTV source code has changed and broken Mac builds. Look on the Myth_on_Mac_-_Build_status page for hints about this. For instructions about building by hand, see Building MythTV on Mac OS X