From 4cbcc855382a06088e2f016f62cafdbcb7e40665 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 20 Mar 2022 00:40:44 +0000 Subject: gentoo resync : 20.03.2022 --- eclass/ruby-ng.eclass | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) (limited to 'eclass/ruby-ng.eclass') diff --git a/eclass/ruby-ng.eclass b/eclass/ruby-ng.eclass index 90da695a04c2..8e7c7f76290b 100644 --- a/eclass/ruby-ng.eclass +++ b/eclass/ruby-ng.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: ruby-ng.eclass @@ -102,6 +102,8 @@ esac # Set `comparator' and `version' to include a comparator (=, >=, etc.) and a # version string to the returned string ruby_implementation_depend() { + debug-print-function ${FUNCNAME} "${@}" + _ruby_implementation_depend $1 } @@ -132,6 +134,8 @@ _ruby_get_all_impls() { # ruby_add_bdepend(), but may also be useful in an ebuild to specify # more complex dependencies. ruby_samelib() { + debug-print-function ${FUNCNAME} "${@}" + local res= for _ruby_implementation in $(_ruby_get_all_impls); do has -${_ruby_implementation} $@ || \ @@ -164,6 +168,8 @@ _ruby_atoms_samelib_generic() { # Not all implementations have the same command basename as the # target; This function translate between the two ruby_implementation_command() { + debug-print-function ${FUNCNAME} "${@}" + local _ruby_name=$1 # Add all USE_RUBY values where the flag name diverts from the binary here @@ -203,6 +209,8 @@ _ruby_wrap_conditions() { # Note: runtime dependencies are also added as build-time test # dependencies. ruby_add_rdepend() { + debug-print-function ${FUNCNAME} "${@}" + case $# in 1) ;; 2) @@ -248,6 +256,8 @@ ruby_add_rdepend() { # dependencies instead of setting DEPEND or BDEPEND yourself. The list # of atoms uses the same syntax as normal dependencies. ruby_add_bdepend() { + debug-print-function ${FUNCNAME} "${@}" + case $# in 1) ;; 2) @@ -282,6 +292,8 @@ ruby_add_bdepend() { # Adds the specified dependencies to DEPEND in EAPI7, similar to # ruby_add_bdepend. ruby_add_depend() { + debug-print-function ${FUNCNAME} "${@}" + case ${EAPI} in 5|6) die "only available in EAPI 7 and newer" ;; *) ;; @@ -301,6 +313,8 @@ ruby_add_depend() { # @DESCRIPTION: # Gets an array of ruby use targets enabled by the user ruby_get_use_implementations() { + debug-print-function ${FUNCNAME} "${@}" + local i implementation for implementation in $(_ruby_get_all_impls); do use ruby_targets_${implementation} && i+=" ${implementation}" @@ -312,6 +326,8 @@ ruby_get_use_implementations() { # @DESCRIPTION: # Gets an array of ruby use targets that the ebuild sets ruby_get_use_targets() { + debug-print-function ${FUNCNAME} "${@}" + local t implementation for implementation in $(_ruby_get_all_impls); do t+=" ruby_targets_${implementation}" @@ -336,6 +352,8 @@ ruby_get_use_targets() { # DEPEND="ruby? ( $(ruby_implementations_depend) )" # RDEPEND="${DEPEND}" ruby_implementations_depend() { + debug-print-function ${FUNCNAME} "${@}" + local depend for _ruby_implementation in $(_ruby_get_all_impls); do depend="${depend}${depend+ }ruby_targets_${_ruby_implementation}? ( $(ruby_implementation_depend $_ruby_implementation) )" @@ -430,6 +448,8 @@ _ruby_each_implementation() { # @DESCRIPTION: # Check whether at least one ruby target implementation is present. ruby-ng_pkg_setup() { + debug-print-function ${FUNCNAME} "${@}" + # This only checks that at least one implementation is present # before doing anything; by leaving the parameters empty we know # it's a special case. @@ -440,6 +460,8 @@ ruby-ng_pkg_setup() { # @DESCRIPTION: # Unpack the source archive. ruby-ng_src_unpack() { + debug-print-function ${FUNCNAME} "${@}" + mkdir "${WORKDIR}"/all pushd "${WORKDIR}"/all &>/dev/null || die @@ -496,6 +518,8 @@ _ruby_source_copy() { # Apply patches and prepare versions for each ruby target # implementation. Also carry out common clean up tasks. ruby-ng_src_prepare() { + debug-print-function ${FUNCNAME} "${@}" + # Way too many Ruby packages are prepared on OSX without removing # the extra data forks, we do it here to avoid repeating it for # almost every other ebuild. @@ -524,6 +548,8 @@ ruby-ng_src_prepare() { # @DESCRIPTION: # Configure the package. ruby-ng_src_configure() { + debug-print-function ${FUNCNAME} "${@}" + if type each_ruby_configure &>/dev/null; then _ruby_each_implementation each_ruby_configure fi @@ -536,6 +562,8 @@ ruby-ng_src_configure() { # @DESCRIPTION: # Compile the package. ruby-ng_src_compile() { + debug-print-function ${FUNCNAME} "${@}" + if type each_ruby_compile &>/dev/null; then _ruby_each_implementation each_ruby_compile fi @@ -548,6 +576,8 @@ ruby-ng_src_compile() { # @DESCRIPTION: # Run tests for the package. ruby-ng_src_test() { + debug-print-function ${FUNCNAME} "${@}" + if type each_ruby_test &>/dev/null; then _ruby_each_implementation each_ruby_test fi @@ -589,6 +619,8 @@ _each_ruby_check_install() { # @DESCRIPTION: # Install the package for each ruby target implementation. ruby-ng_src_install() { + debug-print-function ${FUNCNAME} "${@}" + if type each_ruby_install &>/dev/null; then _ruby_each_implementation each_ruby_install fi @@ -604,6 +636,8 @@ ruby-ng_src_install() { # @USAGE: rbconfig item # @RETURN: Returns the value of the given rbconfig item of the Ruby interpreter in ${RUBY}. ruby_rbconfig_value() { + debug-print-function ${FUNCNAME} "${@}" + echo $(${RUBY} --disable=did_you_mean -rrbconfig -e "puts RbConfig::CONFIG['$1']" || die "Could not read ruby configuration for '${1}'") } @@ -612,6 +646,8 @@ ruby_rbconfig_value() { # @DESCRIPTION: # Installs the specified file(s) into the sitelibdir of the Ruby interpreter in ${RUBY}. doruby() { + debug-print-function ${FUNCNAME} "${@}" + [[ -z ${RUBY} ]] && die "\$RUBY is not set" ( # don't want to pollute calling env sitelibdir=$(ruby_rbconfig_value 'sitelibdir') @@ -624,12 +660,16 @@ doruby() { # @FUNCTION: ruby_get_libruby # @RETURN: The location of libruby*.so belonging to the Ruby interpreter in ${RUBY}. ruby_get_libruby() { + debug-print-function ${FUNCNAME} "${@}" + ${RUBY} -rrbconfig -e 'puts File.join(RbConfig::CONFIG["libdir"], RbConfig::CONFIG["LIBRUBY"])' } # @FUNCTION: ruby_get_hdrdir # @RETURN: The location of the header files belonging to the Ruby interpreter in ${RUBY}. ruby_get_hdrdir() { + debug-print-function ${FUNCNAME} "${@}" + local rubyhdrdir=$(ruby_rbconfig_value 'rubyhdrdir') if [[ "${rubyhdrdir}" = "nil" ]] ; then @@ -642,6 +682,8 @@ ruby_get_hdrdir() { # @FUNCTION: ruby_get_version # @RETURN: The version of the Ruby interpreter in ${RUBY}, or what 'ruby' points to. ruby_get_version() { + debug-print-function ${FUNCNAME} "${@}" + local ruby=${RUBY:-$(type -p ruby 2>/dev/null)} echo $(${ruby} -e 'puts RUBY_VERSION') @@ -650,6 +692,8 @@ ruby_get_version() { # @FUNCTION: ruby_get_implementation # @RETURN: The implementation of the Ruby interpreter in ${RUBY}, or what 'ruby' points to. ruby_get_implementation() { + debug-print-function ${FUNCNAME} "${@}" + local ruby=${RUBY:-$(type -p ruby 2>/dev/null)} case $(${ruby} --version) in @@ -671,6 +715,8 @@ ruby_get_implementation() { # rspec version that must be executed. It defaults to 2 for historical # compatibility. ruby-ng_rspec() { + debug-print-function ${FUNCNAME} "${@}" + local version=${RSPEC_VERSION-2} local files="$@" @@ -711,6 +757,8 @@ ruby-ng_rspec() { # This is simply a wrapper around the cucumber command (executed by $RUBY}) # which also respects TEST_VERBOSE and NOCOLOR environment variables. ruby-ng_cucumber() { + debug-print-function ${FUNCNAME} "${@}" + if [[ "${DEPEND}${BDEPEND}" != *"dev-util/cucumber"* ]]; then ewarn "Missing test dependency dev-util/cucumber" fi @@ -745,6 +793,8 @@ ruby-ng_cucumber() { # their script and we installed a broken wrapper for a while. # This also respects TEST_VERBOSE and NOCOLOR environment variables. ruby-ng_testrb-2() { + debug-print-function ${FUNCNAME} "${@}" + if [[ "${DEPEND}${BDEPEND}" != *"dev-ruby/test-unit"* ]]; then ewarn "Missing test dependency dev-ruby/test-unit" fi -- cgit v1.2.3