[69133] trunk/dports/lang/ruby19
kimuraw at macports.org
kimuraw at macports.org
Thu Jun 24 13:39:30 PDT 2010
Revision: 69133
http://trac.macports.org/changeset/69133
Author: kimuraw at macports.org
Date: 2010-06-24 13:39:25 -0700 (Thu, 24 Jun 2010)
Log Message:
-----------
lang/ruby19: add patch to solve SocketError at TCPServer.open("localhost", 0).
see http://redmine.ruby-lang.org/issues/show/3124
- fix port upgrade failure of ri-doc on case insensitive filesystem
- indent with tabs, not spaces
Modified Paths:
--------------
trunk/dports/lang/ruby19/Portfile
Added Paths:
-----------
trunk/dports/lang/ruby19/files/patch-ruby_core_29427.diff
Modified: trunk/dports/lang/ruby19/Portfile
===================================================================
--- trunk/dports/lang/ruby19/Portfile 2010-06-24 18:15:42 UTC (rev 69132)
+++ trunk/dports/lang/ruby19/Portfile 2010-06-24 20:39:25 UTC (rev 69133)
@@ -1,95 +1,112 @@
# $Id$
-PortSystem 1.0
+PortSystem 1.0
-name ruby19
-version 1.9.1-p378
+name ruby19
+version 1.9.1-p378
+revision 1
-categories lang ruby
-maintainers kimuraw openmaintainer
-platforms darwin
-description Powerful and clean object-oriented scripting language
-long_description Ruby is the interpreted scripting language for quick \
- and easy object-oriented programming. It has many \
- features to process text files and to do system \
- management tasks (as in Perl). It is simple, \
- straight-forward, extensible, and portable. \
- Version 1.9 contains a new VM called YARV, is faster \
- and slightly incompatible from version 1.8.
+categories lang ruby
+maintainers kimuraw openmaintainer
+platforms darwin
+description Powerful and clean object-oriented scripting language
+long_description Ruby is the interpreted scripting language for quick \
+ and easy object-oriented programming. It has many \
+ features to process text files and to do system \
+ management tasks (as in Perl). It is simple, \
+ straight-forward, extensible, and portable. \
+ Version 1.9 contains a new VM called YARV, is faster \
+ and slightly incompatible from version 1.8.
-homepage http://www.ruby-lang.org/
+homepage http://www.ruby-lang.org/
-master_sites ruby:1.9
-use_bzip2 yes
-distname ruby-${version}
+master_sites ruby:1.9
+use_bzip2 yes
+distname ruby-${version}
-checksums md5 5922459622a23612eb9b68a3586cb5f8
-use_parallel_build yes
+checksums md5 5922459622a23612eb9b68a3586cb5f8 \
+ rmd160 8897f9e635abd4e7cc0cfbaa59494cbecf1427f9 \
+ sha1 d5904575ea83bf47193d473f8d82eec4a17a764c
+use_parallel_build yes
-depends_lib port:libiconv \
- port:readline \
- port:openssl \
- port:zlib \
- port:ncurses
+depends_lib port:libiconv \
+ port:readline \
+ port:openssl \
+ port:zlib \
+ port:ncurses
-configure.args --enable-shared \
- --mandir="${prefix}/share/man" \
- --enable-pthread \
- --without-tk \
- --program-suffix=1.9
+configure.args --enable-shared \
+ --mandir="${prefix}/share/man" \
+ --enable-pthread \
+ --without-tk \
+ --program-suffix=1.9
+# [ruby-core:29427]: on some Mac, TCPServer.open("localhost", 0) raises
+# SocketError "getaddrinfo: nodename nor servname provided, or not
+# known (SocketError)"
+# http://redmine.ruby-lang.org/issues/show/3124
+patchfiles patch-ruby_core_29427.diff
# Ignore minor version for archdir, like i686-darwin9.
# Port "ruby" does the same.
-configure.env UNAME_RELEASE=${os.major}
+configure.env UNAME_RELEASE=${os.major}
post-destroot {
- foreach type {site vendor} {
- set libdir ${destroot}${prefix}/lib/ruby1.9/${type}_ruby
- xinstall -m 0755 -d ${libdir}
- xinstall -m 0644 ${filespath}/${type}-specific.rb ${libdir}
- }
+ foreach type {site vendor} {
+ set libdir ${destroot}${prefix}/lib/ruby1.9/${type}_ruby
+ xinstall -m 0755 -d ${libdir}
+ xinstall -m 0644 ${filespath}/${type}-specific.rb ${libdir}
+ }
- foreach subdir [exec find ${libdir} -type d -empty] {
- destroot.keepdirs-append ${subdir}
- }
+ foreach subdir [exec find ${libdir} -type d -empty] {
+ destroot.keepdirs-append ${subdir}
+ }
+
+ # error at activate, for these case sensitive files
+ foreach rdoc {Exception2MessageMapper/fail-i.yaml \
+ REXML/Parsers/XPathParser/predicate-i.yaml} {
+ if {[file exists ${destroot}${prefix}/share/ri1.9/1.9.1/system/${rdoc}]} {
+ delete ${destroot}${prefix}/share/ri1.9/1.9.1/system/${rdoc}
+ }
+ }
}
variant nosuffix description "Don't add the 1.9 program suffix to the executables. Note: that makes the port conflict with ruby (1.8), rb-rubygems, and rb-rake ports." {
- configure.args-delete --program-suffix=1.9
+ configure.args-delete --program-suffix=1.9
}
variant c_api_docs description "Generate documentation for Ruby C API" {
- depends_build-append port:doxygen
+ depends_build-append port:doxygen
- post-build {
- file mkdir ${workpath}/c_api
- set doxygen_conf ${name}-doxygen.conf
- file copy -force ${filespath}/${doxygen_conf} ${workpath}
- set doxygen_conf_path ${workpath}/${name}-doxygen.conf
- reinplace "s|%WORKPATH%|${workpath}|" ${doxygen_conf_path}
- reinplace "s|%WORKSRCPATH%|${worksrcpath}|" ${doxygen_conf_path}
- system "doxygen ${doxygen_conf_path}"
- }
+ post-build {
+ file mkdir ${workpath}/c_api
+ set doxygen_conf ${name}-doxygen.conf
+ file copy -force ${filespath}/${doxygen_conf} ${workpath}
+ set doxygen_conf_path ${workpath}/${name}-doxygen.conf
+ reinplace "s|%WORKPATH%|${workpath}|" ${doxygen_conf_path}
+ reinplace "s|%WORKSRCPATH%|${worksrcpath}|" ${doxygen_conf_path}
+ system "doxygen ${doxygen_conf_path}"
+ }
- post-destroot {
- set api_docs ${destroot}${prefix}/share/doc/${name}-${version}/html/c_api
- xinstall -m 755 -d ${api_docs}
- eval xinstall -m 640 [glob ${workpath}/c_api/html/*] ${api_docs}
- }
+ post-destroot {
+ set api_docs ${destroot}${prefix}/share/doc/${name}-${version}/html/c_api
+ xinstall -m 755 -d ${api_docs}
+ eval xinstall -m 640 [glob ${workpath}/c_api/html/*] ${api_docs}
+ }
}
variant tk conflicts mactk description "Build using MacPorts Tk" {
- configure.args-delete --without-tk
- configure.args-append --with-tk
- depends_lib-append port:tcl \
- port:tk
+ configure.args-delete --without-tk
+ configure.args-append --with-tk
+ depends_lib-append port:tcl \
+ port:tk
}
variant mactk conflicts tk description "Build using Mac OS X Tk Framework" {
- configure.args-delete --without-tk
- configure.args-append --enable-tcltk-framework
+ configure.args-delete --without-tk
+ configure.args-append --enable-tcltk-framework
}
-livecheck.type regex
-livecheck.url http://ftp.ruby-lang.org/pub/ruby/1.9/
-livecheck.regex ruby-(${version})${extract.suffix}
+livecheck.type regex
+livecheck.url http://ftp.ruby-lang.org/pub/ruby/1.9/
+livecheck.regex ruby-(${version})${extract.suffix}
+
Added: trunk/dports/lang/ruby19/files/patch-ruby_core_29427.diff
===================================================================
--- trunk/dports/lang/ruby19/files/patch-ruby_core_29427.diff (rev 0)
+++ trunk/dports/lang/ruby19/files/patch-ruby_core_29427.diff 2010-06-24 20:39:25 UTC (rev 69133)
@@ -0,0 +1,56 @@
+diff -ur ../ruby-1.9.1-p378.org/ext/socket/socket.c ./ext/socket/socket.c
+--- ../ruby-1.9.1-p378.org/ext/socket/socket.c 2009-01-16 00:35:25.000000000 +0900
++++ ./ext/socket/socket.c 2010-06-25 04:24:19.000000000 +0900
+@@ -228,6 +228,33 @@
+ #endif
+ #endif
+
++static int str_isnumber __P((const char *));
++
++#if defined(__APPLE__)
++/* fix [ruby-core:29427] */
++static int
++ruby_getaddrinfo__darwin(const char *nodename, const char *servname,
++ struct addrinfo *hints, struct addrinfo **res)
++{
++ const char *tmp_servname;
++ struct addrinfo tmp_hints;
++ tmp_servname = servname;
++ MEMCPY(&tmp_hints, hints, struct addrinfo, 1);
++ if (nodename && servname) {
++ if (str_isnumber(tmp_servname) && atoi(servname) == 0) {
++ tmp_servname = NULL;
++#ifdef AI_NUMERICSERV
++ if (tmp_hints.ai_flags) tmp_hints.ai_flags &= ~AI_NUMERICSERV;
++#endif
++ }
++ }
++ int error = getaddrinfo(nodename, tmp_servname, &tmp_hints, res);
++ return error;
++}
++#undef getaddrinfo
++#define getaddrinfo(node,serv,hints,res) ruby_getaddrinfo__darwin((node),(serv),(hints),(res))
++#endif
++
+ #ifdef __BEOS__
+ #undef close
+ #define close closesocket
+diff -ur ../ruby-1.9.1-p378.org/test/socket/test_socket.rb ./test/socket/test_socket.rb
+--- ../ruby-1.9.1-p378.org/test/socket/test_socket.rb 2009-01-16 00:35:25.000000000 +0900
++++ ./test/socket/test_socket.rb 2010-06-25 04:22:40.000000000 +0900
+@@ -74,6 +74,14 @@
+ }
+ end
+ end
++
++ def test_getaddrinfo_raises_no_errors_on_port_argument_of_0 # [ruby-core:29427]
++ assert_nothing_raised('[ruby-core:29427]'){ Socket.getaddrinfo('localhost', 0, Socket::AF_INET, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME) }
++ assert_nothing_raised('[ruby-core:29427]'){ Socket.getaddrinfo('localhost', '0', Socket::AF_INET, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME) }
++ assert_nothing_raised('[ruby-core:29427]'){ Socket.getaddrinfo('localhost', '00', Socket::AF_INET, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME) }
++ assert_raise(SocketError, '[ruby-core:29427]'){ Socket.getaddrinfo(nil, nil, Socket::AF_INET, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME) }
++ assert_nothing_raised('[ruby-core:29427]'){ TCPServer.open('localhost', 0) {} }
++ end
+ end if defined?(Socket)
+
+ class TestSocket < Test::Unit::TestCase
+Only in ./test/socket: test_socket.rb.orig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100624/dc11e6dd/attachment.html>
More information about the macports-changes
mailing list