Gentoo Archives: gentoo-commits

From: Hans de Graaff <graaff@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Thu, 25 Nov 2021 12:27:47
Message-Id: 1637843245.6c259e9849df4d5176c05341fc5624273cae312f.graaff@gentoo
1 commit: 6c259e9849df4d5176c05341fc5624273cae312f
2 Author: Hans de Graaff <graaff <AT> gentoo <DOT> org>
3 AuthorDate: Sun Nov 21 09:00:50 2021 +0000
4 Commit: Hans de Graaff <graaff <AT> gentoo <DOT> org>
5 CommitDate: Thu Nov 25 12:27:25 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6c259e98
7
8 eclass/ruby-fakegem.eclass: add method to indicate extensions are installed
9
10 Add a public method ruby_fakegem_extensions_installed to add the
11 marker that rubygems uses to determine if extensions have been
12 installed. We were already adding this as part of the extensions code,
13 but rubygems also expects this to be present for extensions that we
14 either ignore or handle differently. Without this marker rubygems
15 3.2.22 and newer will ignore this gem.
16
17 Signed-off-by: Hans de Graaff <graaff <AT> gentoo.org>
18
19 eclass/ruby-fakegem.eclass | 24 ++++++++++++++++++++----
20 1 file changed, 20 insertions(+), 4 deletions(-)
21
22 diff --git a/eclass/ruby-fakegem.eclass b/eclass/ruby-fakegem.eclass
23 index 1ef40aa2fad9..3832165761c9 100644
24 --- a/eclass/ruby-fakegem.eclass
25 +++ b/eclass/ruby-fakegem.eclass
26 @@ -546,6 +546,24 @@ if [[ ${RUBY_FAKEGEM_RECIPE_TEST} != none ]]; then
27 }
28 fi
29
30 +# @FUNCTION: ruby_fakegem_extensions_installed
31 +# @DESCRIPTION:
32 +# Install the marker indicating that extensions have been
33 +# installed. This is normally done as part of the extension
34 +# installation, but may be useful when we handle extensions manually.
35 +ruby_fakegem_extensions_installed() {
36 + mkdir -p "${ED}$(ruby_fakegem_extensionsdir)" || die
37 + touch "${ED}$(ruby_fakegem_extensionsdir)/gem.build_complete" || die
38 +}
39 +
40 +# @FUNCTION: ruby_fakegem_extensionsdir
41 +# @DESCRIPTION:
42 +# The directory where rubygems expects extensions for this package
43 +# version.
44 +ruby_fakegem_extensionsdir() {
45 + echo "$(ruby_fakegem_gemsdir)/extensions/$(ruby_rbconfig_value 'arch')/$(ruby_rbconfig_value 'ruby_version')/${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}"
46 +}
47 +
48 # @FUNCTION: each_fakegem_install
49 # @DESCRIPTION:
50 # Install the package for each ruby target.
51 @@ -562,14 +580,12 @@ each_fakegem_install() {
52
53 if [[ -n ${RUBY_FAKEGEM_EXTENSIONS} ]] && [ ${#RUBY_FAKEGEM_EXTENSIONS[@]} -ge 0 ]; then
54 einfo "installing extensions"
55 - local _extensionsdir="$(ruby_fakegem_gemsdir)/extensions/$(ruby_rbconfig_value 'arch')/$(ruby_rbconfig_value 'ruby_version')/${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}"
56
57 for extension in ${RUBY_FAKEGEM_EXTENSIONS[@]} ; do
58 - emake V=1 sitearchdir="${ED}${_extensionsdir}" sitelibdir="${ED}$(ruby_rbconfig_value 'sitelibdir')" -C ${extension%/*} install
59 + emake V=1 sitearchdir="${ED}$(ruby_fakegem_extensionsdir)" sitelibdir="${ED}$(ruby_rbconfig_value 'sitelibdir')" -C ${extension%/*} install
60 done
61
62 - # Add the marker to indicate that the extensions are installed
63 - touch "${ED}${_extensionsdir}/gem.build_complete" || die
64 + ruby_fakegem_extensions_installed
65 fi
66 }