Ticket #6963: ruby-1.0.tcl.patch

File ruby-1.0.tcl.patch, 2.2 KB (added by rcavanaugh@…, 18 years ago)

ATTACHMENT: patch implementing rubygems support for ruby.setup

  • ruby-1.0.tcl

    old new  
    235235                        }
    236236                        destroot.args           RUBY="${ruby.bin} -rvendor-specific"
    237237                }
     238                gem {
     239                        use_configure no
     240                        extract.suffix .gem
     241                       
     242                        depends_lib-append      port:rb-rubygems
     243                       
     244                        extract {}
     245                        build {}
     246                       
     247                        pre-destroot {
     248                                xinstall -d -m 0755 ${destroot}${prefix}/lib/ruby/gems/${ruby.version}
     249                        }
     250                       
     251                        destroot {
     252                          cd [option distpath]
     253                          system "gem install --local --force --install-dir ${destroot}${prefix}/lib/ruby/gems/${ruby.version} ${distname}"
     254                       
     255                                set binDir ${destroot}${prefix}/lib/ruby/gems/${ruby.version}/bin
     256                                if {[file isdirectory $binDir]} {
     257                                        cd $binDir
     258                                        foreach file [readdir $binDir] {
     259                                                file copy $file ${destroot}${prefix}/bin
     260                                        }
     261                                }
     262                        }
     263                }
    238264                default {
    239265                        ui_error "ruby.setup: unknown setup type '${type}' specified!"
    240266                        return -code error "ruby.setup failed"
    241267                }
    242268        }
    243 
    244         post-destroot {
    245                 cd ${worksrcpath}
    246                 # Install documentation files (if specified)
    247                 if {[llength ${ruby.docs}] > 0} {
    248                         set docPath ${prefix}/share/doc/${name}
    249                         xinstall -d -m 0755 ${destroot}${docPath}
    250                         foreach docitem ${ruby.docs} {
    251                                 if {[file isdirectory ${docitem}]} {
    252                                         foreach dir [exec find ${docitem} -type d] {
    253                                                 xinstall -d -m 0755 ${destroot}${docPath}/${dir}
    254                                         }
    255                                         foreach file [exec find ${docitem} -type f] {
    256                                                 xinstall -m 0644 ${file} ${destroot}${docPath}/${file}
     269       
     270        if { ${type} != "gem" } {
     271                post-destroot {
     272                        cd ${worksrcpath}
     273                        # Install documentation files (if specified)
     274                        if {[llength ${ruby.docs}] > 0} {
     275                                set docPath ${prefix}/share/doc/${name}
     276                                xinstall -d -m 0755 ${destroot}${docPath}
     277                                foreach docitem ${ruby.docs} {
     278                                        if {[file isdirectory ${docitem}]} {
     279                                                foreach dir [exec find ${docitem} -type d] {
     280                                                        xinstall -d -m 0755 ${destroot}${docPath}/${dir}
     281                                                }
     282                                                foreach file [exec find ${docitem} -type f] {
     283                                                        xinstall -m 0644 ${file} ${destroot}${docPath}/${file}
     284                                                }
     285                                        } else {
     286                                                xinstall -m 0644 ${docitem} ${destroot}${docPath}
    257287                                        }
    258                                 } else {
    259                                         xinstall -m 0644 ${docitem} ${destroot}${docPath}
    260288                                }
    261289                        }
    262290                }