source: trunk/dports/lang/ruby19/Portfile @ 85585

Last change on this file since 85585 was 85585, checked in by ryandesign@…, 9 years ago

Add depends_skip_archcheck apple-gcc42; see #31584

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.4 KB
Line 
1# $Id: Portfile 85585 2011-10-14 20:17:51Z ryandesign@macports.org $
2
3PortSystem                      1.0
4
5name                            ruby19
6version                         1.9.2-p290
7revision                        2
8
9categories                      lang ruby
10maintainers                     kimuraw openmaintainer
11platforms                       darwin
12description                     Powerful and clean object-oriented scripting language
13long_description        Ruby is the interpreted scripting language for quick \
14                                        and easy object-oriented programming. It has many \
15                                        features to process text files and to do system \
16                                        management tasks (as in Perl). It is simple, \
17                                        straight-forward, extensible, and portable. \
18                                        Version 1.9 contains a new VM called YARV, is faster \
19                                        and slightly incompatible from version 1.8.
20
21homepage                        http://www.ruby-lang.org/
22license                         {Ruby GPL-2}
23
24master_sites            ruby:1.9
25use_bzip2                       yes
26distname                        ruby-${version}
27
28checksums                       md5 096758c3e853b839dc980b183227b182 \
29                                        rmd160 9722a91445fa81a101a2a8ab5753780c4601cc5a \
30                                        sha1 8f25a74f50a10fdd9724e3c74ccd7bae596e198b
31use_parallel_build      yes
32
33depends_lib                     port:libiconv \
34                                        port:readline \
35                                        port:openssl \
36                                        port:zlib \
37                                        port:ncurses \
38                                        port:libyaml \
39                                        port:libffi \
40                                        port:gdbm
41
42# ruby-1.9.x built with clang or llvm-gcc does not work
43# see list "MacPorts on Lion (common issues, fixes, and workarounds)"
44# http://lists.macosforge.org/pipermail/macports-dev/2011-July/015263.html
45if {${configure.compiler} == "clang" ||
46        ${configure.compiler} == "llvm-gcc-4.2"} {
47        configure.compiler gcc-4.2
48        if {![file executable ${configure.cc}]} {
49                depends_build-append port:apple-gcc42
50                depends_skip_archcheck apple-gcc42
51                configure.compiler apple-gcc-4.2
52        }
53}
54
55configure.args          --enable-shared \
56                                        --mandir="${prefix}/share/man" \
57                                        --enable-pthread \
58                                        --without-tk \
59                                        --with-opt-dir="${prefix}" \
60                                        --program-suffix=1.9 \
61                                        --with-rubylibprefix=${prefix}/lib/ruby1.9
62
63# Ignore minor version for archdir, like i686-darwin9.
64# Port "ruby" does the same.
65configure.env           UNAME_RELEASE=${os.major}
66
67post-destroot {
68        foreach type {site vendor} {
69                        set libdir ${destroot}${prefix}/lib/ruby1.9/${type}_ruby/1.9.1
70                        xinstall -m 0755 -d ${libdir}
71                        xinstall -m 0644 ${filespath}/${type}-specific.rb ${libdir}
72        }
73
74        foreach subdir [exec find ${libdir} -type d -empty] {
75                        destroot.keepdirs-append ${subdir}
76        }
77
78    # error at activate, for these case sensitive files
79        foreach rdoc {Exception2MessageMapper/fail-i.yaml \
80                                  REXML/Parsers/XPathParser/predicate-i.yaml} {
81                if {[file exists ${destroot}${prefix}/share/ri1.9/1.9.1/system/${rdoc}]} {
82                        delete ${destroot}${prefix}/share/ri1.9/1.9.1/system/${rdoc}
83                }
84        }
85}
86
87pre-activate {
88        # Bug #3805 [ruby-core:32165]
89        # http://redmine.ruby-lang.org/issues/show/3805
90        #
91        # the two gems of "rake", contained in ruby-1.9.2 and installed via gem
92        # command, might be installed.
93        # `port activate' fails when the two rake are installed.
94        set rake_dup_gemspec ${prefix}/lib/ruby1.9/gems/1.9.1/specifications/rake-0.8.7.gemspec
95        if {[file exists ${rake_dup_gemspec}]} {
96                delete ${rake_dup_gemspec}
97        }
98}
99
100variant 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." {
101                configure.args-delete           --program-suffix=1.9
102}
103
104variant c_api_docs description "Generate documentation for Ruby C API" {
105        depends_build-append port:doxygen
106
107        post-build {
108                file mkdir ${workpath}/c_api
109                set doxygen_conf ${name}-doxygen.conf
110                file copy -force ${filespath}/${doxygen_conf} ${workpath}
111                set doxygen_conf_path ${workpath}/${name}-doxygen.conf
112                reinplace "s|%WORKPATH%|${workpath}|" ${doxygen_conf_path}
113                reinplace "s|%WORKSRCPATH%|${worksrcpath}|" ${doxygen_conf_path}
114                system "doxygen ${doxygen_conf_path}"
115        }
116
117        post-destroot {
118                set api_docs ${destroot}${prefix}/share/doc/${name}-${version}/html/c_api
119                xinstall -m 755 -d ${api_docs}
120                eval xinstall -m 640 [glob ${workpath}/c_api/html/*] ${api_docs}
121        }
122}
123
124variant tk conflicts mactk description "Build using MacPorts Tk" {
125                configure.args-delete   --without-tk
126                configure.args-append   --with-tk
127                depends_lib-append      port:tcl \
128                                                                port:tk
129}
130
131variant mactk conflicts tk description "Build using Mac OS X Tk Framework" {
132                configure.args-delete   --without-tk
133                configure.args-append   --enable-tcltk-framework
134}
135
136variant universal {
137                configure.args-append   --with-arch=[join ${universal_archs} ,]
138}
139
140livecheck.type  regex
141livecheck.url   http://ftp.ruby-lang.org/pub/ruby/1.9/
142livecheck.regex ruby-(${version})${extract.suffix}
143
Note: See TracBrowser for help on using the repository browser.