summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Graaff <graaff@gentoo.org>2020-06-21 09:47:55 +0200
committerHans de Graaff <graaff@gentoo.org>2020-06-21 09:48:06 +0200
commiteea031d253fac214034a2b18e2ee16d4c3295a14 (patch)
tree47ab0d9fe3f744e86e7386f6a1f7d2255a0df1ef /dev-ruby/x25519
parentmail-client/mutt-1.14.4-r1: mark sparc and x86 stable, bug 728708 comment 8 (diff)
downloadgentoo-eea031d253fac214034a2b18e2ee16d4c3295a14.tar.gz
gentoo-eea031d253fac214034a2b18e2ee16d4c3295a14.tar.bz2
gentoo-eea031d253fac214034a2b18e2ee16d4c3295a14.zip
dev-ruby/x25519: precomputed impl only works on amd64
The precomputed implementation only works on amd64, so avoid it on other arches and let them fall back to the unoptimized reference implementation. Closes: https://bugs.gentoo.org/728420 Closes: https://bugs.gentoo.org/728888 Package-Manager: Portage-2.3.99, Repoman-2.3.22 Signed-off-by: Hans de Graaff <graaff@gentoo.org>
Diffstat (limited to 'dev-ruby/x25519')
-rw-r--r--dev-ruby/x25519/x25519-1.0.8.ebuild17
1 files changed, 14 insertions, 3 deletions
diff --git a/dev-ruby/x25519/x25519-1.0.8.ebuild b/dev-ruby/x25519/x25519-1.0.8.ebuild
index 36e65576f661..cd2b4a702e7f 100644
--- a/dev-ruby/x25519/x25519-1.0.8.ebuild
+++ b/dev-ruby/x25519/x25519-1.0.8.ebuild
@@ -26,16 +26,27 @@ all_ruby_prepare() {
sed -i -e '/bundler/ s:^:#: ; /coverall/I s:^:#:' spec/spec_helper.rb || die
sed -i -e 's/git ls-files -z/find . -print0/' ${RUBY_FAKEGEM_GEMSPEC} || die
+
+ # The precomputed implementation only works on amd64
+ if ! use amd64 ; then
+ sed -i -e '/\(x25519_precomputed\|X25519::Provider::Precomputed\)/ s:^:#:' lib/x25519.rb || die
+ fi
}
each_ruby_configure() {
- ${RUBY} -Cext/x25519_precomputed extconf.rb || die
+ if use amd64 ; then
+ ${RUBY} -Cext/x25519_precomputed extconf.rb || die
+ fi
+
${RUBY} -Cext/x25519_ref10 extconf.rb || die
}
each_ruby_compile() {
- emake V=1 -Cext/x25519_precomputed
- cp ext/x25519_precomputed/x25519_precomputed.so lib/ || die
+ if use amd64 ; then
+ emake V=1 -Cext/x25519_precomputed
+ cp ext/x25519_precomputed/x25519_precomputed.so lib/ || die
+ fi
+
emake V=1 -Cext/x25519_ref10
cp ext/x25519_ref10/x25519_ref10.so lib/ || die
}