Revised package script for Mac.

This commit is contained in:
James Turner
2015-01-18 23:03:58 +00:00
parent 84fdb24d6d
commit 8738690def
+16 -11
View File
@@ -48,6 +48,17 @@ end
puts "Erasing previous image dir" puts "Erasing previous image dir"
`rm -rf #{dmgDir}` `rm -rf #{dmgDir}`
bundle=dmgDir + "/FlightGear.app"
# run macdeployt before we rename the bundle, otherwise it
# can't find the bundle executable
puts "Running macdeployqt on the bundle to copy Qt libraries"
`macdeployqt #{$prefixDir}/fgfs.app`
puts "Moving & renaming app bundle"
`mkdir -p #{dmgDir}`
`mv #{$prefixDir}/fgfs.app #{bundle}`
bundle=dmgDir + "/FlightGear.app" bundle=dmgDir + "/FlightGear.app"
contents=bundle + "/Contents" contents=bundle + "/Contents"
macosDir=contents + "/MacOS" macosDir=contents + "/MacOS"
@@ -70,9 +81,11 @@ puts "Creating directory structure"
`mkdir -p #{resourcesDir}` `mkdir -p #{resourcesDir}`
`mkdir -p #{osgPluginsDir}` `mkdir -p #{osgPluginsDir}`
puts "Copying binaries" # fix install names on the primary executable
`cp #{$prefixDir}/fgfs.app/Contents/MacOS/fgfs #{macosDir}/fgfs` fix_install_names("#{macosDir}/fgfs")
bins = ['fgjs', 'fgcom', 'fgviewer']
puts "Copying auxilliary binaries"
bins = ['fgjs', 'fgcom']
bins.each do |b| bins.each do |b|
if !File.exist?("#{$prefixDir}/bin/#{b}") if !File.exist?("#{$prefixDir}/bin/#{b}")
next next
@@ -100,14 +113,6 @@ $osgPlugins.each do |p|
fix_install_names("#{osgPluginsDir}/#{pluginFile}") fix_install_names("#{osgPluginsDir}/#{pluginFile}")
end end
# Macflightgear launcher
puts "Copying Macflightgear launcher files"
Dir.chdir "maclauncher/FlightGearOSX" do
`cp FlightGear #{macosDir}`
`rsync -a *.rb *.lproj *.sh *.tiff *.html #{resourcesDir}`
end
if File.exist?("#{$prefixDir}/bin/fgcom-data") if File.exist?("#{$prefixDir}/bin/fgcom-data")
puts "Copying FGCom data files" puts "Copying FGCom data files"
`ditto #{$prefixDir}/bin/fgcom-data #{resourcesDir}/fgcom-data` `ditto #{$prefixDir}/bin/fgcom-data #{resourcesDir}/fgcom-data`