about summary refs log tree commit diff
path: root/pkgs/development/compilers/graalvm/community-edition/truffleruby.nix
blob: bb4a00325b7d4771b6cb348ea221f7e68dd304ab (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{ lib
, stdenv
, graalvmCEPackages
, libyaml
, openssl
, src
, version
}:

graalvmCEPackages.buildGraalvmProduct {
  inherit src version;
  product = "truffleruby";

  extraBuildInputs = [
    libyaml
    openssl
  ];

  preFixup = lib.optionalString stdenv.isLinux ''
    patchelf $out/lib/mri/openssl.so \
      --replace-needed libssl.so.10 libssl.so \
      --replace-needed libcrypto.so.10 libcrypto.so
  '';

  doInstallCheck = true;
  installCheckPhase = ''
    echo "Testing TruffleRuby"
    # Fixup/silence warnings about wrong locale
    export LANG=C
    export LC_ALL=C
    $out/bin/ruby -e 'puts(1 + 1)'
    ${# broken in darwin with sandbox enabled
      lib.optionalString stdenv.isLinux ''
      echo '1 + 1' | $out/bin/irb
    ''}
  '';
}