2011-10-03 15:35:50 +00:00
|
|
|
{ stdenv, fetchurl
|
|
|
|
, zlib, zlibSupport ? true
|
|
|
|
, openssl, opensslSupport ? true
|
|
|
|
, gdbm, gdbmSupport ? true
|
|
|
|
, ncurses, readline, cursesSupport ? false
|
|
|
|
, groff, docSupport ? false
|
2012-01-10 23:06:23 +00:00
|
|
|
, libyaml, yamlSupport ? true
|
2011-10-03 15:35:50 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
op = stdenv.lib.optional;
|
|
|
|
ops = stdenv.lib.optionals;
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
version = with passthru; "${majorVersion}.${minorVersion}-p${patchLevel}";
|
|
|
|
|
|
|
|
name = "ruby-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2012-07-09 21:30:20 +00:00
|
|
|
url = "ftp://ftp.ruby-lang.org/pub/ruby/1.9/${name}.tar.bz2";
|
|
|
|
sha256 = "1ymq5lhp3fz0j3cs65521aihcnivbfrn76in900ccxd0msgfmld9";
|
2011-10-03 15:35:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# Have `configure' avoid `/usr/bin/nroff' in non-chroot builds.
|
|
|
|
NROFF = "${groff}/bin/nroff";
|
|
|
|
|
|
|
|
buildInputs = (ops cursesSupport [ ncurses readline ] )
|
|
|
|
++ (op docSupport groff )
|
|
|
|
++ (op zlibSupport zlib)
|
|
|
|
++ (op opensslSupport openssl)
|
2011-11-23 06:32:17 +00:00
|
|
|
++ (op gdbmSupport gdbm)
|
|
|
|
++ (op yamlSupport libyaml);
|
2012-07-09 21:30:20 +00:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
2011-10-03 15:35:50 +00:00
|
|
|
|
|
|
|
configureFlags = ["--enable-shared" "--enable-pthread"];
|
|
|
|
|
|
|
|
installFlags = stdenv.lib.optionalString docSupport "install-doc";
|
|
|
|
# Bundler tries to create this directory
|
|
|
|
postInstall = "mkdir -pv $out/${passthru.gemPath}";
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
license = "Ruby";
|
|
|
|
homepage = "http://www.ruby-lang.org/en/";
|
|
|
|
description = "The Ruby language";
|
2011-12-11 22:01:20 +00:00
|
|
|
platforms = stdenv.lib.platforms.all;
|
2011-10-03 15:35:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
passthru = rec {
|
|
|
|
majorVersion = "1.9";
|
2011-11-02 15:42:29 +00:00
|
|
|
minorVersion = "3";
|
2012-07-09 21:29:57 +00:00
|
|
|
patchLevel = "194";
|
2011-10-03 15:35:50 +00:00
|
|
|
libPath = "lib/ruby/${majorVersion}";
|
|
|
|
gemPath = "lib/ruby/gems/${majorVersion}";
|
|
|
|
};
|
|
|
|
}
|