From 9cd3adb3a5487bbb51d42770d1df6112717f3f0d Mon Sep 17 00:00:00 2001 From: James Turner Date: Fri, 5 Nov 2010 08:33:17 +0000 Subject: [PATCH] Different approach to running osgversion during Mac packaging. --- package/mac/build-mac-nightly-dmg.rb | 19 +++++++++++++------ package/mac/run-osgversion | 4 ---- 2 files changed, 13 insertions(+), 10 deletions(-) delete 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 21b9e47ba..04fb5568f 100755 --- a/package/mac/build-mac-nightly-dmg.rb +++ b/package/mac/build-mac-nightly-dmg.rb @@ -5,10 +5,17 @@ require 'ERB' $osgLibs = ['osgFX', 'osgParticle', 'osg', 'osgGA', 'osgText', 'osgUtil', 'osgSim', 'osgViewer', 'osgDB'] $osgPlugins = ['ac', 'osg', 'freetype', 'qt', 'imageio', 'rgb', 'txf'] -osgVersion = `./run-osgversion --version-number` -puts "osgVersion='#{osgVersion}'" -$osgSoVersion=`./run-osgversion --so-number` -$openThreadsSoVersion=`./run-osgversion --openthreads-soversion-number` +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') + +puts "osgVersion=#{osgVersion}, so-number=#{$osgSoVersion}" $alutSourcePath='/Library/Frameworks/ALUT.framework' @@ -21,7 +28,7 @@ def fix_install_names(object) `install_name_tool -change #{oldName} #{newName} #{object}` end - oldName = "libOpenThreads.#{openThreadsSoVersion}.dylib" + oldName = "libOpenThreads.#{$openThreadsSoVersion}.dylib" newName= "@executable_path/../Frameworks/#{oldName}" `install_name_tool -change #{oldName} #{newName} #{object}` @@ -67,7 +74,7 @@ $osgLibs.each do |l| end # and not forgetting OpenThreads -libFile = "libOpenThreads.#{openThreadsSoVersion}.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 deleted file mode 100755 index 508b07bf1..000000000 --- a/package/mac/run-osgversion +++ /dev/null @@ -1,4 +0,0 @@ -#/bin/bash -DYLD_LIBRARY_PATH=$PWD/dist/lib -./dist/bin/osgversion $1 -