graalvmCEPackages.truffleruby: init at 23.1.0

This commit is contained in:
Thiago Kenji Okada 2023-09-26 17:28:04 +01:00
parent fef3db632a
commit f52add035b
4 changed files with 66 additions and 0 deletions

View File

@ -38,4 +38,9 @@ rec {
version = version "graalpy";
src = fetchurl (source "graalpy");
};
truffleruby = callPackage ./truffleruby.nix {
version = version "truffleruby";
src = fetchurl (source "truffleruby");
};
}

View File

@ -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";
};
};
}

View File

@ -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
''}
'';
}

View File

@ -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