source: trunk/dports/lang/ruby/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: 5.5 KB
Line 
1# $Id: Portfile 85585 2011-10-14 20:17:51Z ryandesign@macports.org $
2
3PortSystem              1.0
4PortGroup               muniversal 1.0
5
6name                    ruby
7version                 1.8.7-p352
8revision                2
9
10categories              lang ruby
11maintainers             kimuraw
12
13description             Powerful and clean object-oriented scripting language
14long_description        Ruby is the interpreted scripting language for quick \
15                                        and easy object-oriented programming. It has many \
16                                        features to process text files and to do system \
17                                        management tasks (as in Perl). It is simple, \
18                                        straight-forward, extensible, and portable.
19homepage                http://www.ruby-lang.org/
20license                 {Ruby GPL-2}
21master_sites    ruby:1.8
22                               
23dist_subdir             ruby
24checksums               md5 0c61ea41d1b1183b219b9afe97f18f52 \
25                                rmd160 9a0ea7e7eb83c809d2890b08db2e78eeb93dee0d \
26                                sha1 9f3d039e9bfeda54ea2c2175bbeace375a1ea1ae
27
28use_bzip2               yes
29
30platforms               darwin
31
32depends_lib             port:libiconv \
33                                port:readline \
34                                port:openssl \
35                                port:zlib \
36                                port:ncurses \
37                                port:gdbm
38
39# vendordir: enable vendor-specific.rb
40# #3604: gcc4 fails to detect linking at configure
41# #19050: use $(CC) not cc, this change has been merged at ruby-1.8 trunk
42# #15528: on some Mac, TCPServer.open("localhost", 0) raises SocketError
43#         like "getaddrinfo: nodename nor servname provided, or not
44#         known (SocketError)"
45# c99: gperf generates code that doesn't work with clang (https://trac.macports.org/ticket/29974)
46patchfiles              patch-vendordir.diff \
47                                patch-bug3604.diff \
48                                patch-bug19050.diff \
49                                patch-bug15528.diff \
50                                patch-c99.diff
51
52# ignore getcontext() and setcontext()
53# on 10.5, these functions have some problems (SEGV on ppc, slower than 1.8.6)
54# http://chopine.be/lrz/ruby-osx-patches/ignore-gsetcontext.diff
55patchfiles-append patch-node.h.diff
56
57use_parallel_build              no
58
59# #30275: ruby built with clang or llvm-gcc does not work
60# see list "MacPorts on Lion (common issues, fixes, and workarounds)"
61# http://lists.macosforge.org/pipermail/macports-dev/2011-July/015263.html
62if {${configure.compiler} == "clang" ||
63    ${configure.compiler} == "llvm-gcc-4.2"} {
64    configure.compiler gcc-4.2
65    if {![file executable ${configure.cc}]} {
66        depends_build-append port:apple-gcc42
67        depends_skip_archcheck apple-gcc42
68        configure.compiler apple-gcc-4.2
69    }
70}
71
72configure.args  --enable-shared \
73                                --mandir="${prefix}/share/man" \
74                                --enable-pthread \
75                                --without-tk \
76                                --with-vendordir=${prefix}/lib/ruby/vendor_ruby \
77                                --with-opt-dir=${prefix}
78# ignore minor version for archdir, like i686-darwin9
79configure.env   UNAME_RELEASE=${os.major}
80
81if {[variant_isset universal]} {
82        # NOTE: directory layout of port:ruby +universal
83        #   universal binary
84        #     - bin/
85        #     - lib/libruby*.dylib, libruby-static.a
86        #   single architecture modules and headers, such as ruby.h or config.h
87        #     - lib/ruby/[1.8|site_ruby/1.8|vendor_ruby/1.8]/x86_64-apple-darwin*/
88        #     -                                             /i386-apple-darwin*/
89        #     -                                             /ppc-apple-darwin*/
90        #   pure ruby libraries
91        #     - lib/ruby/[1.8|site_ruby/1.8|vendor_ruby/1.8]/
92        foreach arch ${universal_archs} {
93                append merger_configure_env(${arch}) "ARCH_FLAG=\"-arch ${arch}\" "
94                # force environment "ac_cv_build" to specify locations of extension
95                # modules(*.bundle), headers(ruby.h, config.h, ..) and rbconfig.rb.
96                # like this:
97                #   i386   -> ${prefix}/lib/ruby/1.8/i386-apple-darwin10/
98                #   x86_64 ->                       /x86_64-apple-darwin10/
99                set cpu_type ${arch}
100                append merger_configure_env(${arch}) \
101                        "ac_cv_build=\"${cpu_type}-apple-darwin${os.major}\" "
102        }
103} elseif {[info exists build_arch] && ${build_arch} != ""} {
104        configure.env-append ARCH_FLAG="-arch ${build_arch}"
105}
106
107destroot.target install install-doc
108post-destroot {
109        foreach type {site vendor} {
110                set libdir ${destroot}${prefix}/lib/ruby/${type}_ruby/1.8
111                xinstall -m 0755 -d ${libdir}
112               
113                # special file for installation control of modules
114                xinstall -m 0644 ${filespath}/${type}-specific.rb ${libdir}
115               
116                # prevent empty site/vendor directories from being pruned
117                foreach subdir [exec find ${libdir} -type d -empty] {
118                        destroot.keepdirs-append ${subdir}
119                }
120        }
121    # error at activate, for these case sensitive files
122        foreach rdoc {Exception2MessageMapper/fail-i.yaml \
123                                  REXML/Parsers/XPathParser/predicate-i.yaml} {
124                if {[file exists ${destroot}${prefix}/share/ri/1.8/system/${rdoc}]} {
125                        delete ${destroot}${prefix}/share/ri/1.8/system/${rdoc}
126                }
127        }
128}
129
130platform darwin {
131        # for proper rdoc/ri creation, make sure to link to destroot libruby.dylib
132        destroot.env    DYLD_LIBRARY_PATH=${destroot}${prefix}/lib
133}
134
135variant tk conflicts mactk description "enable tk support" {
136        configure.args-delete   --without-tk
137        configure.args-append   --with-tk
138        depends_lib-append              port:tcl port:tk
139}
140
141variant mactk conflicts tk description "enable MacTk (Tk.framework without X11) support" {
142        configure.args-delete   --without-tk
143        configure.args-append   --enable-tcltk-framework
144}
145
146variant thread_hooks description "apply Apple's thread_hooks patch" {
147        patchfiles-append               patch-thread-hooks.diff
148}
149
150variant no_doc description "do not install rdoc documents" {
151        destroot.target-delete  install-doc
152}
153
154variant dtrace description "enable dtrace support" {
155        # from http://www.opensource.apple.com/source/ruby/ruby-79/
156        patchfiles-append               patch-apple-dtrace.diff
157        configure.cflags-append -DENABLE_DTRACE
158        post-patch {
159                system "cd ${worksrcpath} && dtrace -h -s ${filespath}/dtrace.d -o dtrace.h"
160        }
161}
162
163default_variants        +thread_hooks
164
165livecheck.type  regex
166livecheck.url   http://ftp.ruby-lang.org/pub/ruby/1.8/
167livecheck.regex {ruby-(\d+(?:\.\d+)*(?:-p\d+))}
168
169test.run        yes
Note: See TracBrowser for help on using the repository browser.