Whitespace fixes in gtk2_ardour/ardour_ui.cc
[ardour.git] / tools / osx_packaging / app_build.rb
index 443b287c28c884ba62fdd7c079b1b0c5c058cd0b..48d3837368089f6eff253f1a077466bf94469d29 100755 (executable)
@@ -3,7 +3,10 @@
 # Ruby script for pulling together a MacOSX app bundle.
 
 # it will be either powerpc or i386
-version = "beta9"
+versionline = `grep -m 1 '^ardour_version =' ../../SConstruct`
+version = versionline.split(" = ")[1].chomp().slice(1..-2)
+$stdout.printf("Version is %s\n", version)
+
 arch = `uname -p`.strip()
 libdir = "lib_" + arch
 bindir = "bin_" + arch
@@ -54,7 +57,7 @@ end
 odir = Dir.getwd
 Dir.chdir("../..")
 
-result = `otool -L gtk2_ardour/ardour.bin`
+result = `otool -L gtk2_ardour/ardour-#{version}`
 results = result.split("\n")
 results.delete_at(0)
 
@@ -98,15 +101,17 @@ end
 
 Dir.chdir(odir)
 
-# copy ardour.bin to bindir/ardour
-$stdout.print("Copying bin to #{bindir} ...\n");
+# copy ardour binary to bindir/ardour
+
 
-if File.exist?("../../gtk2_ardour/ardour.bin") then
-   `cp ../../gtk2_ardour/ardour.bin #{bindir}/ardour`
+if File.exist?("../../gtk2_ardour/ardour-#{version}") then
+   $stdout.print("Copying bin to #{bindir} ...\n");
+   `cp ../../gtk2_ardour/ardour-#{version} #{bindir}/ardour`
 end
 
 `cp ../../libs/surfaces/*/*.dylib #{libdir}/surfaces`
 # remove the basenames from libdir that are in surfaces (copied earlier)
+`rm -f #{libdir}/surfaces/libardour_cp.dylib`
 begin
   Dir.foreach(libdir+"/surfaces") {|x| unless ( x[0] == 46 or x.include?("libardour_cp")) then File.delete(libdir + "/" +x) end}
 rescue
@@ -171,6 +176,7 @@ end
 if File.exist?(ppc_libdir) and File.exist?(i386_libdir) then
   $stdout.print("\nBoth platforms in place, lipo'ing...\n");
   `rm -rf lib/*`
+  `rm -f bin/ardour`
   lipo_platforms_recurse(ppc_libdir, i386_libdir, "lib")
   lipo_platforms_recurse(i386_libdir, ppc_libdir, "lib")
   lipo_platforms_recurse(i386_bindir+'/ardour', ppc_bindir+'/ardour', "bin/ardour")
@@ -180,7 +186,7 @@ if File.exist?(ppc_libdir) and File.exist?(i386_libdir) then
 
   $stdout.print("\nRunning Playtpus to create Ardour2.app  ...\n");
 
-  `/usr/local/bin/platypus -D -X 'ardour' -a 'Ardour2' -t 'shell' -o 'None' -u 'Paul Davis' -i '/bin/sh' -V '2.0' -s 'ArDr' -I 'org.ardour.Ardour2' -f 'bin' -f 'lib' -i 'Ardour2.icns' -f 'MenuBar.nib' -f 'ProgressWindow.nib' -f 'init' -f 'openDoc' 'script' 'Ardour2.app'`
+  `/usr/local/bin/platypus -D -X 'ardour' -a 'Ardour2' -t 'shell' -o 'None' -u 'Paul Davis' -i '/bin/sh' -V "#{version}" -s 'ArDr' -I 'org.ardour.Ardour2' -f 'bin' -f 'lib' -i 'Ardour2.icns' -f 'MenuBar.nib' -f 'ProgressWindow.nib' -f 'init' -f 'openDoc' 'script' 'Ardour2.app'`
 
   $stdout.print("\nCopying other stuff to Ardour2.app  ...\n");
 
@@ -233,7 +239,7 @@ if File.exist?(ppc_libdir) and File.exist?(i386_libdir) then
   `rm -rf macdist`
   Dir.mkdir("macdist")
   `cp -r README.rtf COPYING Ardour2.app macdist/`
-  dmgname = "Ardour2-#{version}"
+  dmgname = "Ardour-#{version}"
   `rm -f #{dmgname}.dmg`
   $stdout.print("\nCreating DMG\n")
   `hdiutil create -fs HFS+ -volname #{dmgname} -srcfolder macdist #{dmgname}.dmg`
@@ -244,9 +250,10 @@ if File.exist?(ppc_libdir) and File.exist?(i386_libdir) then
 else
   # zip up libdir and bindir
   zipfile = "binlib_"+`uname -p`.strip() + ".zip" 
-  $stdout.print("\nZipping up #{libdir} and #{bindir} into #{zipfile}\n")
-  $stdout.print("Copy #{zipfile} to other platform's osx_packaging dir and run app_build.rb\nthere to complete universal build.\n")
+  $stdout.print("Zipping up #{libdir} and #{bindir} into #{zipfile}...\n")
   `zip -rq #{zipfile} #{libdir} #{bindir}`
+  $stdout.print("Copy #{zipfile} to other platform's osx_packaging dir and run app_build.rb\nthere to complete universal build.\n")
+
 
 end