source: trunk/dports/lang/ruby/Portfile @ 139229

Last change on this file since 139229 was 139229, checked in by jeremyhu@…, 4 years ago

misc: Change port:openssl dependency to path:lib/libssl.dylib:openssl

This should allow usage of libressl as a replacement for openssl in relevant
ports. Not all ports have been tested, but libressl aims for API
compatibility with OpenSSL, so it is expected to work.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.4 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 139229 2015-08-08 03:10:35Z jeremyhu@macports.org $
3
4PortSystem              1.0
5PortGroup               muniversal 1.0
6PortGroup               compiler_blacklist_versions 1.0
7PortGroup               select 1.0
8
9name                    ruby
10version                 1.8.7-p374
11revision                0
12
13categories              lang ruby
14maintainers             kimuraw
15
16description             Powerful and clean object-oriented scripting language
17long_description        Ruby is the interpreted scripting language for quick \
18                                        and easy object-oriented programming. It has many \
19                                        features to process text files and to do system \
20                                        management tasks (as in Perl). It is simple, \
21                                        straight-forward, extensible, and portable.
22homepage                http://www.ruby-lang.org/
23license                 {Ruby GPL-2}
24master_sites    ruby:1.8
25                               
26dist_subdir             ruby
27checksums       md5 83c92e2b57ea08f31187060098b2200b \
28                                rmd160 314efaa961c80c9294202c6e40dec0e38865ed94 \
29                                sha1 cf82b6cbeed8e389705aa6b66c2a8141626705c3 \
30                                sha256 b4e34703137f7bfb8761c4ea474f7438d6ccf440b3d35f39cc5e4d4e239c07e3
31
32use_bzip2               yes
33
34platforms               darwin
35
36depends_lib             port:libiconv \
37                                port:readline \
38                                path:lib/libssl.dylib:openssl \
39                                port:zlib \
40                                port:ncurses \
41                                port:gdbm
42depends_run             port:ruby_select
43
44select.group    ruby
45select.file             ${filespath}/ruby18
46
47# vendordir: enable vendor-specific.rb
48# #3604: gcc4 fails to detect linking at configure
49# #19050: use $(CC) not cc, this change has been merged at ruby-1.8 trunk
50# #15528: on some Mac, TCPServer.open("localhost", 0) raises SocketError
51#         like "getaddrinfo: nodename nor servname provided, or not
52#         known (SocketError)"
53# c99: gperf generates code that doesn't work with clang (https://trac.macports.org/ticket/29974)
54# lib-drb-ssl.rb: 512bits rsa key is too small for openssl-1.0.1.
55#                 (http://bugs.ruby-lang.org/issues/6221)
56# Makefile.in: force libruby without suffix (backward compatibility)
57# --- clang support ----
58# numeric.c: fix wrong optimizaton of Numeric/Bignum build with clang.
59# configure: correct frame_address and stack_direction for +universal with clang.
60# ext-tk-extconf.rb: use linker option "-rpath," not "-R".
61patchfiles              patch-vendordir.diff \
62                                patch-bug3604.diff \
63                                patch-bug19050.diff \
64                                patch-bug15528.diff \
65                                patch-c99.diff \
66                                patch-lib-drb-ssl.rb.diff \
67                patch-Makefile.in \
68                                patch-numeric.c.diff \
69                                patch-configure.diff \
70                                patch-ext-tk-extconf.rb.diff
71
72# ignore getcontext() and setcontext()
73# on 10.5 or later, these functions have some problems (SEGV on ppc, slower than 1.8.6)
74# http://chopine.be/lrz/ruby-osx-patches/ignore-gsetcontext.diff
75patchfiles-append patch-node.h.diff
76
77use_parallel_build              no
78
79# [OK] apple-gcc-4.2
80#      clang (Xcode 4.2 or later) with -O[0s]
81# [NG] llvm-gcc-4.2
82#      clang (Xcode 4.1 or earlier)
83#      clang (Xcode 4.2 or later) with -O[12]
84# TODO: When was this last verified?  Is there a ticket open? Radar?
85compiler.blacklist-append *llvm-gcc-4.2 {clang < 211}
86
87if {[string match *clang* ${configure.compiler}]} {
88        configure.optflags -Os
89}
90
91configure.args  --enable-shared \
92                                --mandir="${prefix}/share/man" \
93                                --enable-pthread \
94                                --without-tk \
95                                --with-vendordir=${prefix}/lib/ruby/vendor_ruby \
96                                --with-opt-dir=${prefix} \
97                                --program-suffix=1.8
98# ignore minor version for archdir, like i686-darwin9
99configure.env   UNAME_RELEASE=${os.major}
100
101if {[variant_isset universal]} {
102        # NOTE: directory layout of port:ruby +universal
103        #   universal binary
104        #     - bin/
105        #     - lib/libruby*.dylib, libruby-static.a
106        #   single architecture modules and headers, such as ruby.h or config.h
107        #     - lib/ruby/[1.8|site_ruby/1.8|vendor_ruby/1.8]/x86_64-apple-darwin*/
108        #     -                                             /i386-apple-darwin*/
109        #     -                                             /ppc-apple-darwin*/
110        #   pure ruby libraries
111        #     - lib/ruby/[1.8|site_ruby/1.8|vendor_ruby/1.8]/
112        foreach arch ${universal_archs} {
113                append merger_configure_env(${arch}) "ARCH_FLAG=\"-arch ${arch}\" "
114                # force environment "ac_cv_build" to specify locations of extension
115                # modules(*.bundle), headers(ruby.h, config.h, ..) and rbconfig.rb.
116                # like this:
117                #   i386   -> ${prefix}/lib/ruby/1.8/i386-apple-darwin10/
118                #   x86_64 ->                       /x86_64-apple-darwin10/
119                set cpu_type ${arch}
120                append merger_configure_env(${arch}) \
121                        "ac_cv_build=\"${cpu_type}-apple-darwin${os.major}\" "
122        }
123} elseif {[info exists build_arch] && ${build_arch} ne ""} {
124        configure.env-append ARCH_FLAG="-arch ${build_arch}"
125}
126
127destroot.target install install-doc
128post-destroot {
129        foreach type {site vendor} {
130                set libdir ${destroot}${prefix}/lib/ruby/${type}_ruby/1.8
131                xinstall -m 0755 -d ${libdir}
132               
133                # special file for installation control of modules
134                xinstall -m 0644 ${filespath}/${type}-specific.rb ${libdir}
135               
136                # prevent empty site/vendor directories from being pruned
137                foreach subdir [exec find ${libdir} -type d -empty] {
138                        destroot.keepdirs-append ${subdir}
139                }
140        }
141        # install destination of commands from port:rb-*
142        xinstall -m 0755 -d ${destroot}${prefix}/libexec/ruby1.8
143        destroot.keepdirs-append ${destroot}${prefix}/libexec/ruby1.8
144    # error at activate, for these case sensitive files
145        foreach rdoc {Exception2MessageMapper/fail-i.yaml \
146                                  REXML/Parsers/XPathParser/predicate-i.yaml} {
147                if {[file exists ${destroot}${prefix}/share/ri/1.8/system/${rdoc}]} {
148                        delete ${destroot}${prefix}/share/ri/1.8/system/${rdoc}
149                }
150        }
151}
152
153platform darwin {
154        # for proper rdoc/ri creation, make sure to link to destroot libruby.dylib
155        destroot.env    DYLD_LIBRARY_PATH=${destroot}${prefix}/lib
156}
157
158variant tk conflicts mactk description "enable tk support" {
159        configure.args-delete   --without-tk
160        configure.args-append   --with-tk --disable-tcltk-framework
161        depends_lib-append              port:tcl port:tk
162}
163
164variant mactk conflicts tk description "enable MacTk (Tk.framework without X11) support" {
165        configure.args-delete   --without-tk
166        configure.args-append   --enable-tcltk-framework
167}
168
169variant no_doc description "do not install rdoc documents" {
170        destroot.target-delete  install-doc
171}
172
173variant dtrace description "enable dtrace support" {
174        # from http://www.opensource.apple.com/source/ruby/ruby-79/
175        patchfiles-append               patch-apple-dtrace.diff
176        configure.cflags-append -DENABLE_DTRACE
177        post-patch {
178                system "cd ${worksrcpath} && dtrace -h -s ${filespath}/dtrace.d -o dtrace.h"
179        }
180}
181
182livecheck.type  regex
183livecheck.url   http://ftp.ruby-lang.org/pub/ruby/1.8/
184livecheck.regex {ruby-(\d+(?:\.\d+)*(?:-p\d+))}
185
186test.run        yes
Note: See TracBrowser for help on using the repository browser.