summary refs log tree commit diff
path: root/pkgs/development/ruby-modules/gem-config
diff options
context:
space:
mode:
authorSergei Maximov <s.b.maximov@gmail.com>2019-01-18 10:37:38 +0300
committerSergei Maximov <s.b.maximov@gmail.com>2019-01-18 11:04:54 +0300
commita3bff35450a046e2a79ebf9baefb4bf090ee3c49 (patch)
treeadcd6dae48ee65e4d9271ce3a26f46701003c3f4 /pkgs/development/ruby-modules/gem-config
parent9fd099a6ae1690909ebf40145e4cdabd67179676 (diff)
downloadnixpkgs-a3bff35450a046e2a79ebf9baefb4bf090ee3c49.tar
nixpkgs-a3bff35450a046e2a79ebf9baefb4bf090ee3c49.tar.gz
nixpkgs-a3bff35450a046e2a79ebf9baefb4bf090ee3c49.tar.bz2
nixpkgs-a3bff35450a046e2a79ebf9baefb4bf090ee3c49.tar.lz
nixpkgs-a3bff35450a046e2a79ebf9baefb4bf090ee3c49.tar.xz
nixpkgs-a3bff35450a046e2a79ebf9baefb4bf090ee3c49.tar.zst
nixpkgs-a3bff35450a046e2a79ebf9baefb4bf090ee3c49.zip
gem-config: support rbnacl v6.0.0
With the v6.0.0 release of the `rbnacl` gem, it does not longer depends
on `rbnacl-libsodium` gem (which is now deprecated ([1])) to package the
`libsodium` library and should use the one provided by the distribution;
it raises an error if `rbnacl-libsodium` is detected ([2]).
Unfortunately, default gem config patches `rbnacl` unconditionally ([3]),
which means that newer versions of `rbnacl` fail at startup.

[1]: https://github.com/crypto-rb/rbnacl-libsodium/issues/29
[2]: https://github.com/crypto-rb/rbnacl/blob/c176fc0bd8be74cf62c93a4b122e220ce4895348/lib/rbnacl.rb#L4-L8
[3]: https://github.com/NixOS/nixpkgs/blob/9fd099a6ae1690909ebf40145e4cdabd67179676/pkgs/development/ruby-modules/gem-config/default.nix#L300-L306
Diffstat (limited to 'pkgs/development/ruby-modules/gem-config')
-rw-r--r--pkgs/development/ruby-modules/gem-config/default.nix17
1 files changed, 10 insertions, 7 deletions
diff --git a/pkgs/development/ruby-modules/gem-config/default.nix b/pkgs/development/ruby-modules/gem-config/default.nix
index 7fdf5c83901..fd841563005 100644
--- a/pkgs/development/ruby-modules/gem-config/default.nix
+++ b/pkgs/development/ruby-modules/gem-config/default.nix
@@ -297,13 +297,16 @@ in
     buildInputs = [ rainbow_rake ];
   };
 
-  rbnacl = spec: {
-    postInstall = ''
-    sed -i $(cat $out/nix-support/gem-meta/install-path)/lib/rbnacl.rb -e "2a \
-    RBNACL_LIBSODIUM_GEM_LIB_PATH = '${libsodium.out}/lib/libsodium${stdenv.hostPlatform.extensions.sharedLibrary}'
-    "
-    '';
-  };
+  rbnacl = spec:
+    if lib.versionOlder spec.version "6.0.0" then {
+      postInstall = ''
+        sed -i $(cat $out/nix-support/gem-meta/install-path)/lib/rbnacl.rb -e "2a \
+        RBNACL_LIBSODIUM_GEM_LIB_PATH = '${libsodium.out}/lib/libsodium${stdenv.hostPlatform.extensions.sharedLibrary}'
+        "
+      '';
+    } else {
+      buildInputs = [ libsodium ];
+    };
 
   re2 = attrs: {
     buildInputs = [ re2 ];