<pre style='margin:0'>
kimura wataru (kimuraw) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/e90cd6dbcd71612e3ca52417f751b2ad183df34f">https://github.com/macports/macports-ports/commit/e90cd6dbcd71612e3ca52417f751b2ad183df34f</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit e90cd6dbcd71612e3ca52417f751b2ad183df34f
</span>Author: kimura wataru <kimuraw@i.nifty.jp>
AuthorDate: Sat Dec 24 21:40:30 2016 +0900
<span style='display:block; white-space:pre;color:#404040;'> group/ruby-1.0.tcl: introduce "ruby.branches" to support subports
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> "ruby.branches" works like "perl5.branches" or "php.branches".
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> example:
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> PortSystem 1.0
</span><span style='display:block; white-space:pre;color:#404040;'> PortGroup ruby 1.0
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> ruby.branches 2.3 2.2
</span><span style='display:block; white-space:pre;color:#404040;'> ruby.setup tk 0.1.1 gem
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> # -> adds subport rb23-tk and rb22-tk
</span>---
_resources/port1.0/group/ruby-1.0.tcl | 84 ++++++++++++++++++++++++++---------
1 file changed, 64 insertions(+), 20 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/_resources/port1.0/group/ruby-1.0.tcl b/_resources/port1.0/group/ruby-1.0.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 2511e52..e96ec60 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/_resources/port1.0/group/ruby-1.0.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/_resources/port1.0/group/ruby-1.0.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -32,10 +32,13 @@
</span>
# Usage:
#
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# 1. use ruby.setup
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# 1. use ruby.setup and ruby.branches
</span> #
# PortGroup ruby 1.0
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# ruby.setup module version type {} ruby23
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# ruby.branches 2.3 2.2
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# ruby.setup module version type
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# # - adds subport "rb23-module" and "rb22-module"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# # - sets replaced_by to rb23-moudle (apply first item of branches)
</span> #
# 2. use ruby.branch
#
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -45,6 +48,8 @@
</span> # build.cmd ${ruby.bin}
# options:
<span style='display:block; white-space:pre;background:#e0ffe0;'>+# ruby.branches: the ruby versions supported by this module.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# this introduces subports such as rb23-, rb22-, ...
</span> # ruby.branch: select ruby version. 2.3, 2.2, 2.1, 2.0, 1.9 or 1.8.
# ruby.link_binaries: whether generate suffixed symlink under ${prefix}/bin
# or not.
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -63,10 +68,16 @@
</span> # values from ruby.setup:
# ruby.module: port name without prefix. rb-${ruby.module}.
# ruby.project: project name at rubygems or sourceforge.
<span style='display:block; white-space:pre;background:#e0ffe0;'>+#
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# note:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# [gem] use destroot.post_args-append begins "--" to pass options to extconf.rb
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# > ruby.setup moudle version gem
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# > destroot.post_args-append -- --with-any-option
</span>
options ruby.default_branch
default ruby.default_branch 1.8
<span style='display:block; white-space:pre;background:#ffe0e0;'>-options ruby.branch
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+options ruby.branch ruby.branches
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+default ruby.branches {}
</span> options ruby.bin ruby.rdoc ruby.gem ruby.rake ruby.bindir ruby.gemdir ruby.suffix
options ruby.api_version ruby.lib ruby.archlib
# ruby.version is obsoleted. use ruby.api_version.
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -147,6 +158,7 @@ default ruby.branch ${ruby.default_branch}
</span> # ruby group setup procedure; optional for ruby 1.8 if you want only
# basic variables, like ruby.lib and ruby.archlib.
proc ruby.setup {module vers {type "install.rb"} {docs {}} {source "custom"} {implementation "ruby"}} {
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ global name subport ruby.branches
</span> global destroot prefix worksrcpath os.platform
global ruby.bin ruby.rdoc ruby.gem ruby.rake ruby.branch
global ruby.api_version ruby.lib ruby.suffix ruby.bindir ruby.gemdir
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -160,19 +172,6 @@ proc ruby.setup {module vers {type "install.rb"} {docs {}} {source "custom"} {im
</span> # for setup.rb +universal
global ruby.config_rubyprog_name
<span style='display:block; white-space:pre;background:#ffe0e0;'>- switch ${implementation} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ruby23 { ruby.branch 2.3 }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ruby22 { ruby.branch 2.2 }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ruby21 { ruby.branch 2.1 }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ruby20 { ruby.branch 2.0 }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ruby19 { ruby.branch 1.9 }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ruby { ruby.branch 1.8 }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- default {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_error "ruby.setup: unknown implementation '${implementation}' specified (ruby23, ruby22, ruby21, ruby20, ruby19 or ruby possible)"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return -code error "ruby.setup failed"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span> # define ruby global names and lists
# check if module is a list or string
if {[llength ${module}] > 1} {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -187,9 +186,56 @@ proc ruby.setup {module vers {type "install.rb"} {docs {}} {source "custom"} {im
</span> set ruby.project ${module}
set ruby.filename ${module}
}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {${ruby.branches} ne ""} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # add subports rbXX-module from ${ruby.branches}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {![info exists name]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ name rb-[string tolower ${ruby.module}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[string match rb-* $name]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set rootname [string range $name 3 end]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach v ${ruby.branches} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set suffix [join [split ${v} .] {}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ subport rb${suffix}-${rootname} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ruby.branch ${v}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ depends_lib port:ruby${ruby.suffix}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$subport eq $name} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # set first item in ${ruby.branches} to ruby.branch
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ruby.branch [lindex [split ${ruby.branches}] 0]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set suffix [join [split ${ruby.branch} .] {}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ distfiles
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ supported_archs noarch
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ replaced_by rb${suffix}-${rootname}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ depends_lib-append port:rb${suffix}-${rootname}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ use_configure no
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ build {}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ destroot {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ xinstall -d -m 755 ${destroot}${prefix}/share/doc/${name}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ system "echo $name is a stub port > ${destroot}${prefix}/share/doc/${name}/README"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ switch ${implementation} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ruby23 { ruby.branch 2.3 }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ruby22 { ruby.branch 2.2 }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ruby21 { ruby.branch 2.1 }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ruby20 { ruby.branch 2.0 }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ruby19 { ruby.branch 1.9 }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ruby { ruby.branch 1.8 }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ default {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_error "ruby.setup: unknown implementation '${implementation}' specified (ruby23, ruby22, ruby21, ruby20, ruby19 or ruby possible)"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return -code error "ruby.setup failed"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ name rb${ruby.suffix}-[string tolower ${ruby.module}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ depends_lib port:${implementation}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> set ruby.docs ${docs}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- name rb${ruby.suffix}-[string tolower ${ruby.module}]
</span> version ${vers}
categories ruby
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -219,8 +265,6 @@ proc ruby.setup {module vers {type "install.rb"} {docs {}} {source "custom"} {im
</span> distname ${ruby.filename}-${vers}
dist_subdir ruby
<span style='display:block; white-space:pre;background:#ffe0e0;'>- depends_lib port:${implementation}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span> post-extract {
# Create the work directory for gem-based ruby ports.
file mkdir ${worksrcpath}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -409,7 +453,7 @@ proc ruby.setup {module vers {type "install.rb"} {docs {}} {source "custom"} {im
</span> use_configure no
extract.suffix .gem
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {${implementation} eq "ruby"} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {${ruby.branch} eq "1.8"} {
</span> depends_lib-append port:rb-rubygems
if {${ruby.module} ne "rake"} {
depends_build-append port:rb-rake
</pre><pre style='margin:0'>
</pre>