diff options
Diffstat (limited to 'pkgs/development/compilers/graalvm')
4 files changed, 66 insertions, 0 deletions
diff --git a/pkgs/development/compilers/graalvm/community-edition/default.nix b/pkgs/development/compilers/graalvm/community-edition/default.nix index 9218391ee7230..6ca8eec6f4f9b 100644 --- a/pkgs/development/compilers/graalvm/community-edition/default.nix +++ b/pkgs/development/compilers/graalvm/community-edition/default.nix @@ -38,4 +38,9 @@ rec { version = version "graalpy"; src = fetchurl (source "graalpy"); }; + + truffleruby = callPackage ./truffleruby.nix { + version = version "truffleruby"; + src = fetchurl (source "truffleruby"); + }; } diff --git a/pkgs/development/compilers/graalvm/community-edition/hashes-truffleruby.nix b/pkgs/development/compilers/graalvm/community-edition/hashes-truffleruby.nix new file mode 100644 index 0000000000000..ba99286d6a1e9 --- /dev/null +++ b/pkgs/development/compilers/graalvm/community-edition/hashes-truffleruby.nix @@ -0,0 +1,22 @@ +# Generated by pkgs/development/compilers/graalvm/community-edition/update.sh script +{ + "version" = "23.1.0"; + "truffleruby" = { + "linux-aarch64" = { + sha256 = "05q0xqm7qa9mw7v4kwyhbqsx27x19msf9rbbzq60dinp5724r721"; + url = "https://github.com/oracle/truffleruby/releases/download/graal-23.1.0/truffleruby-community-23.1.0-linux-aarch64.tar.gz"; + }; + "linux-amd64" = { + sha256 = "0bfcqcax9424vsdqzr18mxkhi2wpzc4xaji98anm8mcjkyl1r89q"; + url = "https://github.com/oracle/truffleruby/releases/download/graal-23.1.0/truffleruby-community-23.1.0-linux-amd64.tar.gz"; + }; + "macos-aarch64" = { + sha256 = "1nmqyn4vzwjsvq7dly8qn1xx973jg027xfbs988vf3nljnhkpq5l"; + url = "https://github.com/oracle/truffleruby/releases/download/graal-23.1.0/truffleruby-community-23.1.0-macos-aarch64.tar.gz"; + }; + "macos-amd64" = { + sha256 = "1yj9nk670hgh9104s1j207mqldagfvvvscj4bfgf3jlbcq5hvlhn"; + url = "https://github.com/oracle/truffleruby/releases/download/graal-23.1.0/truffleruby-community-23.1.0-macos-amd64.tar.gz"; + }; + }; +} diff --git a/pkgs/development/compilers/graalvm/community-edition/truffleruby.nix b/pkgs/development/compilers/graalvm/community-edition/truffleruby.nix new file mode 100644 index 0000000000000..bb4a00325b7d4 --- /dev/null +++ b/pkgs/development/compilers/graalvm/community-edition/truffleruby.nix @@ -0,0 +1,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 + ''} + ''; +} diff --git a/pkgs/development/compilers/graalvm/community-edition/update.sh b/pkgs/development/compilers/graalvm/community-edition/update.sh index cc3e0287ae813..2dbb32156974b 100755 --- a/pkgs/development/compilers/graalvm/community-edition/update.sh +++ b/pkgs/development/compilers/graalvm/community-edition/update.sh @@ -35,6 +35,7 @@ readonly nixpkgs=../../../../.. declare -r -A update_urls=( [graalvm-ce]="https://api.github.com/repos/graalvm/graalvm-ce-builds/releases/latest" [graalpy]="https://api.github.com/repos/oracle/graalpython/releases/latest" + [truffleruby]="https://api.github.com/repos/oracle/truffleruby/releases/latest" ) current_version="$(nix-instantiate "$nixpkgs" --eval --strict -A "graalvmCEPackages.${product}.version" --json | jq -r)" @@ -65,6 +66,7 @@ fi declare -r -A products_urls=( [graalvm-ce]="https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-${new_version}/graalvm-community-jdk-${new_version}_@platform@_bin.tar.gz" [graalpy]="https://github.com/oracle/graalpython/releases/download/graal-${new_version}/graalpy-community-${new_version}-@platform@.tar.gz" + [truffleruby]="https://github.com/oracle/truffleruby/releases/download/graal-${new_version}/truffleruby-community-${new_version}-@platform@.tar.gz" ) if [[ "$product" == "graalvm-ce" ]]; then |