/[gentoo-x86]/eclass/ruby-ng.eclass
Gentoo

Diff of /eclass/ruby-ng.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.40 Revision 1.43
1# Copyright 1999-2011 Gentoo Foundation 1# Copyright 1999-2011 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-ng.eclass,v 1.40 2011/10/05 17:46:20 graaff Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-ng.eclass,v 1.43 2011/10/24 18:20:05 graaff Exp $
4 4
5# @ECLASS: ruby-ng.eclass 5# @ECLASS: ruby-ng.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Ruby herd <ruby@gentoo.org> 7# Ruby herd <ruby@gentoo.org>
8# @AUTHOR: 8# @AUTHOR:
17# Currently available targets are: 17# Currently available targets are:
18# * ruby18 - Ruby (MRI) 1.8.x 18# * ruby18 - Ruby (MRI) 1.8.x
19# * ruby19 - Ruby (MRI) 1.9.x 19# * ruby19 - Ruby (MRI) 1.9.x
20# * ree18 - Ruby Enterprise Edition 1.8.x 20# * ree18 - Ruby Enterprise Edition 1.8.x
21# * jruby - JRuby 21# * jruby - JRuby
22# * rbx - Rubinius
22# 23#
23# This eclass does not define the implementation of the configure, 24# This eclass does not define the implementation of the configure,
24# compile, test, or install phases. Instead, the default phases are 25# compile, test, or install phases. Instead, the default phases are
25# used. Specific implementations of these phases can be provided in 26# used. Specific implementations of these phases can be provided in
26# the ebuild either to be run for each Ruby implementation, or for all 27# the ebuild either to be run for each Ruby implementation, or for all
111 rubypn="dev-lang/ruby-enterprise" 112 rubypn="dev-lang/ruby-enterprise"
112 rubyslot=":1.8" 113 rubyslot=":1.8"
113 ;; 114 ;;
114 jruby) 115 jruby)
115 rubypn="dev-java/jruby" 116 rubypn="dev-java/jruby"
117 rubyslot=""
118 ;;
119 rbx)
120 rubypn="dev-lang/rubinius"
116 rubyslot="" 121 rubyslot=""
117 ;; 122 ;;
118 *) die "$1: unknown Ruby implementation" 123 *) die "$1: unknown Ruby implementation"
119 esac 124 esac
120 125
393 # This only checks that at least one implementation is present 398 # This only checks that at least one implementation is present
394 # before doing anything; by leaving the parameters empty we know 399 # before doing anything; by leaving the parameters empty we know
395 # it's a special case. 400 # it's a special case.
396 _ruby_each_implementation 401 _ruby_each_implementation
397 402
398 use ruby_targets_jruby && java-pkg_setup-vm 403 has ruby_targets_jruby ${IUSE} && use ruby_targets_jruby && java-pkg_setup-vm
399} 404}
400 405
401# @FUNCTION: ruby-ng_src_unpack 406# @FUNCTION: ruby-ng_src_unpack
402# @DESCRIPTION: 407# @DESCRIPTION:
403# Unpack the source archive. 408# Unpack the source archive.
500 # we have a Mach-O object here 505 # we have a Mach-O object here
501 [[ ${CHOST} == *-darwin ]] && scancmd=scanmacho 506 [[ ${CHOST} == *-darwin ]] && scancmd=scanmacho
502 507
503 has "${EAPI}" 2 && ! use prefix && EPREFIX= 508 has "${EAPI}" 2 && ! use prefix && EPREFIX=
504 509
505 local libruby_basename=$(${RUBY} -rrbconfig -e 'puts Config::CONFIG["LIBRUBY_SO"]') 510 local libruby_basename=$(${RUBY} -rrbconfig -e 'puts RbConfig::CONFIG["LIBRUBY_SO"]')
506 local libruby_soname=$(basename $(${scancmd} -F "%S#F" -qS "${EPREFIX}/usr/$(get_libdir)/${libruby_basename}") 2>/dev/null) 511 local libruby_soname=$(basename $(${scancmd} -F "%S#F" -qS "${EPREFIX}/usr/$(get_libdir)/${libruby_basename}") 2>/dev/null)
507 local sitedir=$(${RUBY} -rrbconfig -e 'puts Config::CONFIG["sitedir"]') 512 local sitedir=$(${RUBY} -rrbconfig -e 'puts RbConfig::CONFIG["sitedir"]')
508 local sitelibdir=$(${RUBY} -rrbconfig -e 'puts Config::CONFIG["sitelibdir"]') 513 local sitelibdir=$(${RUBY} -rrbconfig -e 'puts RbConfig::CONFIG["sitelibdir"]')
509 514
510 # Look for wrong files in sitedir 515 # Look for wrong files in sitedir
511 # if [[ -d "${D}${sitedir}" ]]; then 516 # if [[ -d "${D}${sitedir}" ]]; then
512 # local f=$(find "${D}${sitedir}" -mindepth 1 -maxdepth 1 -not -wholename "${D}${sitelibdir}") 517 # local f=$(find "${D}${sitedir}" -mindepth 1 -maxdepth 1 -not -wholename "${D}${sitelibdir}")
513 # if [[ -n ${f} ]]; then 518 # if [[ -n ${f} ]]; then
553 558
554# @FUNCTION: ruby_rbconfig_value 559# @FUNCTION: ruby_rbconfig_value
555# @USAGE: rbconfig item 560# @USAGE: rbconfig item
556# @RETURN: Returns the value of the given rbconfig item of the Ruby interpreter in ${RUBY}. 561# @RETURN: Returns the value of the given rbconfig item of the Ruby interpreter in ${RUBY}.
557ruby_rbconfig_value() { 562ruby_rbconfig_value() {
558 echo $(${RUBY} -rrbconfig -e "puts Config::CONFIG['$1']") 563 echo $(${RUBY} -rrbconfig -e "puts RbConfig::CONFIG['$1']")
559} 564}
560 565
561# @FUNCTION: doruby 566# @FUNCTION: doruby
562# @USAGE: file [file...] 567# @USAGE: file [file...]
563# @DESCRIPTION: 568# @DESCRIPTION:
574} 579}
575 580
576# @FUNCTION: ruby_get_libruby 581# @FUNCTION: ruby_get_libruby
577# @RETURN: The location of libruby*.so belonging to the Ruby interpreter in ${RUBY}. 582# @RETURN: The location of libruby*.so belonging to the Ruby interpreter in ${RUBY}.
578ruby_get_libruby() { 583ruby_get_libruby() {
579 ${RUBY} -rrbconfig -e 'puts File.join(Config::CONFIG["libdir"], Config::CONFIG["LIBRUBY"])' 584 ${RUBY} -rrbconfig -e 'puts File.join(RbConfig::CONFIG["libdir"], RbConfig::CONFIG["LIBRUBY"])'
580} 585}
581 586
582# @FUNCTION: ruby_get_hdrdir 587# @FUNCTION: ruby_get_hdrdir
583# @RETURN: The location of the header files belonging to the Ruby interpreter in ${RUBY}. 588# @RETURN: The location of the header files belonging to the Ruby interpreter in ${RUBY}.
584ruby_get_hdrdir() { 589ruby_get_hdrdir() {
609 echo "ree" 614 echo "ree"
610 ;; 615 ;;
611 *jruby*) 616 *jruby*)
612 echo "jruby" 617 echo "jruby"
613 ;; 618 ;;
619 *rubinius*)
620 echo "rbx"
621 ;;
614 *) 622 *)
615 echo "mri" 623 echo "mri"
616 ;; 624 ;;
617 esac 625 esac
618} 626}

Legend:
Removed from v.1.40  
changed lines
  Added in v.1.43

  ViewVC Help
Powered by ViewVC 1.1.20