2023-02-14 15:23:26 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, graalvmCEPackages
|
2023-02-15 21:07:19 +00:00
|
|
|
, llvm-installable-svm
|
2023-02-14 15:23:26 +00:00
|
|
|
, openssl
|
|
|
|
, javaVersion
|
|
|
|
, src
|
|
|
|
, version
|
|
|
|
}:
|
|
|
|
|
|
|
|
graalvmCEPackages.buildGraalvmProduct rec {
|
|
|
|
inherit src javaVersion version;
|
|
|
|
product = "ruby-installable-svm";
|
|
|
|
|
2023-02-14 15:46:39 +00:00
|
|
|
extraBuildInputs = [
|
|
|
|
llvm-installable-svm
|
|
|
|
openssl
|
|
|
|
];
|
2023-02-14 15:23:26 +00:00
|
|
|
|
2023-02-14 16:53:34 +00:00
|
|
|
preFixup = lib.optionalString stdenv.isLinux ''
|
2023-02-14 15:23:26 +00:00
|
|
|
patchelf $out/languages/ruby/lib/mri/openssl.so \
|
|
|
|
--replace-needed libssl.so.10 libssl.so \
|
|
|
|
--replace-needed libcrypto.so.10 libcrypto.so
|
|
|
|
'';
|
|
|
|
|
2023-02-14 16:01:43 +00:00
|
|
|
graalvmPhases.installCheckPhase = ''
|
2023-02-14 15:23:26 +00:00
|
|
|
echo "Testing TruffleRuby"
|
2023-02-14 16:44:24 +00:00
|
|
|
# Fixup/silence warnings about wrong locale
|
2023-02-14 15:23:26 +00:00
|
|
|
export LANG=C
|
|
|
|
export LC_ALL=C
|
|
|
|
$out/bin/ruby -e 'puts(1 + 1)'
|
2023-02-14 17:53:57 +00:00
|
|
|
${# broken in darwin with sandbox enabled
|
|
|
|
lib.optionalString stdenv.isLinux ''
|
|
|
|
echo '1 + 1' | $out/bin/irb
|
|
|
|
''}
|
2023-02-14 15:23:26 +00:00
|
|
|
'';
|
|
|
|
}
|