From 2c721a2db7c990cfe347c651ec42f9ec05ecc881 Mon Sep 17 00:00:00 2001 From: James Turner Date: Thu, 4 Nov 2010 18:47:17 +0000 Subject: [PATCH] Use osgversion to cope with OSG version numbering changes. --- package/mac/build-mac-nightly-dmg.rb | 19 ++++++++++--------- package/mac/run-osgversion | 4 ++++ 2 files changed, 14 insertions(+), 9 deletions(-) create mode 100755 package/mac/run-osgversion diff --git a/package/mac/build-mac-nightly-dmg.rb b/package/mac/build-mac-nightly-dmg.rb index 33198e09b..21b9e47ba 100755 --- a/package/mac/build-mac-nightly-dmg.rb +++ b/package/mac/build-mac-nightly-dmg.rb @@ -4,19 +4,24 @@ require 'ERB' $osgLibs = ['osgFX', 'osgParticle', 'osg', 'osgGA', 'osgText', 'osgUtil', 'osgSim', 'osgViewer', 'osgDB'] $osgPlugins = ['ac', 'osg', 'freetype', 'qt', 'imageio', 'rgb', 'txf'] -$osgDylibVersion='63' + +osgVersion = `./run-osgversion --version-number` +puts "osgVersion='#{osgVersion}'" +$osgSoVersion=`./run-osgversion --so-number` +$openThreadsSoVersion=`./run-osgversion --openthreads-soversion-number` + $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 +38,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 +61,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| diff --git a/package/mac/run-osgversion b/package/mac/run-osgversion new file mode 100755 index 000000000..508b07bf1 --- /dev/null +++ b/package/mac/run-osgversion @@ -0,0 +1,4 @@ +#/bin/bash +DYLD_LIBRARY_PATH=$PWD/dist/lib +./dist/bin/osgversion $1 +