[49791] users/kimuraw/ruby_select

kimuraw at macports.org kimuraw at macports.org
Sat Apr 18 02:21:21 PDT 2009


Revision: 49791
          http://trac.macports.org/changeset/49791
Author:   kimuraw at macports.org
Date:     2009-04-18 02:21:21 -0700 (Sat, 18 Apr 2009)
Log Message:
-----------
2009-04-18  kimura wataru <kimuraw>

	* lang/ruby/Portfile, lang/ruby/files/patch-libruby_nosuffix.diff:
	- use --program-suffix=18
	- linking libruby.dylib, not libruby18.dylib, when VENDOR_SPECIFIC is
	  enabled

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

Added Paths:
-----------
    users/kimuraw/ruby_select/lang/ruby/files/patch-libruby_nosuffix.diff

Modified: users/kimuraw/ruby_select/ChangeLog
===================================================================
--- users/kimuraw/ruby_select/ChangeLog	2009-04-18 09:18:41 UTC (rev 49790)
+++ users/kimuraw/ruby_select/ChangeLog	2009-04-18 09:21:21 UTC (rev 49791)
@@ -1,5 +1,10 @@
 2009-04-18  kimura wataru <kimuraw>
 
+	* lang/ruby/Portfile, lang/ruby/files/patch-libruby_nosuffix.diff:
+	- use --program-suffix=18
+	- linking libruby.dylib, not libruby18.dylib, when VENDOR_SPECIFIC is
+	  enabled
+
 	* lang/ruby/Portfile, lang/ruby/files/patch-rdoc_sysdir.diff:
 	- use ${prefix}/share/ri/1.8/system1.8.7/ for rdoc sysdir
 

Modified: users/kimuraw/ruby_select/lang/ruby/Portfile
===================================================================
--- users/kimuraw/ruby_select/lang/ruby/Portfile	2009-04-18 09:18:41 UTC (rev 49790)
+++ users/kimuraw/ruby_select/lang/ruby/Portfile	2009-04-18 09:21:21 UTC (rev 49791)
@@ -48,6 +48,8 @@
 
 # change rdoc "system" path to "system1.8.7"
 patchfiles-append patch-rdoc_sysdir.diff
+# linking libruby.dylib not libruby${suffix}.dylib when VENDOR_SPECIFIC = true
+patchfiles-append patch-libruby_nosuffix.diff
 
 use_autoconf	yes
 autoconf.cmd	autoreconf
@@ -55,10 +57,14 @@
 
 use_parallel_build		yes
 
+set suffix 18
+set ruby_rel 1.8.7
+
 configure.args	--enable-shared \
 				--mandir="${prefix}/share/man" \
 				--enable-pthread \
-				--with-vendordir=${prefix}/lib/ruby/vendor_ruby
+				--with-vendordir=${prefix}/lib/ruby/vendor_ruby \
+				--program-suffix=${suffix}
 # ignore minor version for archdir, like i686-darwin9
 configure.env	UNAME_RELEASE=${os.major}
 
@@ -66,8 +72,10 @@
 	# 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
+	reinplace "s|lib/ruby/1.8|lib/ruby/${ruby_rel}|g" \
+		${worksrcpath}/config.h
+	reinplace "s|\$(libdir)/ruby/\$(ruby_version)|\$(libdir)/ruby/${ruby_rel}|" \
+		${worksrcpath}/mkconfig.rb
 }
 
 destroot.target	install install-doc
@@ -84,30 +92,25 @@
 			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
 }
 
 # create symlink for ruby18 and ,...
 # TODO: ruby_select would do this.
 post-activate {
-	set suffix 18
 	foreach cmd {ruby erb irb rdoc ri testrb} {
 		if {![file exists ${prefix}/bin/${cmd}]} {
 			file link -symbolic ${prefix}/bin/${cmd} \
 				${prefix}/bin/${cmd}${suffix}
 		}
 	}
+	if {![file exists ${prefix}/lib/libruby.dylib]} {
+			file link -symbolic ${prefix}/lib/libruby.dylib \
+				${prefix}/lib/libruby${suffix}.dylib
+    }
+	if {![file exists ${prefix}/lib/libruby-static.a]} {
+			file link -symbolic ${prefix}/lib/libruby-static.a \
+				${prefix}/lib/libruby${suffix}-static.a
+    }
 }
 
 variant universal {

Added: users/kimuraw/ruby_select/lang/ruby/files/patch-libruby_nosuffix.diff
===================================================================
--- users/kimuraw/ruby_select/lang/ruby/files/patch-libruby_nosuffix.diff	                        (rev 0)
+++ users/kimuraw/ruby_select/lang/ruby/files/patch-libruby_nosuffix.diff	2009-04-18 09:21:21 UTC (rev 49791)
@@ -0,0 +1,10 @@
+--- mkconfig.rb.orig	2009-04-18 18:08:27.000000000 +0900
++++ mkconfig.rb	2009-04-18 18:10:28.000000000 +0900
+@@ -153,6 +153,7 @@
+     CONFIG["sitedir"] = CONFIG["vendordir"]
+     CONFIG["sitelibdir"] = CONFIG["vendorlibdir"]
+     CONFIG["sitearchdir"] = CONFIG["vendorarchdir"]
++    CONFIG["RUBY_SO_NAME"] = "ruby"
+   end
+   CONFIG["topdir"] = File.dirname(__FILE__)
+   MAKEFILE_CONFIG = {}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090418/69662c8f/attachment-0001.html>


More information about the macports-changes mailing list