Skip to content

Commit

Permalink
Patch RbNaCl to find system libsodium
Browse files Browse the repository at this point in the history
The patch is taken from this PR
RubyCrypto/rbnacl#186.
  • Loading branch information
adamruzicka committed Jul 27, 2021
1 parent b2cc92c commit 135bab4
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
From 38c1bcd2fe7a3735c52fdd9dd9127814cbcc44e6 Mon Sep 17 00:00:00 2001
From: Andrew Kane <[email protected]>
Date: Sat, 1 Dec 2018 15:03:36 -0800
Subject: [PATCH] Added support for Heroku

---
lib/rbnacl/init.rb | 2 +-
lib/rbnacl/sodium.rb | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/rbnacl/init.rb b/lib/rbnacl/init.rb
index cd0168b..a3cc12b 100644
--- a/lib/rbnacl/init.rb
+++ b/lib/rbnacl/init.rb
@@ -5,7 +5,7 @@ module RbNaCl
# Defines the libsodium init function
module Init
extend FFI::Library
- ffi_lib "sodium"
+ ffi_lib ["sodium", "libsodium.so.18", "libsodium.so.23"]

attach_function :sodium_init, [], :int
end
diff --git a/lib/rbnacl/sodium.rb b/lib/rbnacl/sodium.rb
index c72b000..f12ac45 100644
--- a/lib/rbnacl/sodium.rb
+++ b/lib/rbnacl/sodium.rb
@@ -8,7 +8,7 @@ module RbNaCl
module Sodium
def self.extended(klass)
klass.extend FFI::Library
- klass.ffi_lib "sodium"
+ klass.ffi_lib ["sodium", "libsodium.so.18", "libsodium.so.23"]
end

def sodium_type(type = nil)
1 change: 1 addition & 0 deletions packages/plugins/rubygem-rbnacl/rubygem-rbnacl.spec
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Group: Development/Languages
License: MIT
URL: https://github.com/cryptosphere/rbnacl
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
Patch0: 0001-Added-support-for-Heroku.patch

# start specfile generated dependencies
Requires: %{?scl_prefix_ruby}ruby(release)
Expand Down

0 comments on commit 135bab4

Please sign in to comment.