[49786] users/kimuraw/ruby_select

kimuraw at macports.org kimuraw at macports.org
Fri Apr 17 23:35:01 PDT 2009


Revision: 49786
          http://trac.macports.org/changeset/49786
Author:   kimuraw at macports.org
Date:     2009-04-17 23:35:00 -0700 (Fri, 17 Apr 2009)
Log Message:
-----------
2009-04-18  kimura wataru <kimuraw>

	* lang/ruby/Portfile:
	- rename bin/* -> bin/*18
	- use lib/ruby/1.8.7, not lib/ruby/1.8

Modified Paths:
--------------
    users/kimuraw/ruby_select/lang/ruby/Portfile

Added Paths:
-----------
    users/kimuraw/ruby_select/ChangeLog

Added: users/kimuraw/ruby_select/ChangeLog
===================================================================
--- users/kimuraw/ruby_select/ChangeLog	                        (rev 0)
+++ users/kimuraw/ruby_select/ChangeLog	2009-04-18 06:35:00 UTC (rev 49786)
@@ -0,0 +1,6 @@
+2009-04-18  kimura wataru <kimuraw>
+
+	* lang/ruby/Portfile:
+	- rename bin/* -> bin/*18
+	- use lib/ruby/1.8.7, not lib/ruby/1.8
+

Modified: users/kimuraw/ruby_select/lang/ruby/Portfile
===================================================================
--- users/kimuraw/ruby_select/lang/ruby/Portfile	2009-04-18 05:00:35 UTC (rev 49785)
+++ users/kimuraw/ruby_select/lang/ruby/Portfile	2009-04-18 06:35:00 UTC (rev 49786)
@@ -59,6 +59,14 @@
 # ignore minor version for archdir, like i686-darwin9
 configure.env	UNAME_RELEASE=${os.major}
 
+post-configure {
+	# use lib/ruby/1.8.7, lib/ruby/1.8, to allow activate both of ruby186
+	# and ruby(ruby18).
+	# but use 1.8 for sitedir and vendordir (not change)
+	reinplace "s|lib/ruby/1.8|lib/ruby/1.8.7|g" ${worksrcpath}/config.h
+	reinplace "s|\$(libdir)/ruby/\$(ruby_version)|\$(libdir)/ruby/1.8.7|" ${worksrcpath}/mkconfig.rb
+}
+
 destroot.target	install install-doc
 post-destroot {
 	foreach type {site vendor} {
@@ -73,8 +81,30 @@
 			destroot.keepdirs-append ${subdir}
 		}
 	}
+	# XXX ruby_select XXX
+	set suffix 18
+	foreach cmd [glob -type f ${destroot}${prefix}/bin/*] {
+		file rename ${cmd} ${cmd}${suffix}
+	    if {[file tail ${cmd}] != "ruby"} {
+		    reinplace "s|^#!${prefix}/bin/ruby|#!${prefix}/bin/ruby${suffix}|" \
+				${cmd}${suffix}
+		}
+	}
+	file rename ${destroot}${prefix}/share/man/man1/ruby.1 \
+		${destroot}${prefix}/share/man/man1/ruby${suffix}.1
+    # TODO: remove libruby.dylib, rename libruby-static.a
+    # TODO: ri documents directory
 }
 
+# create symlink for ruby18 and ,...
+# TODO: ruby_select would do this.
+post-activate {
+	set suffix 18
+	foreach cmd {ruby erb irb rdoc ri testrb} {
+		file link -symbolic ${prefix}/bin/${cmd} ${prefix}/bin/${cmd}${suffix}
+	}
+}
+
 variant universal {
 	configure.args-delete --disable-dependency-tracking
 	build.target-append  EXTLDFLAGS="${configure.universal_ldflags}" CFLAGS="${configure.universal_cflags}"	
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090417/bec0494c/attachment.html>


More information about the macports-changes mailing list