changes to support packaging of the GTK-Quartz version of Ardour for OS X

git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2338 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2007-08-22 04:30:29 +00:00
parent 4f4d82c998
commit 7b5573f185
26 changed files with 570 additions and 1524 deletions

View file

@ -30,6 +30,7 @@ opts.AddOptions(
BoolOption('AUDIOUNITS', 'Compile with Apple\'s AudioUnit library. (experimental)', 0), BoolOption('AUDIOUNITS', 'Compile with Apple\'s AudioUnit library. (experimental)', 0),
BoolOption('COREAUDIO', 'Compile with Apple\'s CoreAudio library', 0), BoolOption('COREAUDIO', 'Compile with Apple\'s CoreAudio library', 0),
BoolOption('GTKOSX', 'Compile for use with GTK-OSX, not GTK-X11', 0), BoolOption('GTKOSX', 'Compile for use with GTK-OSX, not GTK-X11', 0),
PathOption('GTKOSX_PREFIX', 'Configure-style prefix used to install GTK-Quartz', "/opt/gtk"),
BoolOption('DEBUG', 'Set to build with debugging information and no optimizations', 0), BoolOption('DEBUG', 'Set to build with debugging information and no optimizations', 0),
PathOption('DESTDIR', 'Set the intermediate install "prefix"', '/'), PathOption('DESTDIR', 'Set the intermediate install "prefix"', '/'),
EnumOption('DIST_TARGET', 'Build target for cross compiling packagers', 'auto', allowed_values=('auto', 'i386', 'i686', 'x86_64', 'powerpc', 'tiger', 'panther', 'none' ), ignorecase=2), EnumOption('DIST_TARGET', 'Build target for cross compiling packagers', 'auto', allowed_values=('auto', 'i386', 'i686', 'x86_64', 'powerpc', 'tiger', 'panther', 'none' ), ignorecase=2),
@ -711,6 +712,11 @@ if env['LIBLO']:
def prep_libcheck(topenv, libinfo): def prep_libcheck(topenv, libinfo):
if topenv['DIST_TARGET'] == 'panther' or topenv['DIST_TARGET'] == 'tiger': if topenv['DIST_TARGET'] == 'panther' or topenv['DIST_TARGET'] == 'tiger':
#
# rationale: GTK-Quartz uses jhbuild and installs to /opt/gtk by default.
# All libraries needed should be built against this location
if topenv['GTKOSX']:
libinfo.Append(CCFLAGS="-I/opt/gtk/include", LINKFLAGS="-L/opt/gtk/lib")
libinfo.Append(CCFLAGS="-I/opt/local/include", LINKFLAGS="-L/opt/local/lib") libinfo.Append(CCFLAGS="-I/opt/local/include", LINKFLAGS="-L/opt/local/lib")
prep_libcheck(env, env) prep_libcheck(env, env)

View file

@ -24,6 +24,9 @@ gtkardour.Append(CPPPATH="#/") # for top level svn_revision.h
gtkardour.Append(PACKAGE=domain) gtkardour.Append(PACKAGE=domain)
gtkardour.Append(POTFILE=domain + '.pot') gtkardour.Append(POTFILE=domain + '.pot')
if gtkardour['DIST_TARGET'] == 'panther' or gtkardour['DIST_TARGET'] == 'tiger':
gtkardour.Append (LINKFLAGS="-Xlinker -headerpad -Xlinker 2048")
gtkardour.Merge ([ gtkardour.Merge ([
libraries['ardour'], libraries['ardour'],
libraries['ardour_cp'], libraries['ardour_cp'],

View file

@ -8,6 +8,8 @@
#ifdef __APPLE__ #ifdef __APPLE__
#include <CoreAudio/CoreAudio.h> #include <CoreAudio/CoreAudio.h>
#include <CoreFoundation/CFString.h> #include <CoreFoundation/CFString.h>
#include <sys/param.h>
#include <mach-o/dyld.h>
#else #else
#include <alsa/asoundlib.h> #include <alsa/asoundlib.h>
#endif #endif
@ -819,27 +821,33 @@ void
EngineControl::find_jack_servers (vector<string>& strings) EngineControl::find_jack_servers (vector<string>& strings)
{ {
#ifdef __APPLE__ #ifdef __APPLE__
if (ARDOUR::Profile->get_single_package()) {
/* this magic lets us finds the path to the OSX bundle, and then /* this magic lets us finds the path to the OSX bundle, and then
we infer JACK's location from there we infer JACK's location from there
*/ */
CFURLRef pluginRef = CFBundleCopyBundleURL(CFBundleGetMainBundle()); char execpath[MAXPATHLEN+1];
CFStringRef macPath = CFURLCopyFileSystemPath(pluginRef, uint32_t pathsz = sizeof (execpath);
kCFURLPOSIXPathStyle);
std::string path = CFStringGetCStringPtr(macPath,
CFStringGetSystemEncoding());
CFRelease(pluginRef);
CFRelease(macPath);
_NSGetExecutablePath (execpath, &pathsz);
cerr << " execpath = " << execpath << endl;
Glib::ustring path (Glib::path_get_dirname (execpath));
path += "/jackd"; path += "/jackd";
if (Glib::file_test (path, FILE_TEST_EXISTS)) { if (Glib::file_test (path, FILE_TEST_EXISTS)) {
strings.push_back (path); strings.push_back (path);
} else { cerr << "Found jack in " << path << endl;
warning << _("JACK appears to be missing from the Ardour bundle") << endmsg;
} }
if (ARDOUR::Profile->get_single_package()) {
/* no other options - only use the JACK we supply */
if (strings.empty()) {
// cerr << "OOPS!\n";
// fatal << _("JACK appears to be missing from the Ardour bundle") << endmsg;
/*NOTREACHED*/
}
return;
} }
#endif #endif

View file

@ -21,6 +21,7 @@
#include <sigc++/bind.h> #include <sigc++/bind.h>
#include <gtkmm/settings.h> #include <gtkmm/settings.h>
#include <glibmm/ustring.h>
#include <pbd/error.h> #include <pbd/error.h>
#include <pbd/textreceiver.h> #include <pbd/textreceiver.h>
@ -56,6 +57,7 @@ TextReceiver text_receiver ("ardour");
extern int curvetest (string); extern int curvetest (string);
static ARDOUR_UI *ui = 0; static ARDOUR_UI *ui = 0;
static char* localedir = LOCALEDIR;
gint gint
show_ui_callback (void *arg) show_ui_callback (void *arg)
@ -67,6 +69,61 @@ show_ui_callback (void *arg)
return FALSE; return FALSE;
} }
#ifdef __APPLE__
#include <mach-o/dyld.h>
#include <sys/param.h>
void
fixup_bundle_environment ()
{
char execpath[MAXPATHLEN+1];
uint32_t pathsz = sizeof (execpath);
_NSGetExecutablePath (execpath, &pathsz);
cerr << "EXEC PATH = " << execpath << endl;
Glib::ustring exec_path (execpath);
Glib::ustring dir_path = Glib::path_get_dirname (exec_path);
Glib::ustring path;
path = dir_path;
path += "/../Resources";
path += dir_path;
path += "/../Resources/Surfaces";
path += dir_path;
path += "/../Resources/Panners";
setenv ("ARDOUR_MODULE_PATH", path.c_str(), 1);
cerr << "ARDOUR_MODULE_PATH = " << path << endl;
path = dir_path;
path += "/../Resources/icons:";
path += dir_path;
path += "/../Resources/pixmaps:";
path += dir_path;
path += "/../Resources/share:";
path += dir_path;
path += "/../Resources";
setenv ("ARDOUR_PATH", path.c_str(), 1);
setenv ("ARDOUR_CONFIG_PATH", path.c_str(), 1);
setenv ("ARDOUR_DATA_PATH", path.c_str(), 1);
cerr << "ARDOUR_PATH, DATA+CONFIG = " << path << endl;
path = dir_path;
path += "/../Frameworks/clearlooks";
setenv ("GTK_PATH", path.c_str(), 1);
path = dir_path;
path += "/../Resources/locale";
localedir = strdup (path.c_str());
}
#endif
#ifdef VST_SUPPORT #ifdef VST_SUPPORT
/* this is called from the entry point of a wine-compiled /* this is called from the entry point of a wine-compiled
executable that is linked against gtk2_ardour built executable that is linked against gtk2_ardour built
@ -75,16 +132,28 @@ show_ui_callback (void *arg)
extern "C" { extern "C" {
int ardour_main (int argc, char *argv[]) int ardour_main (int argc, char *argv[])
#else #else
int main (int argc, char *argv[]) int main (int argc, char* argv[], char* envp[])
#endif #endif
{ {
vector<Glib::ustring> null_file_list; vector<Glib::ustring> null_file_list;
#ifdef __APPLE__
fixup_bundle_environment ();
#endif
for (int xx = 0; xx < argc; ++xx) {
cerr << "argv[" << xx << "] = " << argv[xx] << endl;
}
for (int xx = 0; envp && envp[xx]; ++xx) {
cerr << "envp[" << xx << "] = " << envp[xx] << endl;
}
Glib::thread_init(); Glib::thread_init();
gtk_set_locale (); gtk_set_locale ();
(void) bindtextdomain (PACKAGE, LOCALEDIR); (void) bindtextdomain (PACKAGE, localedir);
/* our i18n translations are all in UTF-8, so make sure /* our i18n translations are all in UTF-8, so make sure
that even if the user locale doesn't specify UTF-8, that even if the user locale doesn't specify UTF-8,
we use that when handling them. we use that when handling them.

View file

@ -68,7 +68,7 @@ print_help (const char *execname)
int int
ARDOUR_COMMAND_LINE::parse_opts (int argc, char *argv[]) ARDOUR_COMMAND_LINE::parse_opts (int argc, char *argv[])
{ {
const char *optstring = "U:hSbvVnOc:C:m:N:k:"; const char *optstring = "U:hSbvVnOc:C:m:N:k:p:";
const char *execname = strrchr (argv[0], '/'); const char *execname = strrchr (argv[0], '/');
if (getenv ("ARDOUR_SAE")) { if (getenv ("ARDOUR_SAE")) {
@ -93,6 +93,7 @@ ARDOUR_COMMAND_LINE::parse_opts (int argc, char *argv[])
{ "no-hw-optimizations", 0, 0, 'O' }, { "no-hw-optimizations", 0, 0, 'O' },
{ "sync", 0, 0, 'O' }, { "sync", 0, 0, 'O' },
{ "curvetest", 1, 0, 'C' }, { "curvetest", 1, 0, 'C' },
{ "sillyAppleUndocumentedFinderFeature", 1, 0, 'p' },
{ 0, 0, 0, 0 } { 0, 0, 0, 0 }
}; };
@ -131,8 +132,12 @@ ARDOUR_COMMAND_LINE::parse_opts (int argc, char *argv[])
no_splash = false; no_splash = false;
break; break;
case 'p':
//undocumented OS X finder -psn_XXXXX argument
break;
case 'S': case 'S':
// ; just pass this through to gtk it will figure it out // just pass this through to gtk it will figure it out
break; break;
case 'N': case 'N':

View file

@ -15,7 +15,6 @@ glibmm2.Merge([libraries['sigc2'], libraries['glib2']])
glibmm2.Append(CXXFLAGS='-DHAVE_CONFIG_H') glibmm2.Append(CXXFLAGS='-DHAVE_CONFIG_H')
#glibmm2.Append(CXXFLAGS='-DG_DISABLE_DEPRECATED') #glibmm2.Append(CXXFLAGS='-DG_DISABLE_DEPRECATED')
glibmm2.Append(CXXFLAGS='-DG_LOG_DOMAIN=\\\"glibmm\\\"') glibmm2.Append(CXXFLAGS='-DG_LOG_DOMAIN=\\\"glibmm\\\"')
libglibmm2 = glibmm2.SharedLibrary('glibmm2', glibmm2_files) libglibmm2 = glibmm2.SharedLibrary('glibmm2', glibmm2_files)
if os.access ('autogen.sh', os.F_OK) : if os.access ('autogen.sh', os.F_OK) :

View file

@ -9,7 +9,6 @@ atkmm_files = glob.glob('atkmm/*.cc')
Import('env libraries install_prefix') Import('env libraries install_prefix')
atkmm = env.Copy() atkmm = env.Copy()
atkmm.Merge([libraries['glibmm2'], libraries['gtk2'], libraries['sigc2'] ]) atkmm.Merge([libraries['glibmm2'], libraries['gtk2'], libraries['sigc2'] ])
libatkmm = atkmm.SharedLibrary('atkmm', atkmm_files) libatkmm = atkmm.SharedLibrary('atkmm', atkmm_files)
Default(libatkmm) Default(libatkmm)

View file

@ -10,6 +10,9 @@ Import('env libraries install_prefix')
gtkmm2 = env.Copy() gtkmm2 = env.Copy()
gtkmm2.Merge([libraries['glibmm2'], libraries['gtk2'], libraries['sigc2'], libraries['pangomm'], libraries['atkmm'], libraries['gdkmm2'] ]) gtkmm2.Merge([libraries['glibmm2'], libraries['gtk2'], libraries['sigc2'], libraries['pangomm'], libraries['atkmm'], libraries['gdkmm2'] ])
if gtkmm2['DIST_TARGET'] == 'panther' or gtkmm2['DIST_TARGET'] == 'tiger':
gtkmm2.Append (LINKFLAGS="-Xlinker -headerpad -Xlinker 2048")
libgtkmm2 = gtkmm2.SharedLibrary('gtkmm2', gtkmm2_files) libgtkmm2 = gtkmm2.SharedLibrary('gtkmm2', gtkmm2_files)
Default(libgtkmm2) Default(libgtkmm2)

View file

@ -12,7 +12,6 @@ midi2.Merge([ libraries['sigc2'], libraries['xml'], libraries['glibmm2'], librar
domain = 'midipp' domain = 'midipp'
midi2.Append(DOMAIN=domain,MAJOR=2,MINOR=1,MICRO=1) midi2.Append(DOMAIN=domain,MAJOR=2,MINOR=1,MICRO=1)
sources = Split(""" sources = Split("""
fd_midiport.cc fd_midiport.cc
fifomidi.cc fifomidi.cc

View file

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>ardour</string>
</array>
<key>CFBundleTypeOSTypes</key>
<array>
<string>****</string>
<string>fold</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
</dict>
</array>
<key>CFBundleExecutable</key>
<string>Ardour2</string>
<key>CFBundleGetInfoString</key>
<string>Ardour 2.0.5 Copyright 2007 Paul Davis</string>
<key>CFBundleIconFile</key>
<string>appIcon.icns</string>
<key>CFBundleIdentifier</key>
<string>org.ardour.Ardour2</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Ardour2</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersions</key>
<string>2.0.5</string>
<key>CFBundleSignature</key>
<string>ArDr</string>
<key>CFBundleVersion</key>
<string>2.0.5</string>
<key>LSUIElement</key>
<string>0</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSEnvironment</key>
<dict>
<key>ARDOUR_SAE</key>
<string>true</string>
</dict>
</dict>
</plist>

View file

@ -0,0 +1,4 @@
CFBundleName = "Ardour2";
CFBundleShortVersionString = "#{version}";
CFBundleGetInfoString = "Ardour2 version #{version} Copyright 2007 Paul Davis";
NSHumanReadableCopyright = "Copyright 2007 Paul Davis.";

View file

@ -0,0 +1,4 @@
/classes.nib/1.1.1.1/Sun Jun 12 14:34:15 2005//
/info.nib/1.1.1.1/Sun Jun 12 14:34:15 2005//
/keyedobjects.nib/1.1.1.1/Sun Jun 12 14:34:15 2005//
D

View file

@ -0,0 +1 @@
Platypus/MainMenu.nib

View file

@ -0,0 +1 @@
:pserver:sveinbjorn@arakkis.sytes.net:/cvsroot

View file

@ -0,0 +1,26 @@
{
IBClasses = (
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
ACTIONS = {cancel = id; };
CLASS = ScriptExecController;
LANGUAGE = ObjC;
OUTLETS = {
aboutMenuItem = id;
applicationMenu = id;
cancelButton = id;
hideMenuItem = id;
messageTextField = id;
progressBar = id;
progressWindow = id;
quitMenuItem = id;
textOutputCancelButton = id;
textOutputProgressIndicator = id;
textOutputTextField = id;
textOutputWindow = id;
};
SUPERCLASS = NSObject;
}
);
IBVersion = 1;
}

View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>477 26 356 240 0 0 1280 832 </string>
<key>IBEditorPositions</key>
<dict>
<key>29</key>
<string>281 550 273 44 0 0 1280 832 </string>
</dict>
<key>IBFramework Version</key>
<string>364.0</string>
<key>IBOpenObjects</key>
<array>
<integer>29</integer>
</array>
<key>IBSystem Version</key>
<string>7M34</string>
</dict>
</plist>

Binary file not shown.

View file

@ -0,0 +1,4 @@
{
IBClasses = ();
IBVersion = 1;
}

View file

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>99 362 356 240 0 0 1280 832 </string>
<key>IBEditorPositions</key>
<dict>
<key>187</key>
<string>340 374 240 44 0 0 1280 832 </string>
</dict>
<key>IBFramework Version</key>
<string>349.0</string>
<key>IBOpenObjects</key>
<array>
<integer>187</integer>
</array>
<key>IBSystem Version</key>
<string>7F44</string>
<key>targetFramework</key>
<string>IBCarbonFramework</string>
</dict>
</plist>

View file

@ -0,0 +1,73 @@
<?xml version="1.0" standalone="yes"?>
<object class="NSIBObjectData">
<string name="targetFramework">IBCarbonFramework</string>
<object name="rootObject" class="NSCustomObject" id="1">
<string name="customClass">NSApplication</string>
</object>
<array count="4" name="allObjects">
<object class="IBCarbonMenu" id="187">
<string name="title">MenuBar</string>
<array count="1" name="items">
<object class="IBCarbonMenuItem" id="195">
<string name="title">ScriptExec</string>
<object name="submenu" class="IBCarbonMenu" id="193">
<string name="title">ScriptExec</string>
<string name="name">_NSAppleMenu</string>
</object>
</object>
</array>
<string name="name">_NSMainMenu</string>
</object>
<reference idRef="193"/>
<reference idRef="195"/>
<object class="IBCarbonMenuItem" id="204">
<string name="title">Window</string>
<object name="submenu" class="IBCarbonMenu">
<string name="title">Window</string>
<array count="5" name="items">
<object class="IBCarbonMenuItem">
<boolean name="dynamic">TRUE</boolean>
<string name="title">Minimize Window</string>
<string name="keyEquivalent">m</string>
<ostype name="command">mini</ostype>
</object>
<object class="IBCarbonMenuItem">
<boolean name="dynamic">TRUE</boolean>
<string name="title">Minimize All Windows</string>
<string name="keyEquivalent">m</string>
<int name="keyEquivalentModifier">1572864</int>
<ostype name="command">mini</ostype>
</object>
<object class="IBCarbonMenuItem">
<boolean name="separator">TRUE</boolean>
</object>
<object class="IBCarbonMenuItem">
<boolean name="dynamic">TRUE</boolean>
<string name="title">Bring All to Front</string>
<ostype name="command">frnt</ostype>
</object>
<object class="IBCarbonMenuItem">
<boolean name="dynamic">TRUE</boolean>
<string name="title">Bring in Front</string>
<int name="keyEquivalentModifier">1572864</int>
<ostype name="command">frnt</ostype>
</object>
</array>
<string name="name">_NSWindowsMenu</string>
</object>
</object>
</array>
<array count="4" name="allParents">
<reference idRef="1"/>
<reference idRef="195"/>
<reference idRef="187"/>
<reference idRef="187"/>
</array>
<dictionary count="2" name="nameTable">
<string>File&apos;s Owner</string>
<reference idRef="1"/>
<string>MenuBar</string>
<reference idRef="187"/>
</dictionary>
<unsigned_int name="nextObjectID">206</unsigned_int>
</object>

View file

@ -0,0 +1,4 @@
{
IBClasses = ();
IBVersion = 1;
}

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>124 298 356 240 0 0 1280 832 </string>
<key>IBFramework Version</key>
<string>349.0</string>
<key>IBOpenObjects</key>
<array>
<integer>180</integer>
</array>
<key>IBSystem Version</key>
<string>7F44</string>
<key>targetFramework</key>
<string>IBCarbonFramework</string>
</dict>
</plist>

View file

@ -0,0 +1,53 @@
<?xml version="1.0" standalone="yes"?>
<object class="NSIBObjectData">
<string name="targetFramework">IBCarbonFramework</string>
<object name="rootObject" class="NSCustomObject" id="1">
<string name="customClass">NSApplication</string>
</object>
<array count="4" name="allObjects">
<object class="IBCarbonWindow" id="180">
<string name="windowRect">404 523 457 899 </string>
<string name="title">Caching Fonts...</string>
<object name="rootControl" class="IBCarbonRootControl" id="183">
<string name="bounds">0 0 53 376 </string>
<array count="2" name="subviews">
<object class="IBCarbonProgressBar" id="181">
<string name="bounds">19 17 32 270 </string>
<boolean name="small">TRUE</boolean>
<int name="controlSize">1</int>
<int name="initialValue">50</int>
</object>
<object class="IBCarbonButton" id="185">
<string name="bounds">16 284 34 356 </string>
<boolean name="small">TRUE</boolean>
<int name="controlSize">1</int>
<string name="title">Cancel</string>
<ostype name="command">quit</ostype>
</object>
</array>
</object>
<boolean name="hasCloseBox">FALSE</boolean>
<boolean name="hasHorizontalZoom">FALSE</boolean>
<boolean name="isResizable">FALSE</boolean>
<boolean name="hasVerticalZoom">FALSE</boolean>
<int name="themeBrush">51</int>
<int name="windowPosition">1</int>
</object>
<reference idRef="181"/>
<reference idRef="183"/>
<reference idRef="185"/>
</array>
<array count="4" name="allParents">
<reference idRef="1"/>
<reference idRef="183"/>
<reference idRef="180"/>
<reference idRef="183"/>
</array>
<dictionary count="2" name="nameTable">
<string>File&apos;s Owner</string>
<reference idRef="1"/>
<string>Window</string>
<reference idRef="180"/>
</dictionary>
<unsigned_int name="nextObjectID">186</unsigned_int>
</object>

Binary file not shown.

File diff suppressed because it is too large Load diff

165
tools/osx_packaging/osx_build Executable file
View file

@ -0,0 +1,165 @@
#!/bin/sh
# script for pulling together a MacOSX app bundle.
version=`grep -m 1 '^ardour_version' ../../SConstruct | cut -d' ' -f 3 | sed "s/'//g"`
echo "Version is $version"
# setup directory structure
APPROOT=Ardour2.app/Contents
echo "Removing old Ardour2.app tree ..."
rm -rf Ardour2.app
echo "Building new app directory structure ..."
mkdir -p Ardour2.app/Contents/MacOS
mkdir -p Ardour2.app/Contents/Resources
mkdir -p Ardour2.app/Contents/Frameworks
# copy static files
cp Info.plist $APPROOT
cp PkgInfo $APPROOT
cp -r Resources/* $APPROOT/Resources
Frameworks=$APPROOT/Frameworks
Resources=$APPROOT/Resources
Shared=$Resources/share
Etc=$Resources/etc
if test ! -d $Frameworks ; then
mkdir -p $Frameworks
fi
if test ! -d $Shared/templates ; then
mkdir -p $Shared/templates
fi
if test ! -d $Etc ; then
mkdir -p $Etc
fi
# copy executable
echo "Copying Ardour executable ..."
cp ../../gtk2_ardour/ardour-$version $APPROOT/MacOS/Ardour2
# copy everything related to gtk-quartz
echo "Copying GTK-Quartz tree ..."
cp -R /opt/gtk/lib/*.dylib $Frameworks/
cp -R /opt/gtk/etc/* $Etc
echo "Copying Ardour libraries into .app ..."
cp ../../libs/pbd/libpbd.dylib $Frameworks
cp ../../libs/midi++2/libmidi++.dylib $Frameworks
cp ../../libs/sigc++2/libsigc++2.dylib $Frameworks
cp ../../libs/soundtouch/libsoundtouch.dylib $Frameworks
cp ../../libs/libsndfile/libsndfile-ardour.dylib $Frameworks
cp ../../libs/libgnomecanvasmm/libgnomecanvasmm.dylib $Frameworks
cp ../../libs/gtkmm2ext/libgtkmm2ext.dylib $Frameworks
cp ../../libs/glibmm2/libglibmm2.dylib $Frameworks
cp ../../libs/gtkmm2/atk/libatkmm.dylib $Frameworks
cp ../../libs/gtkmm2/gdk/libgdkmm2.dylib $Frameworks
cp ../../libs/gtkmm2/gtk/libgtkmm2.dylib $Frameworks
cp ../../libs/gtkmm2/pango/libpangomm.dylib $Frameworks
cp ../../libs/ardour/libardour.dylib $Frameworks
# this one is special - we will set GTK_PATH to $Frameworks/clearlooks
cp ../../libs/clearlooks/libclearlooks.dylib $Frameworks
mkdir -p $Frameworks/clearlooks/engines
(cd $Frameworks/clearlooks/engines && ln -s ../../libclearlooks.dylib libclearlooks.dylib && ln -s ../../libclearlooks.dylib libclearlooks.so)
# push in ardour-required 3rd party libraries
cp /opt/local/lib/libsamplerate.0.dylib $Frameworks
cp /opt/local/lib/liblrdf.2.dylib $Frameworks
cp /opt/local/lib/libraptor.1.dylib $Frameworks
cp /opt/local/lib/liblo.0.dylib $Frameworks
# JACK
cp /usr/local/lib/libjack.0.dylib $Frameworks
cp /usr/local/bin/jackd $APPROOT/MacOS/jackd
# XXX STILL NEED TO DO SURFACES AND PANNERS
cp ../../libs/surfaces/control_protocol/libardour_cp.dylib $Frameworks
echo "Copying other stuff to Ardour2.app ..."
cp ../../gtk2_ardour/ardour.bindings $Resources
cp ../../gtk2_ardour/ardour.menus $Resources
cp ../../gtk2_ardour/ardour-sae.menus $Resources
cp ../../ardour_system.rc $Resources
cp ../../gtk2_ardour/ardour2_ui_default.conf $Resources
cp ../../gtk2_ardour/ardour2_ui_light.rc $Resources
cp ../../gtk2_ardour/ardour2_ui_dark.rc $Resources
cp -r ../../gtk2_ardour/icons $Resources
cp -r ../../gtk2_ardour/pixmaps $Resources
# share stuff
cp -R ../../gtk2_ardour/splash.png $Shared
cp ../../templates/*.template $Shared/templates/
# go through and recursively remove any .svn dirs in the bundle
for svndir in `find Ardour2.app -name .svn -type dir`; do
rm -rf $svndir
done
# now fix up the executables
for exe in Ardour2 jackd ; do
EXE=$APPROOT/MacOS/$exe
changes=""
for lib in `otool -L $EXE | egrep '(/opt/gtk|/local/|libs/)' | awk '{print $1}'` ; do
base=`basename $lib`
changes="$changes -change $lib @executable_path/../Frameworks/$base"
done
if test "x$changes" != "x" ; then
install_name_tool $changes $EXE
fi
done
echo "Fixing up library names ..."
# now do the same for all the libraries we include
for dylib in $Frameworks/*.dylib ; do
# skip symlinks
if test ! -L $dylib ; then
# change all the dependencies
changes=""
for lib in `otool -L $dylib | egrep '(/opt/gtk|/local/|libs/)' | awk '{print $1}'` ; do
base=`basename $lib`
changes="$changes -change $lib @executable_path/../Frameworks/$base"
done
if test "x$changes" != x ; then
if install_name_tool $changes $dylib ; then
:
else
exit 1
fi
fi
# now the change what the library thinks its own name is
base=`basename $dylib`
install_name_tool -id @executable_path/../Frameworks/$base $dylib
fi
done
# make DMG
rm -rf macdist
mkdir "macdist"
cp -r README.rtf COPYING Ardour2.app macdist/
# reduce size
strip macdist/Ardour2.app/Contents/MacOS/Ardour2
dmgname="Ardour-$version"
rm -f $dmgname.dmg
echo "Creating DMG"
hdiutil create -fs HFS+ -volname $dmgname -srcfolder macdist $dmgname.dmg
echo "Done."