summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Graaff <graaff@gentoo.org>2021-11-21 10:00:50 +0100
committerHans de Graaff <graaff@gentoo.org>2021-11-25 13:27:25 +0100
commit6c259e9849df4d5176c05341fc5624273cae312f (patch)
tree04e2b4a4c98cdae2332a6551540c2b76db110bbd /eclass/ruby-fakegem.eclass
parentdev-ruby/globalid: add 0.6.0 (diff)
downloadgentoo-6c259e9849df4d5176c05341fc5624273cae312f.tar.gz
gentoo-6c259e9849df4d5176c05341fc5624273cae312f.tar.bz2
gentoo-6c259e9849df4d5176c05341fc5624273cae312f.zip
eclass/ruby-fakegem.eclass: add method to indicate extensions are installed
Add a public method ruby_fakegem_extensions_installed to add the marker that rubygems uses to determine if extensions have been installed. We were already adding this as part of the extensions code, but rubygems also expects this to be present for extensions that we either ignore or handle differently. Without this marker rubygems 3.2.22 and newer will ignore this gem. Signed-off-by: Hans de Graaff <graaff@gentoo.org>
Diffstat (limited to 'eclass/ruby-fakegem.eclass')
-rw-r--r--eclass/ruby-fakegem.eclass24
1 files changed, 20 insertions, 4 deletions
diff --git a/eclass/ruby-fakegem.eclass b/eclass/ruby-fakegem.eclass
index 1ef40aa2fad9..3832165761c9 100644
--- a/eclass/ruby-fakegem.eclass
+++ b/eclass/ruby-fakegem.eclass
@@ -546,6 +546,24 @@ if [[ ${RUBY_FAKEGEM_RECIPE_TEST} != none ]]; then
}
fi
+# @FUNCTION: ruby_fakegem_extensions_installed
+# @DESCRIPTION:
+# Install the marker indicating that extensions have been
+# installed. This is normally done as part of the extension
+# installation, but may be useful when we handle extensions manually.
+ruby_fakegem_extensions_installed() {
+ mkdir -p "${ED}$(ruby_fakegem_extensionsdir)" || die
+ touch "${ED}$(ruby_fakegem_extensionsdir)/gem.build_complete" || die
+}
+
+# @FUNCTION: ruby_fakegem_extensionsdir
+# @DESCRIPTION:
+# The directory where rubygems expects extensions for this package
+# version.
+ruby_fakegem_extensionsdir() {
+ echo "$(ruby_fakegem_gemsdir)/extensions/$(ruby_rbconfig_value 'arch')/$(ruby_rbconfig_value 'ruby_version')/${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}"
+}
+
# @FUNCTION: each_fakegem_install
# @DESCRIPTION:
# Install the package for each ruby target.
@@ -562,14 +580,12 @@ each_fakegem_install() {
if [[ -n ${RUBY_FAKEGEM_EXTENSIONS} ]] && [ ${#RUBY_FAKEGEM_EXTENSIONS[@]} -ge 0 ]; then
einfo "installing extensions"
- local _extensionsdir="$(ruby_fakegem_gemsdir)/extensions/$(ruby_rbconfig_value 'arch')/$(ruby_rbconfig_value 'ruby_version')/${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}"
for extension in ${RUBY_FAKEGEM_EXTENSIONS[@]} ; do
- emake V=1 sitearchdir="${ED}${_extensionsdir}" sitelibdir="${ED}$(ruby_rbconfig_value 'sitelibdir')" -C ${extension%/*} install
+ emake V=1 sitearchdir="${ED}$(ruby_fakegem_extensionsdir)" sitelibdir="${ED}$(ruby_rbconfig_value 'sitelibdir')" -C ${extension%/*} install
done
- # Add the marker to indicate that the extensions are installed
- touch "${ED}${_extensionsdir}/gem.build_complete" || die
+ ruby_fakegem_extensions_installed
fi
}