# Auditeon

### Site Tools

software:osx:scantailor

# Building scantailor on Mac OSX

This page describes how to install scantailor on Max OSX. A lot of thanks go to Rob and jart
Please see also here: https://sourceforge.net/apps/phpbb/scantailor/viewtopic.php?f=6&t=8&start=0

## Installation of scantailor with Qt and MacPorts on os x 10.5.8

If you haven't done so, start reading here: http://guide.macports.org/. The installation of Macports requires the following:

• Download Xcode from Apple and install it (It automatically updates the current version).
Note that the 10.5 compatible Xcode is a bit hidden away. In the Mac Dev Center → Member Site (in right column); it requires another login. Member Site → Downloads. Download → Developer Tools (In right column).
• Install X11 User from the osx installation dvd
• Download and install MacPorts (1.8.1 - 10.5 Leopard)

Test your installation with

sudo port -v selfupdate

### Install qt4-mac

Install qt4-mac1) (This installed version 4.5.3_0 and took about 6 hours on my PowerBook G4, so take your time):

sudo port install qt4-mac
After you have installed Qt using MacPorts, you should create a symbolic link to prevent the error reporting that “Qt4 could not be found”. This is because MacPorts installs qmake with the filename 'qmake-mac' and not 'qmake'. Do the following (Assuming MacPorts uses /opt/local/bin):

cd /opt/local/bin
sudo ln -s qmake-mac qmake

Note that if you do not want to create a symbolic link you can alternatively use the command cmake -DQT_QMAKE_EXECUTABLE=/opt/local/libexec/qt4-mac/bin/qmake

Before installing cmake, first install boost. If boost would be missing, cmake would throw an error that it “Could not find boost headers or libraries.” and “You may need to install a package named libboost1.35-dev or similarly.”

Install boost (It installed boost 1.40.0_1+powerpc)

sudo port install boost

### Install cmake

sudo port install cmake

After about 20 minutes, version 2.6.4_1 is successfully installed.

### Install scantailor

Browse to the following directory:

cd /Users/Shared

In that directory in your favorite shell make a local copy of scantailor sources with svn, by entering the svn command to check out the sources2):

svn co https://scantailor.svn.sourceforge.net/svnroot/scantailor scantailor

For now, ignore the fingerprint warning. Just enter t (temporarily)
Once finished cd into the scantailor directory and type:

cmake .

(notice the space and the dot) It should say something like:

  -- Checking pthreads with CFLAGS="" and LIBS="" -- yes
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/Shared/scantailor/scantailor/trunk

Then perform the make of scantailer with:

make

You should find Scantailor.app in same directory (/Users/Shared/scantailor/)

However, starting Scantailor.app by double clicking it, will give a window with the text 'You can't open the application “Scantailor” because it is not supported on this architecture'.
Nevertheless, if I browse to

/Users/Shared/scantailor/Scantailor.app/Contents/bin

and start from there ./scantailor, the application will start.

If you want to make it executable by clicking the application, you could modify the Package Contents. (I took some files from the memorytest application Rember and modified Info.plist)
Moving scantailor from the original directory to Contents\MacOS\.
Adding a Info.plist file
Adding a Pkginfo file
Adding a English.lproj directory, containing InfoPlist.strings and MainMenu.nib
Adding a Resources directory, containging an icon for scantailor: scantailor.icns

## Packaging scantailor

(See http://www.stellarium.org/wiki/index.php/Compilation_on_Macosx for general info about compiling and packaging for osx) The macosx_bundle target includes a perl script that makes use of otool and install_name_tool to:

1. read the link dependencies of scantailor.app/Contents/MacOS/scantailor
2. copy those dependencies into the app (.frameworks and .dylibs)
3. recurse on those copied-in dependencies, stopping at a point where system libraries are called for

This seems to work for making a relocatable scantailor.app. Making a universal build from here is a matter of taking an intel and a ppc and merging them appropriately.

I've found that making a universal app directly via cmake to not work, even the better mac-supporting 2.6. Any insights appreciated!

To get CMake to do all the packaging and linking above (to take better advantage of cmake 2.6), we need to re-arrange the CMAke properties a bit across all the ports, and this is a somewhat larger undertaking.

## Updating sources

You can check to see if the source code has been updated on the server at any time by going in a terminal window to:

/Users/Shared/scantailor/trunk

And enter the command

svn -u status

Any file that it mentions is either changed locally, or changed on the server (svn help status for details of the output of this command). Unless you are working on the source code yourself, anything mentioned is an update. You can update from this directory also with:

svn update

IMPORTANT: you should delete or move aside the old /Users/Shared/scantailor/scantailor.app before each new build.

## Troubleshoot

Install boost if you receive the following error:

CMake Error at CMakeLists.txt:159 (MESSAGE):
Could not find boost headers or libraries.

You may need to install a package named libboost1.35-dev or similarly.
1)
Initially this didn't work, because the Xcode version I was using, coming from the OSX installation dvd, was too old. That's the reason why one should download the proper Xcode version
software/osx/scantailor.txt · Last modified: 2009/10/22 12:17 by admin