summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorAnna Vyalkova <cyber+gentoo@sysrq.in>2022-03-15 11:11:58 +0200
committerJoonas Niilola <juippis@gentoo.org>2022-03-15 11:13:02 +0200
commit25ba9021f20ef91ce0ffdb398d3135948e107395 (patch)
tree41af3c2f0ba311d4a1a7097679ae6d47f7fc5e22 /eclass
parentruby-ng-gnome2.eclass: add debug-print-function calls (diff)
downloadgentoo-25ba9021f20ef91ce0ffdb398d3135948e107395.tar.gz
gentoo-25ba9021f20ef91ce0ffdb398d3135948e107395.tar.bz2
gentoo-25ba9021f20ef91ce0ffdb398d3135948e107395.zip
ruby-fakegem.eclass: add debug-print-function calls
Signed-off-by: Anna Vyalkova <cyber+gentoo@sysrq.in> Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/ruby-fakegem.eclass44
1 files changed, 44 insertions, 0 deletions
diff --git a/eclass/ruby-fakegem.eclass b/eclass/ruby-fakegem.eclass
index bad6b0865323..7e5a62aa5b57 100644
--- a/eclass/ruby-fakegem.eclass
+++ b/eclass/ruby-fakegem.eclass
@@ -216,6 +216,8 @@ esac
# This function returns the gems data directory for the ruby
# implementation in question.
ruby_fakegem_gemsdir() {
+ debug-print-function ${FUNCNAME} "${@}"
+
local _gemsitedir=$(ruby_rbconfig_value 'sitelibdir')
_gemsitedir=${_gemsitedir//site_ruby/gems}
_gemsitedir=${_gemsitedir#${EPREFIX}}
@@ -233,6 +235,8 @@ ruby_fakegem_gemsdir() {
# @DESCRIPTION:
# Installs the specified file(s) into the gems directory.
ruby_fakegem_doins() {
+ debug-print-function ${FUNCNAME} "${@}"
+
(
insinto $(ruby_fakegem_gemsdir)/gems/${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}
doins "$@"
@@ -244,6 +248,8 @@ ruby_fakegem_doins() {
# @DESCRIPTION:
# Installs the specified file into the gems directory using the provided filename.
ruby_fakegem_newins() {
+ debug-print-function ${FUNCNAME} "${@}"
+
(
# Since newins does not accept full paths but just basenames
# for the target file, we want to extend it here.
@@ -263,6 +269,8 @@ ruby_fakegem_newins() {
# by the RUBY_FAKEGEM_GEMSPEC variable, or generate one using
# ruby_fakegem_genspec.
ruby_fakegem_install_gemspec() {
+ debug-print-function ${FUNCNAME} "${@}"
+
local gemspec="${T}"/${RUBY_FAKEGEM_NAME}-${_ruby_implementation}
(
@@ -290,6 +298,8 @@ ruby_fakegem_install_gemspec() {
# RUBY_FAKEGEM_GEMSPEC. This file is eval'ed to produce a final specification
# in a way similar to packaging the gemspec file.
ruby_fakegem_gemspec_gemspec() {
+ debug-print-function ${FUNCNAME} "${@}"
+
${RUBY} --disable=did_you_mean -e "puts eval(File::open('$1').read).to_ruby" > $2
}
@@ -300,6 +310,8 @@ ruby_fakegem_gemspec_gemspec() {
# the metadata distributed by the gem itself. This is similar to how
# rubygems creates an installation from a .gem file.
ruby_fakegem_metadata_gemspec() {
+ debug-print-function ${FUNCNAME} "${@}"
+
${RUBY} --disable=did_you_mean -r yaml -e "puts Gem::Specification.from_yaml(File::open('$1', :encoding => 'UTF-8').read).to_ruby" > $2
}
@@ -317,6 +329,8 @@ ruby_fakegem_metadata_gemspec() {
# See RUBY_FAKEGEM_NAME and RUBY_FAKEGEM_VERSION for setting name and version.
# See RUBY_FAKEGEM_REQUIRE_PATHS for setting extra require paths.
ruby_fakegem_genspec() {
+ debug-print-function ${FUNCNAME} "${@}"
+
case ${EAPI} in
5|6) ;;
*)
@@ -356,6 +370,8 @@ EOF
# to inject additional ruby code into the wrapper. This may be useful to
# e.g. force a specific version using the gem command.
ruby_fakegem_binwrapper() {
+ debug-print-function ${FUNCNAME} "${@}"
+
(
local gembinary=$1
local newbinary=${2:-/usr/bin/$gembinary}
@@ -407,6 +423,8 @@ EOF
# @DESCRIPTION:
# Configure extensions defined in RUBY_FAKEGEM_EXTENSIONS, if any.
each_fakegem_configure() {
+ debug-print-function ${FUNCNAME} "${@}"
+
tc-export PKG_CONFIG
for extension in "${RUBY_FAKEGEM_EXTENSIONS[@]}" ; do
CC=$(tc-getCC) ${RUBY} --disable=did_you_mean -C ${extension%/*} ${extension##*/} --with-cflags="${CFLAGS}" --with-ldflags="${LDFLAGS}" ${RUBY_FAKEGM_EXTENSION_OPTIONS} || die
@@ -417,6 +435,8 @@ each_fakegem_configure() {
# @DESCRIPTION:
# Run each_fakegem_configure for each ruby target
each_ruby_configure() {
+ debug-print-function ${FUNCNAME} "${@}"
+
each_fakegem_configure
}
@@ -425,6 +445,8 @@ each_ruby_configure() {
# Build documentation for the package if indicated by the doc USE flag
# and if there is a documetation task defined.
all_fakegem_compile() {
+ debug-print-function ${FUNCNAME} "${@}"
+
if [[ -n ${RUBY_FAKEGEM_DOCDIR} ]] && use doc; then
case ${RUBY_FAKEGEM_RECIPE_DOC} in
rake)
@@ -445,6 +467,8 @@ all_fakegem_compile() {
# @DESCRIPTION:
# Compile extensions defined in RUBY_FAKEGEM_EXTENSIONS, if any.
each_fakegem_compile() {
+ debug-print-function ${FUNCNAME} "${@}"
+
for extension in "${RUBY_FAKEGEM_EXTENSIONS[@]}" ; do
emake V=1 -C ${extension%/*}
mkdir -p "${RUBY_FAKEGEM_EXTENSION_LIBDIR%/}"
@@ -456,6 +480,8 @@ each_fakegem_compile() {
# @DESCRIPTION:
# Run each_fakegem_compile for each ruby target
each_ruby_compile() {
+ debug-print-function ${FUNCNAME} "${@}"
+
each_fakegem_compile
}
@@ -463,6 +489,8 @@ each_ruby_compile() {
# @DESCRIPTION:
# Unpack the source archive, including support for unpacking gems.
all_ruby_unpack() {
+ debug-print-function ${FUNCNAME} "${@}"
+
# Special support for extracting .gem files; the file need to be
# extracted twice and the mtime from the archive _has_ to be
# ignored (it's always set to epoch 0).
@@ -509,6 +537,8 @@ all_ruby_unpack() {
# @DESCRIPTION:
# Compile the package.
all_ruby_compile() {
+ debug-print-function ${FUNCNAME} "${@}"
+
all_fakegem_compile
}
@@ -516,6 +546,8 @@ all_ruby_compile() {
# @DESCRIPTION:
# Run tests for the package for each ruby target if the test task is defined.
each_fakegem_test() {
+ debug-print-function ${FUNCNAME} "${@}"
+
case ${RUBY_FAKEGEM_RECIPE_TEST} in
rake)
${RUBY} --disable=did_you_mean -S rake ${RUBY_FAKEGEM_TASK_TEST} || die "tests failed"
@@ -550,6 +582,8 @@ fi
# installed. This is normally done as part of the extension
# installation, but may be useful when we handle extensions manually.
ruby_fakegem_extensions_installed() {
+ debug-print-function ${FUNCNAME} "${@}"
+
mkdir -p "${ED}$(ruby_fakegem_extensionsdir)" || die
touch "${ED}$(ruby_fakegem_extensionsdir)/gem.build_complete" || die
}
@@ -559,6 +593,8 @@ ruby_fakegem_extensions_installed() {
# The directory where rubygems expects extensions for this package
# version.
ruby_fakegem_extensionsdir() {
+ debug-print-function ${FUNCNAME} "${@}"
+
# Using formula from ruby src/lib/rubygems/basic_specification.
extensions_dir=$(${RUBY} --disable=did_you_mean -e "puts File.join('extensions', Gem::Platform.local.to_s, Gem.extension_api_version)")
@@ -569,6 +605,8 @@ ruby_fakegem_extensionsdir() {
# @DESCRIPTION:
# Install the package for each ruby target.
each_fakegem_install() {
+ debug-print-function ${FUNCNAME} "${@}"
+
ruby_fakegem_install_gemspec
local _gemlibdirs="${RUBY_FAKEGEM_EXTRAINSTALL}"
@@ -594,6 +632,8 @@ each_fakegem_install() {
# @DESCRIPTION:
# Install the package for each target.
each_ruby_install() {
+ debug-print-function ${FUNCNAME} "${@}"
+
each_fakegem_install
}
@@ -601,6 +641,8 @@ each_ruby_install() {
# @DESCRIPTION:
# Install files common to all ruby targets.
all_fakegem_install() {
+ debug-print-function ${FUNCNAME} "${@}"
+
if [[ -n ${RUBY_FAKEGEM_DOCDIR} ]] && use doc; then
for dir in ${RUBY_FAKEGEM_DOCDIR}; do
[[ -d ${dir} ]] || continue
@@ -634,5 +676,7 @@ all_fakegem_install() {
# @DESCRIPTION:
# Install files common to all ruby targets.
all_ruby_install() {
+ debug-print-function ${FUNCNAME} "${@}"
+
all_fakegem_install
}