nixpkgs/pkgs/development/interpreters/jruby/default.nix
R. RyanTM fb4f737b87 jruby: 9.1.16.0 -> 9.1.17.0
Semi-automatic update generated by https://github.com/ryantm/nixpkgs-update tools.

This update was made based on information from https://repology.org/metapackage/jruby/versions.

These checks were done:

- built on NixOS
- ran ‘/nix/store/g4a83h4462412zd3cf95j5ny19bxgha6-jruby-9.1.17.0/bin/jruby -h’ got 0 exit code
- ran ‘/nix/store/g4a83h4462412zd3cf95j5ny19bxgha6-jruby-9.1.17.0/bin/jruby --help’ got 0 exit code
- ran ‘/nix/store/g4a83h4462412zd3cf95j5ny19bxgha6-jruby-9.1.17.0/bin/jruby.bash -h’ got 0 exit code
- ran ‘/nix/store/g4a83h4462412zd3cf95j5ny19bxgha6-jruby-9.1.17.0/bin/jruby.bash --help’ got 0 exit code
- ran ‘/nix/store/g4a83h4462412zd3cf95j5ny19bxgha6-jruby-9.1.17.0/bin/ruby -h’ got 0 exit code
- ran ‘/nix/store/g4a83h4462412zd3cf95j5ny19bxgha6-jruby-9.1.17.0/bin/ruby --help’ got 0 exit code
- found 9.1.17.0 with grep in /nix/store/g4a83h4462412zd3cf95j5ny19bxgha6-jruby-9.1.17.0
- directory tree listing: https://gist.github.com/20468ca63db765e0d42a1c93191f0901
2018-04-26 03:55:58 -07:00

63 lines
1.6 KiB
Nix

{ stdenv, callPackage, fetchurl, makeWrapper, jre }:
let
# The version number here is whatever is reported by the RUBY_VERSION string
rubyVersion = callPackage ../ruby/ruby-version.nix {} "2" "3" "3" "";
jruby = stdenv.mkDerivation rec {
name = "jruby-${version}";
version = "9.1.17.0";
src = fetchurl {
url = "https://s3.amazonaws.com/jruby.org/downloads/${version}/jruby-bin-${version}.tar.gz";
sha256 = "1mfzs3mcpx8gmzidilzhpsxhgbblsflq35ww199m46pgiyzzf8ka";
};
buildInputs = [ makeWrapper ];
installPhase = ''
mkdir -pv $out/docs
mv * $out
rm $out/bin/*.{bat,dll,exe,sh}
mv $out/COPYING $out/LICENSE* $out/docs
for i in $out/bin/jruby{,.bash}; do
wrapProgram $i \
--set JAVA_HOME ${jre}
done
ln -s $out/bin/jruby $out/bin/ruby
# Bundler tries to create this directory
mkdir -pv $out/${passthru.gemPath}
mkdir -p $out/nix-support
cat > $out/nix-support/setup-hook <<EOF
addGemPath() {
addToSearchPath GEM_PATH \$1/${passthru.gemPath}
}
addEnvHooks "$hostOffset" addGemPath
EOF
'';
passthru = rec {
rubyEngine = "jruby";
gemPath = "lib/${rubyEngine}/gems/${rubyVersion.libDir}";
libPath = "lib/${rubyEngine}/${rubyVersion.libDir}";
};
meta = {
description = "Ruby interpreter written in Java";
homepage = http://jruby.org/;
license = with stdenv.lib.licenses; [ cpl10 gpl2 lgpl21 ];
platforms = stdenv.lib.platforms.unix;
};
};
in jruby.overrideAttrs (oldAttrs: {
passthru = oldAttrs.passthru // {
devEnv = callPackage ../ruby/dev.nix {
ruby = jruby;
};
};
})