X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=package%2Fmac%2Fbuild-mac-nightly-dmg.rb;h=cd839acaa76e09183ba9715342e682397711ec1a;hb=d0706915317043ed7b5c3f3118371def5675b52b;hp=33198e09b2bf82d325ca17baf199491839ddafca;hpb=27276c35e98de40bced9dfa62cb4d4f7e1f9131d;p=flightgear.git diff --git a/package/mac/build-mac-nightly-dmg.rb b/package/mac/build-mac-nightly-dmg.rb index 33198e09b..cd839acaa 100755 --- a/package/mac/build-mac-nightly-dmg.rb +++ b/package/mac/build-mac-nightly-dmg.rb @@ -3,20 +3,34 @@ require 'ERB' $osgLibs = ['osgFX', 'osgParticle', 'osg', 'osgGA', 'osgText', 'osgUtil', 'osgSim', 'osgViewer', 'osgDB'] -$osgPlugins = ['ac', 'osg', 'freetype', 'qt', 'imageio', 'rgb', 'txf'] -$osgDylibVersion='63' +$osgPlugins = ['ac', 'osg', 'freetype', 'qt', 'imageio', 'rgb', 'txf', 'mdl', '3ds'] + +def runOsgVersion(option) + env = "export DYLD_LIBRARY_PATH=#{Dir.pwd}/dist/lib" + bin = Dir.pwd + "/dist/bin/osgversion" + return `#{env}; #{bin} --#{option}`.chomp +end + +osgVersion = runOsgVersion('version-number') +$osgSoVersion=runOsgVersion('so-number') +$openThreadsSoVersion=runOsgVersion('openthreads-soversion-number') + +VERSION = File.read("#{srcDir}/version").strip + +puts "osgVersion=#{osgVersion}, so-number=#{$osgSoVersion}" + $alutSourcePath='/Library/Frameworks/ALUT.framework' def fix_install_names(object) #puts "fixing install names for #{object}" $osgLibs.each do |l| - oldName = "lib#{l}.#{$osgDylibVersion}.dylib" + oldName = "lib#{l}.#{$osgSoVersion}.dylib" newName = "@executable_path/../Frameworks/#{oldName}" `install_name_tool -change #{oldName} #{newName} #{object}` end - oldName = "libOpenThreads.12.dylib" + oldName = "libOpenThreads.#{$openThreadsSoVersion}.dylib" newName= "@executable_path/../Frameworks/#{oldName}" `install_name_tool -change #{oldName} #{newName} #{object}` @@ -33,10 +47,6 @@ dmgPath = Dir.pwd + "/fg_mac_nightly.dmg" puts "Erasing previous image dir" `rm -rf #{dmgDir}` -osgVersion = `export PKG_CONFIG_PATH=#{prefixDir}/lib/pkgconfig; pkg-config --modversion openscenegraph` -osgVersion = osgVersion.chomp # strip trailing newlines -puts "osgVersion='#{osgVersion}'" - bundle=dmgDir + "/FlightGear.app" contents=bundle + "/Contents" macosDir=contents + "/MacOS" @@ -60,13 +70,13 @@ end puts "copying libraries" $osgLibs.each do |l| - libFile = "lib#{l}.#{$osgDylibVersion}.dylib" + libFile = "lib#{l}.#{$osgSoVersion}.dylib" `cp #{prefixDir}/lib/#{libFile} #{frameworksDir}` fix_install_names("#{frameworksDir}/#{libFile}") end # and not forgetting OpenThreads -libFile = "libOpenThreads.12.dylib" +libFile = "libOpenThreads.#{$openThreadsSoVersion}.dylib" `cp #{prefixDir}/lib/#{libFile} #{frameworksDir}` $osgPlugins.each do |p|