From 25ed22778cb6f1ded25aab1a26e347ab6fcb5cad Mon Sep 17 00:00:00 2001 From: Johnny Shields <27655+johnnyshields@users.noreply.github.com> Date: Wed, 26 Feb 2025 01:08:06 +0900 Subject: [PATCH 1/4] Update rbnacl.gemspec --- rbnacl.gemspec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rbnacl.gemspec b/rbnacl.gemspec index 50cad59..e4ddbec 100644 --- a/rbnacl.gemspec +++ b/rbnacl.gemspec @@ -21,7 +21,8 @@ Gem::Specification.new do |spec| "changelog_uri" => "#{spec.homepage}/blob/master/CHANGES.md", "documentation_uri" => "https://www.rubydoc.info/gems/#{spec.name}/#{spec.version}", "source_code_uri" => "#{spec.homepage}/tree/v#{spec.version}", - "wiki_uri" => "#{spec.homepage}/wiki" + "wiki_uri" => "#{spec.homepage}/wiki", + "msys2_mingw_dependencies" => "libsodium" } spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR).reject do |f| f.start_with?("images/", "spec/", "tasks/", "Rakefile") From 1fd9a2950fef61dbf1ee37dc7efaa0156b5b5e6c Mon Sep 17 00:00:00 2001 From: Johnny Shields <27655+johnnyshields@users.noreply.github.com> Date: Wed, 26 Feb 2025 01:19:13 +0900 Subject: [PATCH 2/4] Update --- README.md | 4 ++-- lib/rbnacl/init.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f544393..8d6ad5b 100644 --- a/README.md +++ b/README.md @@ -60,8 +60,6 @@ If something doesn't work on one of these versions, it's a bug. ## Installation -Note: [Windows installation instructions are available](https://github.com/RubyCrypto/rbnacl/wiki/Installing-libsodium#windows). - ### libsodium To use RbNaCl, you will need to install libsodium: @@ -84,6 +82,8 @@ portmaster or portupgrade), or use make as follows: cd /usr/ports/security/libsodium; make install clean +For Windows users using the [Ruby Installer for Windows](https://rubyinstaller.org/), the [libsodium MSYS2 package](https://packages.msys2.org/packages/mingw-w64-ucrt-x86_64-libsodium) should install automatically when you install this gem. Otherwise, you can follow the [manual installation instructions for Windows](https://github.com/RubyCrypto/rbnacl/wiki/Installing-libsodium#windows). + ### RbNaCl gem Once you have libsodium installed, add this line to your application's Gemfile: diff --git a/lib/rbnacl/init.rb b/lib/rbnacl/init.rb index b89e3bb..96962de 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", "libsodium.so.18", "libsodium.so.23", "libsodium.so.26"] + ffi_lib ["sodium", "libsodium.so.18", "libsodium.so.23", "libsodium.so.26", "libsodium-26"] attach_function :sodium_init, [], :int end From 235829d63647c0e106926ee7443e013279053bc7 Mon Sep 17 00:00:00 2001 From: Johnny Shields <27655+johnnyshields@users.noreply.github.com> Date: Wed, 26 Feb 2025 01:20:50 +0900 Subject: [PATCH 3/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8d6ad5b..c590e72 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ portmaster or portupgrade), or use make as follows: cd /usr/ports/security/libsodium; make install clean -For Windows users using the [Ruby Installer for Windows](https://rubyinstaller.org/), the [libsodium MSYS2 package](https://packages.msys2.org/packages/mingw-w64-ucrt-x86_64-libsodium) should install automatically when you install this gem. Otherwise, you can follow the [manual installation instructions for Windows](https://github.com/RubyCrypto/rbnacl/wiki/Installing-libsodium#windows). +For Windows users using the [Ruby Installer for Windows](https://rubyinstaller.org/), the [libsodium MSYS2 package](https://packages.msys2.org/packages/mingw-w64-ucrt-x86_64-libsodium) should install automatically when you install this gem. Otherwise, you may follow the [manual installation instructions for Windows](https://github.com/RubyCrypto/rbnacl/wiki/Installing-libsodium#windows). ### RbNaCl gem From de651abb1293a1f14879fba447194ee76584e800 Mon Sep 17 00:00:00 2001 From: Johnny Shields <27655+johnnyshields@users.noreply.github.com> Date: Wed, 26 Feb 2025 01:38:19 +0900 Subject: [PATCH 4/4] Missed case --- lib/rbnacl/sodium.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rbnacl/sodium.rb b/lib/rbnacl/sodium.rb index 9c489d3..5d151cf 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", "libsodium.so.18", "libsodium.so.23", "libsodium.so.26"] + klass.ffi_lib ["sodium", "libsodium.so.18", "libsodium.so.23", "libsodium.so.26", "libsodium-26"] end def sodium_type(type = nil)