Difference between revisions of "Build Panini on MacOSX"

From PanoTools.org Wiki
Jump to navigation Jump to search
Line 26: Line 26:
 
You need to get and install Subversion from MacPorts as Tiger comes without subversion and Leopard has a way too old version of subversion.
 
You need to get and install Subversion from MacPorts as Tiger comes without subversion and Leopard has a way too old version of subversion.
 
<blockquote><pre>$ sudo port install subversion</pre></blockquote>
 
<blockquote><pre>$ sudo port install subversion</pre></blockquote>
 +
<br><br>
  
 
==General "pre-build" steps==
 
==General "pre-build" steps==

Revision as of 21:46, 4 June 2009

Introduction

Panini is a visual tool for creating perspective views from panoramic and wide angle photographs. More than a pano viewer, more than a view camera, with features of both. For Linux/Unix, Win32, and Mac systems with OpenGL 2.0.
You can find Panini on Panini's project area on Sourceforge.net.


This wiki page explains how to build Panini on MacOSX and it contains two "build" sections.

  • Build Panini straightforward for your system only.
  • Build a complete portable Universal Panini (for distribution).


Note: The steps with an asterix between brackets (*) behind it are only neccessary if you build from svn source. If you download the "panini-0.63.94R-src.zip" source package, you don't need MacPorts or svn.

Building environment

Download and install XCode

Download and install the XCode Tools version for your MacOSX version: Xcode 2.5.x for MacOSX 10.4.x or below and Xcode 3.1.x for 10.5.x (Leopard).

Install QT

