Ticket #58975: vim_ruby-loops.patch

File vim_ruby-loops.patch, 3.3 KB (added by iEFdev, 5 years ago)
  • (a) a/Portfile.orig vs. (b) b/Portfile

    diff --git a/Portfile.orig b/Portfile
    index d3ec344..5eb6f5f 100644
    a b variant python37 conflicts python36 description {Enable Python scripting} { 
    129129    depends_build-append port:autoconf
    130130}
    131131
     132
     133# Set latest version of ruby
     134set rb_latest 26
    132135variant ruby requires ruby18 description {Compatibility variant, requires +ruby18} {}
    133 variant ruby18 conflicts ruby19 ruby20 ruby21 ruby22 ruby23 ruby24 ruby25 description {Enable Ruby scripting} {
    134     configure.args-append   --enable-rubyinterp
    135     configure.args-append   --with-ruby-command=${prefix}/bin/ruby1.8
    136     depends_lib-append      port:ruby
    137 }
    138 variant ruby19 conflicts ruby18 ruby20 ruby21 ruby22 ruby23 ruby24 ruby25 description {Enable Ruby scripting} {
    139     configure.args-append   --enable-rubyinterp
    140     configure.args-append   --with-ruby-command=${prefix}/bin/ruby1.9
    141     depends_lib-append      port:ruby19
    142 }
    143 variant ruby20 conflicts ruby18 ruby19 ruby21 ruby22 ruby23 ruby24 ruby25 description {Enable Ruby scripting} {
    144     configure.args-append   --enable-rubyinterp
    145     configure.args-append   --with-ruby-command=${prefix}/bin/ruby2.0
    146     depends_lib-append      port:ruby20
    147 }
    148 variant ruby21 conflicts ruby18 ruby19 ruby20 ruby22 ruby23 ruby24 ruby25 description {Enable Ruby scripting} {
    149     configure.args-append   --enable-rubyinterp
    150     configure.args-append   --with-ruby-command=${prefix}/bin/ruby2.1
    151     depends_lib-append      port:ruby21
    152 }
    153 variant ruby22 conflicts ruby18 ruby19 ruby20 ruby21 ruby23 ruby24 ruby25 description {Enable Ruby scripting} {
    154     configure.args-append   --enable-rubyinterp
    155     configure.args-append   --with-ruby-command=${prefix}/bin/ruby2.2
    156     depends_lib-append      port:ruby22
    157 }
    158 variant ruby23 conflicts ruby18 ruby19 ruby20 ruby21 ruby22 ruby24 ruby25 description {Enable Ruby scripting} {
    159     configure.args-append   --enable-rubyinterp
    160     configure.args-append   --with-ruby-command=${prefix}/bin/ruby2.3
    161     depends_lib-append      port:ruby23
    162 }
    163 variant ruby24 conflicts ruby18 ruby19 ruby20 ruby21 ruby22 ruby23 ruby25 description {Enable Ruby scripting} {
    164     configure.args-append   --enable-rubyinterp
    165     configure.args-append   --with-ruby-command=${prefix}/bin/ruby2.4
    166     depends_lib-append      port:ruby24
    167 }
    168 variant ruby25 conflicts ruby18 ruby19 ruby20 ruby21 ruby22 ruby23 ruby24 description {Enable Ruby scripting} {
    169     configure.args-append   --enable-rubyinterp
    170     configure.args-append   --with-ruby-command=${prefix}/bin/ruby2.5
    171     depends_lib-append      port:ruby25
     136
     137set rb_versions {}
     138
     139for {set v 18} {$v <= ${rb_latest}} {incr v} {
     140    lappend rb_versions ruby${v}
     141}
     142
     143foreach rb_version ${rb_versions} {
     144    set rbi [lsearch ${rb_versions} ${rb_version}]
     145    set rb_conflict_versions [lreplace ${rb_versions} ${rbi} ${rbi}]
     146    set rb_bin_version [regsub {(\d{1})(\d){1}} ${rb_version} {\1.\2}]
     147
     148    variant ${rb_version} conflicts $rb_conflict_versions description {Enable Ruby scripting} {
     149        configure.args-append   --enable-rubyinterp
     150        configure.args-append   --with-ruby-command=${prefix}/bin/${rb_bin_version}
     151    }
     152
     153    if {[variant_isset ${rb_version}]} {
     154        depends_lib-append      port:[expr {${rb_version} eq {ruby18} ? {ruby} : ${rb_version}}]
     155    }
    172156}
    173157
    174158variant tcl description {Enable Tcl scripting} {