[macruby-changes] [4040] MacRuby/trunk

source_changes at macosforge.org source_changes at macosforge.org
Fri May 7 11:26:15 PDT 2010


Revision: 4040
          http://trac.macosforge.org/projects/ruby/changeset/4040
Author:   martinlagardette at apple.com
Date:     2010-05-07 11:26:13 -0700 (Fri, 07 May 2010)
Log Message:
-----------
Allow definition of installation version

Modified Paths:
--------------
    MacRuby/trunk/instruby.rb
    MacRuby/trunk/rakelib/builder/options.rb
    MacRuby/trunk/rakelib/builder/templates.rb

Modified: MacRuby/trunk/instruby.rb
===================================================================
--- MacRuby/trunk/instruby.rb	2010-05-07 08:34:14 UTC (rev 4039)
+++ MacRuby/trunk/instruby.rb	2010-05-07 18:26:13 UTC (rev 4040)
@@ -228,6 +228,7 @@
 dll = CONFIG["LIBRUBY_SO"]
 lib = CONFIG["LIBRUBY"]
 arc = CONFIG["LIBRUBY_A"]
+install_version = CONFIG['INSTALL_VERSION']
 
 install?(:local, :arch, :bin, :'bin-arch') do
   puts "installing binary commands"
@@ -466,7 +467,7 @@
     File.join(resources, 'English.lproj')
   rm_f File.join(base, '..', 'Current') if 
     File.symlink?(with_destdir(File.join(base, '..', 'Current')))
-  ln_sfh MACRUBY_VERSION.to_s, File.join(base, '..', 'Current')
+  ln_sfh install_version.to_s, File.join(base, '..', 'Current')
   ln_sfh 'Versions/Current/Headers', File.join(base, '../../Headers')
   ln_sfh 'Versions/Current/MacRuby', File.join(base, '../../MacRuby')
   ln_sfh 'Versions/Current/Resources', File.join(base, '../../Resources')
@@ -482,7 +483,7 @@
     # Except rb_nibtool & llc!
     next if bin == 'rb_nibtool' or bin == 'llc'
     link = File.join("../../../", CONFIG['bindir'], bin)
-    link.sub!(/#{MACRUBY_VERSION}/, 'Current')
+    link.sub!(/#{install_version}/, 'Current')
     ln_sfh link, File.join(dest_bin, File.basename(bin))
   end
   # Installing man pages links.
@@ -495,13 +496,13 @@
       Dir.entries(File.join(with_destdir(CONFIG['mandir']), mandir)).each do |man|
         next if man[0] == '.'
         link = File.join("../../../../../", CONFIG['mandir'], mandir, man)
-        link.sub!(/#{MACRUBY_VERSION}/, 'Current')
+        link.sub!(/#{install_version}/, 'Current')
         ln_sfh link, File.join(dest_man, File.basename(mandir), 
 	  File.basename(man))
       end
     else
       link = File.join("../../../../", CONFIG['mandir'], mandir)
-      link.sub!(/#{MACRUBY_VERSION}/, 'Current')
+      link.sub!(/#{install_version}/, 'Current')
       ln_sfh link, File.join(dest_man, File.basename(mandir))
     end
   end

Modified: MacRuby/trunk/rakelib/builder/options.rb
===================================================================
--- MacRuby/trunk/rakelib/builder/options.rb	2010-05-07 08:34:14 UTC (rev 4039)
+++ MacRuby/trunk/rakelib/builder/options.rb	2010-05-07 18:26:13 UTC (rev 4040)
@@ -77,12 +77,13 @@
 unless defined?(MACRUBY_VERSION)
   MACRUBY_VERSION = version_h.scan(/#\s*define\s+MACRUBY_VERSION\s+\"(.*)\"/)[0][0]
 end
+INSTALL_VERSION = b.option('install_version', MACRUBY_VERSION)
 
 uname_release_number = (ENV['UNAME_RELEASE'] or `uname -r`.scan(/^(\d+)\.\d+\.(\d+)/)[0].join('.'))
 NEW_RUBY_PLATFORM = 'universal-darwin' + uname_release_number
 
 FRAMEWORK_PATH = File.join(FRAMEWORK_INSTDIR, FRAMEWORK_NAME + '.framework')
-FRAMEWORK_VERSION = File.join(FRAMEWORK_PATH, 'Versions', MACRUBY_VERSION)
+FRAMEWORK_VERSION = File.join(FRAMEWORK_PATH, 'Versions', INSTALL_VERSION)
 FRAMEWORK_USR = File.join(FRAMEWORK_VERSION, 'usr')
 FRAMEWORK_USR_LIB = File.join(FRAMEWORK_USR, 'lib')
 FRAMEWORK_USR_LIB_RUBY = File.join(FRAMEWORK_USR_LIB, 'ruby')

Modified: MacRuby/trunk/rakelib/builder/templates.rb
===================================================================
--- MacRuby/trunk/rakelib/builder/templates.rb	2010-05-07 08:34:14 UTC (rev 4039)
+++ MacRuby/trunk/rakelib/builder/templates.rb	2010-05-07 18:26:13 UTC (rev 4040)
@@ -50,6 +50,7 @@
   CONFIG["DESTDIR"] = DESTDIR
   CONFIG["INSTALL"] = '/usr/bin/install -c'
   CONFIG["prefix"] = (TOPDIR || DESTDIR + "#{FRAMEWORK_USR}")
+  CONFIG["INSTALL_VERSION"] = "#{INSTALL_VERSION}"
   CONFIG["EXEEXT"] = ""
   CONFIG["ruby_install_name"] = "#{RUBY_INSTALL_NAME}"
   CONFIG["RUBY_INSTALL_NAME"] = "#{RUBY_INSTALL_NAME}"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100507/93dce516/attachment.html>


More information about the macruby-changes mailing list