------ art_96272_19902155.1187673085513 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 8/20/07, Eric Hodel <drbrain / segment7.net> wrote: > > As you may or may not have heard, RubyGems will be merged into Ruby > 1.9 sometime in October. Before this can happen RubyGems needs to > automatically install dependencies based on platforms. Fortunately > I've got the automatic install part written. Unfortunately I don't > know if I've got figuring out the platforms right. This is where you > come in. > > Dear Lazyweb, > > Here's my proposal for how we recognize platforms. From > Config::CONFIG, take the target_os and run it through a case > statement to figure out OS and OS version (if any). Combine the > target_cpu, OS and OS version. This value is your platform. > > (There will be a rubygems-platforms.gem much like sources.gem that can > be updated as necessary.) > > Using the tattle data (http://tattle.rubygarden.org), the following > code recognizes 26 unique platforms: > > def match(cpu, os) > cpu ase cpu > when /i\d86/ then 'x86' > else cpu > end > > os ase os > when /cygwin/ then [ 'cygwin', nil ] > when /darwin(\d+)?/ then [ 'darwin', $1 ] > when /freebsd(\d+)/ then [ 'freebsd', $1 ] > when /^java([\d.]*)/ then [ 'java', $1 ] > when /linux/ then [ 'linux', $1 ] > when /mingw32/ then [ 'mingw32', nil ] > when /mswin32/ then [ 'mswin32', nil ] > when /openbsd(\d+.\d+)/ then [ 'openbsd', $1 ] > when /solaris(\d+\.\d+)/ then [ 'solaris', $1 ] > else [ 'unknown', nil ] > end > > [cpu, os].flatten.compact.join("-") > end "java" is actually not used in either CPU or OS strings in the config hash currently (this is reflected in the tattle data). JRuby uses "java" either in the 'arch' or 'target' strings: irb(main):002:0> Config::CONFIG.select {|k,v| v /java/} [["archdir", "/Users/nicksieger/Projects/jruby/trunk/jruby/lib/ruby/site_ruby/1.8/java"], ["arch", "i386-java1.5"], ["build", "java1.5"], ["sitearchdir", "/Users/nicksieger/Projects/jruby/trunk/jruby/lib/ruby/site_ruby/1.8/java"], ["target", "java1.5"]] irb(main):003:0> RUBY_PLATFORM "java" Can you work 'arch' into the logic somehow? Or suggest an alternative way to ensure that JRuby/java platform is possible for gems? /Nick ------ art_96272_19902155.1187673085513--