2010-09-08 09:56:46 +00:00
|
|
|
{ stdenv, fetchurl
|
|
|
|
, zlib, zlibSupport ? true
|
|
|
|
, openssl, opensslSupport ? true
|
|
|
|
, gdbm, gdbmSupport ? true
|
|
|
|
, ncurses, readline, cursesSupport ? false
|
|
|
|
, groff, docSupport ? false
|
2008-04-11 09:21:27 +00:00
|
|
|
}:
|
2005-05-04 23:36:28 +00:00
|
|
|
|
2010-09-08 09:56:46 +00:00
|
|
|
let
|
|
|
|
op = stdenv.lib.optional;
|
|
|
|
ops = stdenv.lib.optionals;
|
|
|
|
in
|
|
|
|
|
2009-11-20 12:51:14 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2011-01-21 08:24:39 +00:00
|
|
|
version = with passthru; "${majorVersion}.${minorVersion}-p${patchLevel}";
|
2009-11-20 12:51:14 +00:00
|
|
|
|
2008-08-02 22:25:54 +00:00
|
|
|
name = "ruby-${version}";
|
2009-11-20 12:51:14 +00:00
|
|
|
|
2005-05-04 23:36:28 +00:00
|
|
|
src = fetchurl {
|
2008-08-14 11:47:51 +00:00
|
|
|
url = "ftp://ftp.ruby-lang.org/pub/ruby/1.8/${name}.tar.gz";
|
2011-01-21 08:24:39 +00:00
|
|
|
sha256 = "0qf50wa1ziziagnxarj8z6yrsivrhchq1j9017ff3z2z7d31l9kc";
|
2005-05-04 23:36:28 +00:00
|
|
|
};
|
2006-05-11 00:16:23 +00:00
|
|
|
|
2011-01-13 10:03:16 +00:00
|
|
|
# Have `configure' avoid `/usr/bin/nroff' in non-chroot builds.
|
|
|
|
NROFF = "${groff}/bin/nroff";
|
|
|
|
|
2010-09-08 09:56:46 +00:00
|
|
|
buildInputs = (ops cursesSupport [ ncurses readline ] )
|
|
|
|
++ (op docSupport groff )
|
|
|
|
++ (op zlibSupport zlib)
|
|
|
|
++ (op opensslSupport openssl)
|
|
|
|
++ (op gdbmSupport gdbm);
|
2009-11-20 12:51:14 +00:00
|
|
|
|
|
|
|
configureFlags = ["--enable-shared" "--enable-pthread"];
|
2008-08-02 22:25:54 +00:00
|
|
|
|
2010-09-08 09:56:46 +00:00
|
|
|
installFlags = stdenv.lib.optionalString docSupport "install-doc";
|
2011-01-21 08:24:39 +00:00
|
|
|
# Bundler tries to create this directory
|
|
|
|
postInstall = "mkdir -pv $out/${passthru.gemPath}";
|
2008-08-02 22:25:54 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
license = "Ruby";
|
|
|
|
homepage = "http://www.ruby-lang.org/en/";
|
|
|
|
description = "The Ruby language";
|
|
|
|
};
|
2009-08-20 20:18:58 +00:00
|
|
|
|
2011-01-21 08:24:39 +00:00
|
|
|
passthru = rec {
|
|
|
|
majorVersion = "1.8";
|
|
|
|
minorVersion = "7";
|
|
|
|
patchLevel = "330";
|
|
|
|
libPath = "lib/ruby/${majorVersion}";
|
|
|
|
gemPath = "lib/ruby/gems/${majorVersion}";
|
2009-08-20 20:18:58 +00:00
|
|
|
};
|
2005-05-04 23:36:28 +00:00
|
|
|
}
|