[87161] trunk/dports/lang/ruby19

Ryan Schmidt ryandesign at macports.org
Sat Nov 12 09:12:39 PST 2011


On Nov 12, 2011, at 10:44, kimuraw at macports.org wrote:

> Revision: 87161
>          http://trac.macports.org/changeset/87161
> Author:   kimuraw at macports.org
> Date:     2011-11-12 08:44:41 -0800 (Sat, 12 Nov 2011)
> Log Message:
> -----------
> lang/ruby19: upgrade to 1.9.3-p0.
>  - license changed {Ruby GPL-2} -> {Ruby BSD}
>  - allow build with Xcode-4.2 llvm-clang


> -# ruby-1.9.x built with clang or llvm-gcc does not work
> -# see list "MacPorts on Lion (common issues, fixes, and workarounds)"
> -# http://lists.macosforge.org/pipermail/macports-dev/2011-July/015263.html
> -if {${configure.compiler} == "clang" ||
> -	${configure.compiler} == "llvm-gcc-4.2"} {
> -	configure.compiler gcc-4.2
> -	if {![file executable ${configure.cc}]} {
> -		depends_build-append port:apple-gcc42
> -		configure.compiler apple-gcc-4.2
> +default_variants	+doc
> +
> +# https://github.com/rubygems/rubygems/pull/196
> +# fix 'Invalid gemspec in [... json-1.6.1.gemspec]: invalid date format in
> +#      specification: "2011-09-18 00:00:00.000000000Z"'
> +patchfiles			patch-lib-rubygems-specification.rb.diff
> +
> +# ruby-1.9.3 supports Xcode-4.2 clang and gcc-4.2.
> +# ruby built with llvm-gcc will be broken.
> +# http://svn.ruby-lang.org/repos/ruby/tags/v1_9_3_0/NEWS
> +# http://redmine.ruby-lang.org/projects/ruby-trunk/wiki/SupportedPlatforms
> +if {${configure.compiler} == "llvm-gcc-4.2"} {
> +    if {[vercmp $xcodeversion 4.2] >= 0} {
> +		configure.compiler clang
> +	else
> +		configure.compiler gcc-4.2
> +		if {![file executable ${configure.cc}]} {
> +			depends_build-append port:apple-gcc42
> +			configure.compiler apple-gcc-4.2
> +		}

I don't quite understand why this new block is so complicated.

If I understand your intentions correctly, you want to use clang on Xcode 4.2 and gcc-4.2 on earlier Xcode versions.

MacPorts base chooses the default compiler as follows:

* Xcode 4.2: clang
* Xcode 4.0 and 4.1: llvm-gcc-4.2
* Xcode 3.1 and 3.2: gcc-4.2
* Xcode 2.x and 3.0: gcc-4.0

So why not just write:


if {${configure.compiler} == "llvm-gcc-4.2"} {
    configure.compiler gcc-4.2
}


Unless gcc-4.0 (i.e. on Leopard and Tiger) is also not ok?



More information about the macports-dev mailing list