dev-ruby/rbnacl: fix buffer size on ppc32, bug 650834

Thanks to slyfox for providing a patch.

Closes: https://bugs.gentoo.org/650834
Package-Manager: Portage-2.3.24, Repoman-2.3.6
This commit is contained in:
Hans de Graaff
2018-04-07 07:32:12 +02:00
parent fc345e0415
commit a5ce5d3cec
3 changed files with 92 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
Patches based on upstream patch below but reworked to apply to 5.0.0
From 299e0ddbb8fcafc99214c26d6002da145cc84a0c Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <slyfox@gentoo.org>
Date: Sun, 18 Mar 2018 21:13:09 +0000
Subject: [PATCH] rbnacl: fix byffer size type in randombytes_buf binding
---
lib/rbnacl/random.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/rbnacl/random.rb b/lib/rbnacl/random.rb
index 9742186..db85d6d 100644
--- a/lib/rbnacl/random.rb
+++ b/lib/rbnacl/random.rb
@@ -13,7 +13,7 @@ module Random
sodium_function :c_random_bytes,
:randombytes_buf,
- [:pointer, :ulong_long]
+ %i[pointer size_t]
# Returns a string of random bytes
#

View File

@@ -0,0 +1,34 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
USE_RUBY="ruby22 ruby23 ruby24 ruby25"
RUBY_FAKEGEM_RECIPE_DOC="rdoc"
RUBY_FAKEGEM_EXTRADOC="CHANGES.md README.md"
RUBY_FAKEGEM_RECIPE_TEST="rspec3"
inherit ruby-fakegem
DESCRIPTION="Provides a high-level toolkit for building cryptographic systems and protocols"
HOMEPAGE="https://github.com/cryptosphere/rbnacl"
LICENSE="MIT"
SLOT="4"
KEYWORDS="~amd64 ~ppc64 ~x86"
IUSE=""
RDEPEND+=" dev-libs/libsodium"
DEPEND+=" test? ( dev-libs/libsodium )"
ruby_add_rdepend "dev-ruby/ffi"
PATCHES=( "${FILESDIR}/rbnacl-buffer-size.patch" )
all_ruby_prepare() {
sed -i -e '/coveralls/I s:^:#:' \
-e '/bundler/ s:^:#:' \
-e 's:rbnacl/libsodium:rbnacl:' spec/spec_helper.rb
}

View File

@@ -0,0 +1,34 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
USE_RUBY="ruby22 ruby23 ruby24 ruby25"
RUBY_FAKEGEM_RECIPE_DOC="rdoc"
RUBY_FAKEGEM_EXTRADOC="CHANGES.md README.md"
RUBY_FAKEGEM_RECIPE_TEST="rspec3"
inherit ruby-fakegem
DESCRIPTION="Provides a high-level toolkit for building cryptographic systems and protocols"
HOMEPAGE="https://github.com/cryptosphere/rbnacl"
LICENSE="MIT"
SLOT="5"
KEYWORDS="~amd64 ~ppc64 ~x86"
IUSE=""
RDEPEND+=" dev-libs/libsodium"
DEPEND+=" test? ( dev-libs/libsodium )"
ruby_add_rdepend "dev-ruby/ffi"
PATCHES=( "${FILESDIR}/rbnacl-buffer-size.patch" )
all_ruby_prepare() {
sed -i -e '/coveralls/I s:^:#:' \
-e '/bundler/ s:^:#:' \
-e 's:rbnacl/libsodium:rbnacl:' spec/spec_helper.rb
}