Merge pull request #237187 from marsam/update-jruby
jruby: 9.3.9.0 -> 9.4.3.0
This commit is contained in:
commit
202850e1a1
2 changed files with 35 additions and 37 deletions
|
@ -1,43 +1,44 @@
|
||||||
{ lib, stdenv, callPackage, fetchurl, makeWrapper, jre }:
|
{ lib, stdenv, callPackage, fetchurl, mkRubyVersion, makeBinaryWrapper, jre }:
|
||||||
|
|
||||||
let
|
let
|
||||||
# The version number here is whatever is reported by the RUBY_VERSION string
|
# The version number here is whatever is reported by the RUBY_VERSION string
|
||||||
rubyVersion = callPackage ../ruby/ruby-version.nix {} "2" "5" "7" "";
|
rubyVersion = mkRubyVersion "3" "1" "4" "";
|
||||||
jruby = stdenv.mkDerivation rec {
|
in
|
||||||
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
pname = "jruby";
|
pname = "jruby";
|
||||||
|
version = "9.4.3.0";
|
||||||
version = "9.3.9.0";
|
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "https://s3.amazonaws.com/jruby.org/downloads/${version}/jruby-bin-${version}.tar.gz";
|
url = "https://s3.amazonaws.com/jruby.org/downloads/${finalAttrs.version}/jruby-bin-${finalAttrs.version}.tar.gz";
|
||||||
sha256 = "sha256-JR5t2NHS+CkiyMd414V+G++C/lyiz3e8CTVkIdCwWrg=";
|
hash = "sha256-sJfgjFZp6KGIKI4RORHRK0rSvWeiwgnW36hEXWOk2Mk=";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ makeWrapper ];
|
nativeBuildInputs = [ makeBinaryWrapper ];
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -pv $out/docs
|
mkdir -pv $out/share/jruby/docs
|
||||||
mv * $out
|
mv * $out
|
||||||
rm $out/bin/*.{bat,dll,exe,sh}
|
rm $out/bin/*.{bat,dll,exe,sh}
|
||||||
mv $out/COPYING $out/LICENSE* $out/docs
|
mv $out/samples $out/share/jruby/
|
||||||
|
mv $out/BSDL $out/COPYING $out/LEGAL $out/LICENSE* $out/share/jruby/docs/
|
||||||
|
|
||||||
for i in $out/bin/jruby{,.bash}; do
|
for i in $out/bin/jruby; do
|
||||||
wrapProgram $i \
|
wrapProgram $i \
|
||||||
--set JAVA_HOME ${jre.home}
|
--set JAVA_HOME ${jre.home}
|
||||||
done
|
done
|
||||||
|
|
||||||
ln -s $out/bin/jruby $out/bin/ruby
|
ln -s $out/bin/jruby $out/bin/ruby
|
||||||
|
|
||||||
# Bundler tries to create this directory
|
# Bundler tries to create this directory
|
||||||
mkdir -pv $out/${passthru.gemPath}
|
mkdir -pv $out/${finalAttrs.passthru.gemPath}
|
||||||
mkdir -p $out/nix-support
|
mkdir -p $out/nix-support
|
||||||
cat > $out/nix-support/setup-hook <<EOF
|
cat > $out/nix-support/setup-hook <<EOF
|
||||||
addGemPath() {
|
addGemPath() {
|
||||||
addToSearchPath GEM_PATH \$1/${passthru.gemPath}
|
addToSearchPath GEM_PATH \$1/${finalAttrs.passthru.gemPath}
|
||||||
}
|
}
|
||||||
|
|
||||||
addEnvHooks "$hostOffset" addGemPath
|
addEnvHooks "$hostOffset" addGemPath
|
||||||
EOF
|
EOF
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postFixup = ''
|
postFixup = ''
|
||||||
|
@ -48,21 +49,18 @@ jruby = stdenv.mkDerivation rec {
|
||||||
rubyEngine = "jruby";
|
rubyEngine = "jruby";
|
||||||
gemPath = "lib/${rubyEngine}/gems/${rubyVersion.libDir}";
|
gemPath = "lib/${rubyEngine}/gems/${rubyVersion.libDir}";
|
||||||
libPath = "lib/${rubyEngine}/${rubyVersion.libDir}";
|
libPath = "lib/${rubyEngine}/${rubyVersion.libDir}";
|
||||||
|
devEnv = callPackage ../ruby/dev.nix {
|
||||||
|
ruby = finalAttrs.finalPackage;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Ruby interpreter written in Java";
|
description = "Ruby interpreter written in Java";
|
||||||
homepage = "http://jruby.org/";
|
homepage = "https://www.jruby.org/";
|
||||||
|
changelog = "https://github.com/jruby/jruby/releases/tag/${version}";
|
||||||
license = with licenses; [ cpl10 gpl2 lgpl21 ];
|
license = with licenses; [ cpl10 gpl2 lgpl21 ];
|
||||||
platforms = platforms.unix;
|
platforms = jre.meta.platforms;
|
||||||
maintainers = [ maintainers.fzakaria ];
|
maintainers = [ maintainers.fzakaria ];
|
||||||
sourceProvenance = with sourceTypes; [ binaryBytecode ];
|
sourceProvenance = with sourceTypes; [ binaryBytecode ];
|
||||||
};
|
};
|
||||||
};
|
|
||||||
in jruby.overrideAttrs (oldAttrs: {
|
|
||||||
passthru = oldAttrs.passthru // {
|
|
||||||
devEnv = callPackage ../ruby/dev.nix {
|
|
||||||
ruby = jruby;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
})
|
})
|
||||||
|
|
|
@ -136,7 +136,7 @@ stdenv.mkDerivation ((builtins.removeAttrs attrs ["source"]) // {
|
||||||
|
|
||||||
# As of ruby 3.0, ruby headers require -fdeclspec when building with clang
|
# As of ruby 3.0, ruby headers require -fdeclspec when building with clang
|
||||||
# Introduced in https://github.com/ruby/ruby/commit/0958e19ffb047781fe1506760c7cbd8d7fe74e57
|
# Introduced in https://github.com/ruby/ruby/commit/0958e19ffb047781fe1506760c7cbd8d7fe74e57
|
||||||
env.NIX_CFLAGS_COMPILE = toString (lib.optionals (stdenv.cc.isClang && lib.versionAtLeast ruby.version.major "3") [
|
env.NIX_CFLAGS_COMPILE = toString (lib.optionals (ruby.rubyEngine == "ruby" && stdenv.cc.isClang && lib.versionAtLeast ruby.version.major "3") [
|
||||||
"-fdeclspec"
|
"-fdeclspec"
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue