Ticket #15912: add_parameter_implementation_to_ruby_group_setup.patch
File add_parameter_implementation_to_ruby_group_setup.patch, 3.7 KB (added by febeling@…, 16 years ago) |
---|
-
ruby-1.0.tcl
31 31 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 32 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 33 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 #35 # Set some variables.36 set ruby.bin ${prefix}/bin/ruby37 set ruby.rdoc ${prefix}/bin/rdoc38 34 35 # Define these variables assuming ruby1.8, they are possibly adjusted 36 # by ruby.setup arguments, and also accessible in the portfile after 37 # the call to ruby.setup 38 set ruby.bin ${prefix}/bin/ruby 39 set ruby.rdoc ${prefix}/bin/rdoc 40 set ruby.gem ${prefix}/bin/gem 41 39 42 proc ruby.extract_config {var {default ""}} { 40 43 global ruby.bin 41 44 if {[catch {set val [exec ${ruby.bin} -e "require 'rbconfig';puts Config::CONFIG\[\"${var}\"\]"]}]} { … … 51 54 set ruby.lib [ruby.extract_config vendorlibdir ${prefix}/lib/ruby/vendor_ruby/${ruby.version}] 52 55 set ruby.archlib [ruby.extract_config vendorarchdir ${ruby.lib}/${ruby.arch}] 53 56 54 # define these empty initially, they are set by ruby.setup arguments55 57 set ruby.module "" 56 58 set ruby.filename "" 57 59 set ruby.project "" 58 60 set ruby.docs {} 59 61 set ruby.srcdir "" 60 62 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 (optionally to call for ruby 1.8) 64 proc ruby.setup {module vers {type "install.rb"} {docs {}} {source "custom"} {implementation "ruby"}} { 65 global destroot prefix worksrcpath os.platform 66 global ruby.bin ruby.rdoc ruby.gem 67 global ruby.version 68 global ruby.lib ruby.archlib 69 global ruby.module ruby.filename ruby.project ruby.docs ruby.srcdir 66 70 71 if {${implementation} eq "ruby19"} { 72 set ruby.bin ${prefix}/bin/ruby1.9 73 set ruby.rdoc ${prefix}/bin/rdoc1.9 74 set ruby.gem ${prefix}/bin/gem1.9 75 set ruby.port_prefix rb19 76 } elseif {${implementation} eq "ruby"} { 77 # ruby.bin, ruby.rdoc, and ruby.gem set to 1.8 by default 78 set ruby.port_prefix rb 79 } else { 80 ui_error "ruby.setup: unknown implementation '${implementation}' specified (ruby, ruby19 possible)" 81 return -code error "ruby.setup failed" 82 } 83 84 # re-define variables to pick up possible implemantation change 85 set ruby.version [ruby.extract_config ruby_version] 86 set ruby.arch [ruby.extract_config arch ${os.platform}] 87 set ruby.lib [ruby.extract_config vendorlibdir ${prefix}/lib/ruby/vendor_ruby/${ruby.version}] 88 set ruby.archlib [ruby.extract_config vendorarchdir ${ruby.lib}/${ruby.arch}] 89 67 90 # define ruby global names and lists 68 91 # check if module is a list or string 69 92 if {[llength ${module}] > 1} { … … 80 103 } 81 104 set ruby.docs ${docs} 82 105 83 name rb-[string tolower ${ruby.module}]106 name ${ruby.port_prefix}-[string tolower ${ruby.module}] 84 107 version ${vers} 85 108 categories ruby 86 109 … … 131 154 distname ${ruby.filename}-${vers} 132 155 dist_subdir ruby 133 156 134 depends_lib p ath:${ruby.bin}:ruby157 depends_lib port:${implementation} 135 158 136 159 post-extract { 137 160 # Create the work directory for gem-based ruby ports. … … 275 298 } 276 299 277 300 destroot { 278 system "cd ${worksrcpath} && ${ prefix}/bin/geminstall --local --force --install-dir ${destroot}${prefix}/lib/ruby/gems/${ruby.version} ${distpath}/${distname}"301 system "cd ${worksrcpath} && ${ruby.gem} install --local --force --install-dir ${destroot}${prefix}/lib/ruby/gems/${ruby.version} ${distpath}/${distname}" 279 302 280 303 set binDir ${destroot}${prefix}/lib/ruby/gems/${ruby.version}/bin 281 304 if {[file isdirectory $binDir]} {