diff options
Diffstat (limited to 'pkgs/development/interpreters/ruby/default.nix')
-rw-r--r-- | pkgs/development/interpreters/ruby/default.nix | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/pkgs/development/interpreters/ruby/default.nix b/pkgs/development/interpreters/ruby/default.nix index d664c00bc31d..3d18d5650a81 100644 --- a/pkgs/development/interpreters/ruby/default.nix +++ b/pkgs/development/interpreters/ruby/default.nix @@ -1,7 +1,7 @@ { stdenv, lib, fetchurl, fetchpatch, fetchFromSavannah, fetchFromGitHub , zlib, openssl, gdbm, ncurses, readline, groff, libyaml, libffi, autoreconfHook, bison , autoconf, darwin ? null -, buildEnv, bundler, bundix +, buildEnv, bundler, bundix, Foundation } @ args: let @@ -27,6 +27,7 @@ let tag = ver.gitTag; isRuby20 = ver.majMin == "2.0"; isRuby21 = ver.majMin == "2.1"; + isRuby25 = ver.majMin == "2.5"; baseruby = self.override { useRailsExpress = false; }; self = lib.makeOverridable ( { stdenv, lib, fetchurl, fetchpatch, fetchFromSavannah, fetchFromGitHub @@ -40,7 +41,7 @@ let , libffi, fiddleSupport ? true , autoreconfHook, bison, autoconf , darwin ? null - , buildEnv, bundler, bundix + , buildEnv, bundler, bundix, Foundation }: let rubySrc = if useRailsExpress then fetchFromGitHub { @@ -75,11 +76,13 @@ let ++ (op opensslSupport openssl) ++ (op gdbmSupport gdbm) ++ (op yamlSupport libyaml) + ++ (op isRuby25 autoconf) # Looks like ruby fails to build on darwin without readline even if curses # support is not enabled, so add readline to the build inputs if curses # support is disabled (if it's enabled, we already have it) and we're # running on darwin ++ (op (!cursesSupport && stdenv.isDarwin) readline) + ++ (op (isRuby25 && stdenv.isDarwin) Foundation) ++ (ops stdenv.isDarwin (with darwin; [ libiconv libobjc libunwind ])); enableParallelBuilding = true; @@ -106,6 +109,11 @@ let cp ${config}/config.guess tool/ cp ${config}/config.sub tool/ '' + else if isRuby25 then '' + sed -i configure.ac -e '/config.guess/d' + cp ${config}/config.guess tool/ + cp ${config}/config.sub tool/ + '' else opString useRailsExpress '' sed -i configure.in -e '/config.guess/d' cp ${config}/config.guess tool/ @@ -220,4 +228,12 @@ in { git = "1w83kzak3m6vv3k09ynfw9vpgc7vpmij3x3zmgrhwm4ds1sp5irl"; }; }; + + ruby_2_5_0 = generic { + version = rubyVersion "2" "5" "0" ""; + sha256 = { + src = "1azj0d2lzziw6iml7bx3sxpxzcdmfwfq3yhm7djyp20q1xiz7rj6"; + git = "0d436nqmp3ykdkp4sck5bb8sf3qvx30x1p58xh8axv66mvsyc2jd"; + }; + }; } |