Testing:Mac OS X Testing Environment

Mac OS X Nightly Build
The easiest way of testing OpenLP is to use the Nightly Build. Note however that this may sometimes be a day or two out of date. You can check when it was created on the OpenLP Twitter account.

If you want to run the most up to date version, the following steps will guide you through the process:

Installing Required Software
In order to run the very latest "trunk" (where approved code is updated before release) or developers' personal branches, you will need to install several pieces of extra software. OSX comes with Python pre-installed, but unfortunately it does not have all the required modules. The recommended way to set up the installation is using mac ports, a free software repository which lets you install different versions of many standard *NIX programs & libraries.

The recommended version of Python is 3.4

Getting source code
You can get a very recent revision of OpenLP via the "nightly build" tarball, or you can get the latest version directly via Bazaar (recommended if you want to do development on OpenLP).

Nightly Build
The nightly build is a source tarball (.tar.gz file) of a recent revision. The tarball is generated each night. To see when the tarball was last created, check the OpenLP Twitter account. Simply download this file to your computer, and then extract it.

Install XCode
For recent OSX (Lion, Mountain Lion, or Mavericks) you can install XCode from the App Store (it's free). For older versions of OSX, you can use your Mac OS X Install DVD install a version for your OS X environment (for 10.5 it is 3.1.4, for 10.6 it is 3.2.6). There's more information about XCode at developer.apple.com.

XCode contains gcc or clang (C/C++ compiler) and other development tools necessary to set up the testing environment via mac ports.

Install MacPorts
Download and install MacPorts from http://www.macports.org/install.php

Settings for Mac OS X Compatibility
It is recommended to make the macports installation compatible with older OS X version. Otherwise OpenLP builds won't work on older OS X releases. For instance, without the following settings OpenLP build from 10.7 won't run on 10.6.

Open the following file in a text editor

/opt/local/etc/macports/macports.conf

and add the following:

macosx_deployment_target           10.8 MACOSX_DEPLOYMENT_TARGET           10.8 SDKROOT                            /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk
 * 1) MACOSX_DEPLOYMENT_TARGET - osx version to be compatible with earlier OSX version.

Tools from Macports in PATH
When you install Macports, it should make itself accessable from the terminal. However, if you choose not to let it do that when you install it, you can do it manually:

We need to modify the environment variable $PATH.

Open the following file in a text editor

/Users/USERNAME/.profile

and add at the end line

export PATH=/opt/local/bin:$PATH
 * 1) Adding an appropriate PATH variable for use with MacPorts.
 * 1) Finished adapting your PATH environment variable for use with MacPorts.

To have tools from macports available in your currently open terminal run command

source ~/.profile

Update list of available packages
To be able to install latest version of libraries you usually need to tell MacPorts to update the package list:

sudo port -v selfupdate

Install basic development tools
Now we are ready to use MacPorts to install python, libraries and other tools. If you want to use Bazaar, or vim, etc. then you can install them now (if you already have an editor, and you want to use the Nightly Build Tarball, then you can skip this):

sudo port install bzr git_core wget vim htop

Install Python and Libraries
Now you can install libraries. This can take a lot of time (several hours) compiling the Qt4 libraries:

sudo port install python34 py34-pyqt4

[Deprecated: For Python 3 you need to add new packages to macports from https://github.com/matysek/macports (follow README.md instructions).]

Then to complete run following:

sudo port install python34 py34-lxml py34-sqlalchemy py34-mako py34-nose py34-mock py34-beautifulsoup4 py34-psycopg2 py34-sphinx py34-alembic py34-chardet py34-Pillow

TODO: py33-enchant for me still fails to compile. If it fails for you too then it can be skipped.

TODO: mysql-python (py27-mysql, mysqldb) is not ported to Python 3 yet. Find alternative mysql bindings (e.g. oursql) or wait for mysql-python to work with Python 3.

TODO: py34-appscript needs to be installed via pip

TODO: submit modified macports files to upstream.

If you aren't using macports' python2.x, then you can make Python 3.3 the default python:

sudo port select --set python python34

If you want to keep on using python 2 as your default python, you can set Python 3.3 only to be your default 'python3':

sudo ln -s /opt/local/bin/python3.3 /opt/local/bin/python3

Install Dictionaries
Dictionaries help with spell checking while writing lyrics and other text in OpenLP. Install the aspell or hunspell dictionaries you like:

sudo port install hunspell-dict-en_US aspell-dict-uk

For other available dictionaries you can search by

port search hunspell port search aspell

Verify Installation
To verify the installation checkout the source code of OpenLP and run the following script:

python OPENLP_SRC_DIR/scripts/check_dependencies.py

The output should be similar to the following:

bash-3.2$ python scripts/check_dependencies.py  Python >= 3.0 ... 3.3.2.final.0 Checking for modules... PyQt4... OK PyQt4.QtCore... OK PyQt4.QtGui... OK PyQt4.QtNetwork... OK PyQt4.QtOpenGL... OK PyQt4.QtSvg... OK PyQt4.QtTest... OK PyQt4.QtWebKit... OK PyQt4.phonon... OK sqlalchemy... OK alembic... OK sqlite3... OK lxml... OK chardet... OK enchant... FAIL bs4... OK mako... OK uno... FAIL Checking for optional modules... MySQLdb (MySQL support)... FAIL psycopg2 (PostgreSQL support)... OK nose (testing framework)... OK mock (testing module)... OK Verifying version of modules... PyQt4 >= 4.6 ... 4.10.3 Qt4 >= 4.6 ... 4.8.5 sqlalchemy >= 0.5 ... 0.8.2 enchant >= 1.3 ... FAIL Qt4 image formats...  read: b'bmp', b'gif', b'ico', b'jpeg', b'jpg', b'mng', b'pbm', b'pgm', b'png', b'ppm', b'svg', b'svgz', b'tga', b'tif', b'tiff', b'xbm', b'xpm' write: b'bmp', b'ico', b'jpeg', b'jpg', b'png', b'ppm', b'tif', b'tiff', b'xbm', b'xpm' Enchant (spell checker)... FAIL bash-3.2$

Optional development tools
The following tools are not necessary to run the source code but are useful for debugging and improving code quality:

sudo port install py34-pep8 py34-pyflakes py34-ipython

Getting rid of session error
After installation of dbus package, you need to run the following commands:

sudo launchctl load -w /Library/LaunchDaemons/org.freedesktop.dbus-system.plist sudo launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist

Otherwise OpenLP might not start correctly!

Getting the latest versions
From time to time newer library versions are available, to install them do first a

sudo port selfupdate

to update MacPorts itself, then run

sudo port upgrade outdated

to upgrade the existing tools and libraries.

Hints
The OpenLP log file is at /Users/USERNAME/Library/Application Support/openlp/openlp.log

Other way to installing Bazaar
If you followed the instructions, the command line Bazaar (bzr) client should be installed. However, you can use the official version for Mac OS X. Go to the Bazaar download page, and download and install the version of Bazaar for your version of Mac OS X.

Configuring SSH
See the instructions on setting up SSH on Linux and Mac OS X.