Projects
New Ticket     Wiki     Browse Source     Timeline     Roadmap     Bug Reports     Search

Changeset 38683 for trunk/base/src

Show
Ignore:
Timestamp:
07/28/08 14:21:33 (4 months ago)
Author:
febeling@…
Message:

Support for ruby19 ports in the ruby port group.

The command ruby.setup accepts an new optional
parameter "implementation", which is ruby18 by
default, and can also be ruby19. (As more ruby
implementations appear these may be added as
well.) Unit tests are in the new sub-directory
tests/.

Location:
trunk/base/src/port1.0/resources/group
Files:
2 added
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/base/src/port1.0/resources/group/Makefile

    r28463 r38683  
    1313 
    1414test: 
     15        ${TCLSH} tests/ruby-1.0.tcl 
    1516 
    1617install: 
  • trunk/base/src/port1.0/resources/group/ruby-1.0.tcl

    r36656 r38683  
    3232# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
    3333# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
    34 # 
    35 # Set some variables. 
    36 set ruby.bin    ${prefix}/bin/ruby 
    37 set ruby.rdoc   ${prefix}/bin/rdoc 
     34 
     35# Define these variables assuming ruby1.8 to make them accessible in 
     36# the portfile after port group declaration. They can be modified by 
     37# ruby.setup, e.g. to use another ruby than 1.8. 
     38set ruby.bin            ${prefix}/bin/ruby 
     39set ruby.rdoc           ${prefix}/bin/rdoc 
     40set ruby.gem            ${prefix}/bin/gem 
    3841 
    3942proc ruby.extract_config {var {default ""}} { 
     
    5255set ruby.archlib        [ruby.extract_config vendorarchdir ${ruby.lib}/${ruby.arch}] 
    5356 
    54 # define these empty initially, they are set by ruby.setup arguments 
    5557set ruby.module         "" 
    5658set ruby.filename       "" 
     
    5961set ruby.srcdir         "" 
    6062 
    61 # ruby group setup procedure 
    62 proc ruby.setup {module vers {type "install.rb"} {docs {}} {source "custom"}} { 
    63         global destroot prefix worksrcpath 
    64         global ruby.bin ruby.lib 
    65         global ruby.module ruby.project ruby.filename ruby.docs ruby.srcdir 
     63# ruby group setup procedure; optional for ruby 1.8 if you want only 
     64# basic variables, like ruby.lib and ruby.archlib. 
     65proc ruby.setup {module vers {type "install.rb"} {docs {}} {source "custom"} {implementation "ruby"}} { 
     66        global destroot prefix worksrcpath os.platform 
     67        global ruby.bin ruby.rdoc ruby.gem 
     68        global ruby.version  
     69        global ruby.lib ruby.archlib 
     70        global ruby.module ruby.filename ruby.project ruby.docs ruby.srcdir 
     71 
     72        if {${implementation} eq "ruby19"} { 
     73                set ruby.bin    ${prefix}/bin/ruby1.9 
     74                set ruby.rdoc   ${prefix}/bin/rdoc1.9 
     75                set ruby.gem    ${prefix}/bin/gem1.9 
     76                set ruby.port_prefix rb19 
     77        } elseif {${implementation} eq "ruby"} { 
     78                # ruby.bin, ruby.rdoc, and ruby.gem set to 1.8 by default 
     79                set ruby.port_prefix rb 
     80        } else { 
     81                ui_error "ruby.setup: unknown implementation '${implementation}' specified (ruby, ruby19 possible)" 
     82                return -code error "ruby.setup failed" 
     83        } 
     84 
     85        # re-define variables to pick up possible implemantation change 
     86        set ruby.version        [ruby.extract_config ruby_version] 
     87        set ruby.arch           [ruby.extract_config arch ${os.platform}] 
     88        set ruby.lib            [ruby.extract_config vendorlibdir ${prefix}/lib/ruby/vendor_ruby/${ruby.version}] 
     89        set ruby.archlib        [ruby.extract_config vendorarchdir ${ruby.lib}/${ruby.arch}] 
    6690 
    6791        # define ruby global names and lists 
     
    81105        set ruby.docs   ${docs} 
    82106 
    83         name                    rb-[string tolower ${ruby.module}] 
     107        name                    ${ruby.port_prefix}-[string tolower ${ruby.module}] 
    84108        version                 ${vers} 
    85109        categories              ruby 
     
    132156        dist_subdir             ruby 
    133157 
    134         depends_lib             path:${ruby.bin}:ruby 
     158        depends_lib             port:${implementation} 
    135159 
    136160        post-extract { 
     
    276300                         
    277301                        destroot { 
    278                           system "cd ${worksrcpath} && ${prefix}/bin/gem install --local --force --install-dir ${destroot}${prefix}/lib/ruby/gems/${ruby.version} ${distpath}/${distname}" 
     302                          system "cd ${worksrcpath} && ${ruby.gem} install --local --force --install-dir ${destroot}${prefix}/lib/ruby/gems/${ruby.version} ${distpath}/${distname}" 
    279303                         
    280304                                set binDir ${destroot}${prefix}/lib/ruby/gems/${ruby.version}/bin