Compile instructions (Mac OS X 10.5) - SVN trunk

עודכן לפני 5 שנים

Here are the steps to create an universal binary from MuseScore SVN trunk.
Please note that some steps might not be required but I document them because it works on my system by following them.
These instructions have been tested on Mac Intel with Mac OS X 10.5.8.

Overview

The whole build process takes 1 hour and 30 minutes on a Macbook 2GHz. Downloading and installing all the tools and dependencies can take one hour more but it's just a one time process.
The result of the build process is a DMG file ready to be distribute and suitable for PPC and Intel on Mac OS X Tiger and Leopard.

Setup the build and development environment

  1. Install the Developer Tools from Apple. They are included with OS media. Developer Tools includes a command line svn client and Xcode, the Apple IDE. The last version for 10.5 is Xcode 3.1.4 Developer Tools.
  2. Open a terminal and in your home
    mkdir musescore
    cd musescore
    svn co https://mscore.svn.sourceforge.net/svnroot/mscore/trunk mscore 
    
  3. Install Cmake 2.8.2. The dmg installation is ok.
  4. Install Qt SDK 4.6 from the dmg file. Choose the SDK not the Framework only download.
  5. Install macports 1.9.1. Dmg is fine as well.
  6. Configure macports to install 10.4 compliant ports by changing these lines in /opt/local/etc/macports/macports.conf
    universal_target  10.4
    universal_sysroot      /Developer/SDKs/MacOSX10.4u.sdk
    
  7. In a terminal, install portaudio and libsndfile with macport. Pkgconfig is also required to help cmake finding these libs.
    Note the +universal for libsndfile to generate universal binaries. It's default for portaudio apparently.
    sudo port install pkgconfig
    sudo port install portaudio
    sudo port install libsndfile +universal
    sudo port install lame
    
  8. Install JackOSX and copy the pkgconfig file to the good place.
    sudo cp /usr/local/lib/pkgconfig/jack.pc /opt/local/lib/pkgconfig/
    

Build MuseScore

  1. In a terminal, go into mscore directory
    cd ~/musescore/mscore
  2. Set the revision number for this build.
    make revision
  3. Start the actual compilation. It takes more than 1 hour on macbook 2Ghz
    make -f MakeFile.osx release

    if you are a developer, take a look to the release target in the makefile. You'll see that it generates a xcodeproj file and calls xcodebuilder to build it as a command line. Of course, you can open this xcodeproj file and enjoy the Apple IDE to modify MuseScore code, correct bugs, compile, debug etc... Patches are welcome on the dev mailing list.

  4. Call the install target. The bundle is copied from Release directory into applebuild directory. All resources (help, templates etc...) are added to it.
    make -f MakeFile.osx install
  5. Package step. This target calls a script derived from this one. It creates a self contained bundle thanks to macdeployqt by adding and stripping the Qt libraries into the MuseScore bundle. It also adds Qt plugins, portaudio and libsndfile. A dmg file is created with a nice background and well positioned icons.
    make -f MakeFile.osx package

Happy building!