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]:c176fc0bd8/lib/rbnacl.rb (L4-L8)
[3]:9fd099a6ae/pkgs/development/ruby-modules/gem-config/default.nix (L300-L306)
This commit is contained in:
parent
9fd099a6ae
commit
a3bff35450
@ -297,13 +297,16 @@ in
|
|||||||
buildInputs = [ rainbow_rake ];
|
buildInputs = [ rainbow_rake ];
|
||||||
};
|
};
|
||||||
|
|
||||||
rbnacl = spec: {
|
rbnacl = spec:
|
||||||
postInstall = ''
|
if lib.versionOlder spec.version "6.0.0" then {
|
||||||
sed -i $(cat $out/nix-support/gem-meta/install-path)/lib/rbnacl.rb -e "2a \
|
postInstall = ''
|
||||||
RBNACL_LIBSODIUM_GEM_LIB_PATH = '${libsodium.out}/lib/libsodium${stdenv.hostPlatform.extensions.sharedLibrary}'
|
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: {
|
re2 = attrs: {
|
||||||
buildInputs = [ re2 ];
|
buildInputs = [ re2 ];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user