Get and install the Trolltech QT Framework. Download it from QTsoftware. Select the "LGPL / Free" version. Select the "Download Qt 4.x libraries for Mac" and download the default Carbon set if you want to build for Tiger 10.4 and Leopard 10.5 (I didn't test the Cocoa version yet).

Install Macports (*)

Note: If you don't want to install MacPorts you can also download the binary svn version from collab.net. This enables you to skip this step (Install MacPorts) and the following step (install subversion). You don't need subversion anyway if you download a "release source package".

If you don't have it already, install MacPorts, which provides the port command, from MacPorts, giving you compilable package access to thousands of pieces of open source software. If you already have macports (formerly darwinports) installed, update it:

$ sudo port selfupdate

Make sure you have synced the latest port files:

$ sudo port -d sync

Subversion (SVN) (*)

You need to get and install Subversion from MacPorts as Tiger comes without subversion and Leopard has a way too old version of subversion.

$ sudo port install subversion



General "pre-build" steps

You can build Panini either:

  • from the source package "panini-0.63.94R-src.zip"
  • from SVN.

Currently (early June), the stable version is 0.63.94. You can just as well download that source package and skip the svn build.


Get Panini from stable source

Download the source code from the Panini project area. Unzip it.


Get Panini from SVN (*)

Check out the Panini sources from SVN and download them into your home directory (for example), like:

$cd ~
$ svn co https://pvqt.svn.sourceforge.net/svnroot/pvqt Panini

This will create a Panini directory with the Panini source inside.
If you are asked to accept the ssl key from the sourceforge svn server, you need to accept it: either temorarily (p) or permanently (p).

Make XCode project

Cd into the Panini directory.

Run the following command inside the Panini source code directory:

$ qmake panini.pro

This will create your Panini.xcodeproj project.

Build Panini straightforward for your system only

As mentioned: You can build Panini straightforward with the generated XCode project. This will generate an application that will run perfectly on your system, but on your system only. You can also build it as a complete portable Universal application which will run on any 10.4.x Tiger or 10.5.y Leopard Mac. See the next section of this wiki for that build type.

  • Double-click the "Panini.xcodeproj" project inside you Panini source directory.
  • Once your project has opened you see the the long rectangular "Project" button. Click it and set your project to "Release" and to your Mac's architecture: "PPC" or "i386" (it will default to the correct one).
  • Navigate to "Targets" and open it so that you can see the "Panini" target. Select the Panini target and right-click (or ctrl-click) it and select "build Panini".
  • Once your project has succesfully built, you will find the "Panini.app" inside your source directory inside "./build/Release".
  • Copy this app to a location of your liking where "/Applications" would be the most appropriate one.

Note again: This freshly built application will run fine on your system, but only on your system.

Build a complete portable Universal Panini

Pre build configuration steps

Before we build this portable Universal Panini we need to modify a script file.

  • Cd into the mac directory inside you Panini source directory.
  • Open the "complete-bundle.sh" script file in a text editor.
  • You will find the lines:
# The App_path should contain the complete full path from / to where 
# your source code folder is
Panini_path=/Users/Shared/development/Panini0.63.86

So if you're Spiderman and you created the source directory "Panini" in your home directory, the "Panini_path" line should read:

Panini_path=/Users/Spiderman/Panini

.

Below this (variable) line you should not need to modify anything.

Set correct Panini project settings

Use Finder to find the "Panini.xcodeproj" inside your Panini source directory and double-click to open the project.

  • Set project build type to Release.
    • Select the long rectangular "Project" button. Click it and set your project to "Release".
  • Set Main project settings
    • Double-click the blue icon (with Panini) in the top-left of the navigation.
    • Select the build tab.
      • section Architectures.
        • set "Architectures" to "Standard (32-bit Universal)"
        • set base SDK to "Mac OS X 10.4".
      • Section Deployment
        • set "Deployment target" to "Mac OS X 10.4" (Note: OpenGL vs 2 is not available on 10.3).
      • Section GCC 4.0 - Code generation
        • set "Instruction Scheduling" to "none".
        • Close window by clicking the red "bulb" of this popup.
  • Set Panini target settings.
    • Double-click the "Panini target" inside "Targets".
    • Select the build tab.
      • section Architectures.
        • set "Architectures" to "Standard (32-bit Universal)"
        • set base SDK to "Mac OS X 10.4".
      • Section Deployment
        • set "Deployment target" to "Mac OS X 10.4" (Note: OpenGL vs 2 is not available on 10.3).
      • Section GCC 4.0 - Code generation
        • set "Instruction Scheduling" to "none".
    • Select the properties tab
      • set "Identifier" to "Panini.sourceforge.net".
      • set "Creator" to "TKSH".
      • set "Icon File" to "/Users/Spiderman/Panini/mac/appIcon.icns". (Remember you were Spiderman building inside a Panini source directory inside your home directory?)
    • Close the popup window by clicking the red "bulb" of the window.
  • Add "run script" build phase to Panini target.
    • Click the triangle in forn the Panini target to open it.
    • Right-click (or Ctrl-click) the Panini target
    • Select "Add -> New Build Phase -> New Run Script Build Phase"
    • Type inside the "big" script window: "sh mac/complete-bundle.sh" (without the double-quotes).
    • Close this popup window. You will see a new "Run Script" build phase added.
    • Right-click (or Ctrl-click) the "Run Script" phase and rename it to "Complete bundle".

Build Panini

Now you can right-click (or Ctrl-click) the Panini target. Select the "Build Panini" option and wait untill it's finished building.
Note: The Panini.app in your source-directory/build/Release directory is the correct Universal one, not the one in your root source directory.

Once this build has finished successfully, you can copy it to any location but "/Applications" would be the most appropriate location.

Distributing the Universal Panini

  • Create a directory "Panini-<version>-mac" where version is your Panini version, like 0.63.90
  • Copy the Panini.app from your "<Panini_source_directory>/build/Release" into this newly created "Panini-<version>-mac" directory.
  • Copy the "GPLversion3.txt", the "panini-<version>-release.txt", the "panini-build.txt" and the "panini-usage.txt" from the source directory also into this Panini-<version>-mac directory.
  • With Finder go to "/Applications/Utilities" and start the "Disk Utility.app".
  • From the menu select "File -> New -> Disk Image from Folder"
  • Select the created "Panini-<version>-mac" directory.
  • Make a standard compressed dmg image and share the resulting "Panini-<version>-mac.dmg" with the world.