Mac nightly packaging updates
Add FGCom, use Mac-launcher build exports, and ground-work for copying Subversion client libraries. Also runs code sign, though without a valid signing identity.
This commit is contained in:
parent
310ddbf8c5
commit
1830f48c87
1 changed files with 57 additions and 17 deletions
|
@ -3,7 +3,7 @@
|
||||||
require 'ERB'
|
require 'ERB'
|
||||||
|
|
||||||
$osgLibs = ['osgFX', 'osgParticle', 'osg', 'osgGA', 'osgText', 'osgUtil', 'osgSim', 'osgViewer', 'osgDB']
|
$osgLibs = ['osgFX', 'osgParticle', 'osg', 'osgGA', 'osgText', 'osgUtil', 'osgSim', 'osgViewer', 'osgDB']
|
||||||
$osgPlugins = ['ac', 'osg', 'freetype', 'qt', 'imageio', 'rgb', 'txf', 'mdl', '3ds', 'dds']
|
$osgPlugins = ['ac', 'osg', 'freetype', 'imageio', 'rgb', 'txf', 'mdl', '3ds', 'dds']
|
||||||
|
|
||||||
def runOsgVersion(option)
|
def runOsgVersion(option)
|
||||||
env = "export DYLD_LIBRARY_PATH=#{Dir.pwd}/dist/lib"
|
env = "export DYLD_LIBRARY_PATH=#{Dir.pwd}/dist/lib"
|
||||||
|
@ -19,6 +19,10 @@ puts "osgVersion=#{osgVersion}, so-number=#{$osgSoVersion}"
|
||||||
|
|
||||||
$alutSourcePath='/Library/Frameworks/ALUT.framework'
|
$alutSourcePath='/Library/Frameworks/ALUT.framework'
|
||||||
|
|
||||||
|
$svnLibs = ['svn_client', 'svn_wc', 'svn_delta', 'svn_diff', 'svn_ra',
|
||||||
|
'svn_ra_local', 'svn_repos', 'svn_fs', 'svn_fs_fs', 'svn_fs_util',
|
||||||
|
'svn_ra_svn', 'svn_subr']
|
||||||
|
|
||||||
def fix_install_names(object)
|
def fix_install_names(object)
|
||||||
#puts "fixing install names for #{object}"
|
#puts "fixing install names for #{object}"
|
||||||
|
|
||||||
|
@ -37,10 +41,18 @@ def fix_install_names(object)
|
||||||
`install_name_tool -change #{$alutSourcePath}/#{alutLib} #{alutBundlePath}/#{alutLib} #{object}`
|
`install_name_tool -change #{$alutSourcePath}/#{alutLib} #{alutBundlePath}/#{alutLib} #{object}`
|
||||||
end
|
end
|
||||||
|
|
||||||
prefixDir=Dir.pwd + "/dist"
|
$prefixDir=Dir.pwd + "/dist"
|
||||||
dmgDir=Dir.pwd + "/image"
|
dmgDir=Dir.pwd + "/image"
|
||||||
srcDir=Dir.pwd + "/flightgear"
|
srcDir=Dir.pwd + "/flightgear"
|
||||||
|
|
||||||
|
def fix_svn_install_names(object)
|
||||||
|
$svnLibs.each do |l|
|
||||||
|
fileName = "lib#{l}-1.0.dylib"
|
||||||
|
oldName = "#{$prefixDir}/lib/#{fileName}"
|
||||||
|
newName = "@executable_path/../Frameworks/#{fileName}"
|
||||||
|
`install_name_tool -change #{oldName} #{newName} #{object}`
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
puts "Erasing previous image dir"
|
puts "Erasing previous image dir"
|
||||||
`rm -rf #{dmgDir}`
|
`rm -rf #{dmgDir}`
|
||||||
|
@ -48,48 +60,74 @@ puts "Erasing previous image dir"
|
||||||
bundle=dmgDir + "/FlightGear.app"
|
bundle=dmgDir + "/FlightGear.app"
|
||||||
contents=bundle + "/Contents"
|
contents=bundle + "/Contents"
|
||||||
macosDir=contents + "/MacOS"
|
macosDir=contents + "/MacOS"
|
||||||
frameworksDir=contents +"/Frameworks"
|
$frameworksDir=contents +"/Frameworks"
|
||||||
resourcesDir=contents+"/Resources"
|
resourcesDir=contents+"/Resources"
|
||||||
osgPluginsDir=contents+"/PlugIns/osgPlugins-#{osgVersion}"
|
osgPluginsDir=contents+"/PlugIns/osgPlugins-#{osgVersion}"
|
||||||
volName="\"FlightGear Nightly Build\""
|
volName="\"FlightGear Nightly Build\""
|
||||||
|
|
||||||
|
def copy_svn_libs()
|
||||||
|
puts "Copying Subversion client libraries"
|
||||||
|
$svnLibs.each do |l|
|
||||||
|
libFile = "lib#{l}-1.0.dylib"
|
||||||
|
path = "#{$frameworksDir}/#{libFile}"
|
||||||
|
`cp #{$prefixDir}/lib/#{libFile} #{$frameworksDir}`
|
||||||
|
fix_svn_install_names(path)
|
||||||
|
`install_name_tool -id #{libFile} #{path}`
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def code_sign(path)
|
||||||
|
puts "Signing #{path}"
|
||||||
|
`codesign -s "FlightGear" #{path}`
|
||||||
|
end
|
||||||
|
|
||||||
fgVersion = File.read("#{srcDir}/version").strip
|
fgVersion = File.read("#{srcDir}/version").strip
|
||||||
|
|
||||||
dmgPath = Dir.pwd + "/fg_mac_nightly_#{fgVersion}.dmg"
|
dmgPath = Dir.pwd + "/fg_mac_nightly_#{fgVersion}.dmg"
|
||||||
|
|
||||||
puts "Creating directory structure"
|
puts "Creating directory structure"
|
||||||
`mkdir -p #{macosDir}`
|
`mkdir -p #{macosDir}`
|
||||||
`mkdir -p #{frameworksDir}`
|
`mkdir -p #{$frameworksDir}`
|
||||||
`mkdir -p #{resourcesDir}`
|
`mkdir -p #{resourcesDir}`
|
||||||
`mkdir -p #{osgPluginsDir}`
|
`mkdir -p #{osgPluginsDir}`
|
||||||
|
|
||||||
puts "Copying binaries"
|
puts "Copying binaries"
|
||||||
bins = ['fgfs', 'terrasync', 'fgjs']
|
bins = ['fgfs', 'fgjs', 'fgcom']
|
||||||
bins.each do |b|
|
bins.each do |b|
|
||||||
`cp #{prefixDir}/bin/#{b} #{macosDir}/#{b}`
|
if !File.exist?("#{$prefixDir}/bin/#{b}")
|
||||||
fix_install_names("#{macosDir}/#{b}")
|
next
|
||||||
|
end
|
||||||
|
|
||||||
|
outPath = "#{macosDir}/#{b}"
|
||||||
|
`cp #{$prefixDir}/bin/#{b} #{outPath}`
|
||||||
|
fix_install_names(outPath)
|
||||||
|
fix_svn_install_names(outPath)
|
||||||
|
code_sign(outPath)
|
||||||
end
|
end
|
||||||
|
|
||||||
puts "copying libraries"
|
puts "copying libraries"
|
||||||
$osgLibs.each do |l|
|
$osgLibs.each do |l|
|
||||||
libFile = "lib#{l}.#{$osgSoVersion}.dylib"
|
libFile = "lib#{l}.#{$osgSoVersion}.dylib"
|
||||||
`cp #{prefixDir}/lib/#{libFile} #{frameworksDir}`
|
`cp #{$prefixDir}/lib/#{libFile} #{$frameworksDir}`
|
||||||
fix_install_names("#{frameworksDir}/#{libFile}")
|
fix_install_names("#{$frameworksDir}/#{libFile}")
|
||||||
end
|
end
|
||||||
|
|
||||||
# and not forgetting OpenThreads
|
# and not forgetting OpenThreads
|
||||||
libFile = "libOpenThreads.#{$openThreadsSoVersion}.dylib"
|
libFile = "libOpenThreads.#{$openThreadsSoVersion}.dylib"
|
||||||
`cp #{prefixDir}/lib/#{libFile} #{frameworksDir}`
|
`cp #{$prefixDir}/lib/#{libFile} #{$frameworksDir}`
|
||||||
|
|
||||||
$osgPlugins.each do |p|
|
$osgPlugins.each do |p|
|
||||||
pluginFile = "osgdb_#{p}.so"
|
pluginFile = "osgdb_#{p}.so"
|
||||||
`cp #{prefixDir}/lib/osgPlugins-#{osgVersion}/#{pluginFile} #{osgPluginsDir}`
|
`cp #{$prefixDir}/lib/osgPlugins-#{osgVersion}/#{pluginFile} #{osgPluginsDir}`
|
||||||
fix_install_names("#{osgPluginsDir}/#{pluginFile}")
|
fix_install_names("#{osgPluginsDir}/#{pluginFile}")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# svn lib copying disabled for the moment
|
||||||
|
# copy_svn_libs()
|
||||||
|
|
||||||
# custom ALUT
|
# custom ALUT
|
||||||
# must copy frameworks using ditto
|
# must copy frameworks using ditto
|
||||||
`ditto #{$alutSourcePath} #{frameworksDir}/ALUT.framework`
|
`ditto #{$alutSourcePath} #{$frameworksDir}/ALUT.framework`
|
||||||
|
|
||||||
# Info.plist
|
# Info.plist
|
||||||
template = File.read("#{srcDir}/package/mac/nightly.plist.in")
|
template = File.read("#{srcDir}/package/mac/nightly.plist.in")
|
||||||
|
@ -104,11 +142,13 @@ File.open("#{contents}/Info.plist", 'w') { |f|
|
||||||
`cp #{srcDir}/COPYING #{dmgDir}`
|
`cp #{srcDir}/COPYING #{dmgDir}`
|
||||||
|
|
||||||
# Macflightgear launcher
|
# Macflightgear launcher
|
||||||
puts "Copying Macflightgear launcher files"
|
if File.exist?("FlightGearOSX")
|
||||||
|
puts "Copying Macflightgear launcher files"
|
||||||
Dir.chdir "macflightgear" do
|
Dir.chdir "FlightGearOSX" do
|
||||||
`cp FlightGear #{macosDir}`
|
`cp FlightGear #{macosDir}`
|
||||||
`rsync -a --exclude=\".svn\" *.rb *.lproj *.sh *.tiff #{resourcesDir}`
|
`rsync -a *.rb *.lproj *.sh *.tiff #{resourcesDir}`
|
||||||
|
code_sign("#{macosDir}/FlightGear")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
puts "Creating DMG"
|
puts "Creating DMG"
|
||||||
|
|
Loading…
Reference in a new issue