# $Id$ PortSystem 1.0 PortGroup select 1.0 name ruby18 version 1.8.7-p160 categories lang ruby maintainers kimuraw 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. homepage http://www.ruby-lang.org/ master_sites ruby:1.8 dist_subdir ruby distname ruby-${version} checksums md5 f8ddb886b8a81cf005f53e9a9541091d \ rmd160 77469c9c4e9303f2ec8ca72a0cbf98b674cb1415 \ sha1 64ed631a819f28d9dd86d2c699e1b0a94d7e5dc9 use_bzip2 yes platforms darwin depends_build port:autoconf depends_lib port:libiconv \ port:readline \ port:openssl \ port:zlib \ port:ncurses \ port:ruby_select # # vendordir: enable vendor-specific.rb # # #3604: gcc4 fails to detect linking at configure # # #19050: use $(CC) not cc, this change has been merged at ruby-1.8 trunk # patchfiles patch-vendordir.diff \ # patch-bug3604.diff \ # patch-bug19050.diff # # ignore getcontext() and setcontext() # # on 10.5, these functions have some problems (SEGV on ppc, slower than 1.8.6) # # http://chopine.be/lrz/ruby-osx-patches/ignore-gsetcontext.diff # patchfiles-append patch-node.h.diff # # change rdoc "system" path to "system1.8.7" # patchfiles-append patch-rdoc_sysdir.diff # # linking libruby.dylib not libruby${suffix}.dylib when VENDOR_SPECIFIC = true # patchfiles-append patch-libruby_nosuffix.diff select.group ruby select.file ${filespath}/${name} use_autoconf yes autoconf.cmd autoreconf autoconf.args -fvi use_parallel_build yes set suffix 18 set ruby_rel 1.8.7 configure.args --enable-shared \ --mandir="${prefix}/share/man" \ --enable-pthread \ --with-vendordir=${prefix}/lib/ruby/vendor_ruby \ --program-suffix=${suffix} # ignore minor version for archdir, like i686-darwin9 configure.env UNAME_RELEASE=${os.major} post-configure { # use lib/ruby/1.8.7, lib/ruby/1.8, to allow activate both of ruby186 # and ruby(ruby18). # but use 1.8 for sitedir and vendordir (not change) reinplace "s|lib/ruby/1.8|lib/ruby/${ruby_rel}|g" \ ${worksrcpath}/config.h reinplace "s|\$(libdir)/ruby/\$(ruby_version)|\$(libdir)/ruby/${ruby_rel}|" \ ${worksrcpath}/mkconfig.rb } destroot.target install install-doc post-destroot { foreach type {site vendor} { set libdir ${destroot}${prefix}/lib/ruby/${type}_ruby xinstall -m 0755 -d ${libdir} # special file for installation control of modules xinstall -m 0644 ${filespath}/${type}-specific.rb \ ${destroot}${prefix}/lib/ruby/${ruby_rel}/ # prevent empty site/vendor directories from being pruned foreach subdir [exec find ${libdir} -type d -empty] { destroot.keepdirs-append ${subdir} } } } ## create symlink for ruby18 and ,... ## TODO: ruby_select would do this. #post-activate { # foreach cmd {ruby erb irb rdoc ri testrb} { # if {![file exists ${prefix}/bin/${cmd}]} { # file link -symbolic ${prefix}/bin/${cmd} \ # ${prefix}/bin/${cmd}${suffix} # } # } # if {![file exists ${prefix}/lib/libruby.dylib]} { # file link -symbolic ${prefix}/lib/libruby.dylib \ # ${prefix}/lib/libruby${suffix}.dylib # } # if {![file exists ${prefix}/lib/libruby-static.a]} { # file link -symbolic ${prefix}/lib/libruby-static.a \ # ${prefix}/lib/libruby${suffix}-static.a # } #} variant universal { configure.args-delete --disable-dependency-tracking build.target-append EXTLDFLAGS="${configure.universal_ldflags}" CFLAGS="${configure.universal_cflags}" } platform darwin { # for proper rdoc/ri creation, make sure to link to destroot libruby.dylib destroot.env DYLD_LIBRARY_PATH=${destroot}${prefix}/lib } platform darwin 7 { # pthreads is being called with an unavailable function call configure.args-delete --enable-pthread } variant thread_hooks description "apply Apple's thread_hooks patch" { patchfiles-append patch-thread-hooks.diff } variant no_doc description "do not install rdoc documents" { destroot.target-delete install-doc } default_variants +thread_hooks livecheck.check regex livecheck.url http://www.ruby-lang.org/en/downloads/ livecheck.regex {>Ruby (1.8.*?) \(md5:} test.run yes