2011-09-23 16:08:55 +01:00
|
|
|
{ stdenv, fetchurl
|
|
|
|
, zlib, zlibSupport ? true
|
|
|
|
, openssl, opensslSupport ? true
|
|
|
|
, gdbm, gdbmSupport ? true
|
|
|
|
, ncurses, readline, cursesSupport ? false
|
|
|
|
, groff, docSupport ? false
|
|
|
|
}:
|
2009-06-30 15:29:17 +01:00
|
|
|
|
2011-09-23 16:08:55 +01:00
|
|
|
let
|
|
|
|
op = stdenv.lib.optional;
|
|
|
|
ops = stdenv.lib.optionals;
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
version = with passthru; "${majorVersion}.${minorVersion}-p${patchLevel}";
|
|
|
|
|
2009-06-30 15:29:17 +01:00
|
|
|
name = "ruby-${version}";
|
2011-09-23 16:08:55 +01:00
|
|
|
|
2009-06-30 15:29:17 +01:00
|
|
|
src = fetchurl {
|
2011-09-29 22:55:12 +01:00
|
|
|
url = "ftp://ftp.ruby-lang.org/pub/ruby/1.8/${name}.tar.gz";
|
2012-01-29 18:00:22 +00:00
|
|
|
sha256 = "0b4n9d1idmsl47cq3mw6zhi94yp048ljlfgg9qdblbkvnd7arp1g";
|
2011-09-23 16:08:55 +01: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)
|
|
|
|
++ (op gdbmSupport gdbm);
|
|
|
|
|
|
|
|
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";
|
2009-06-30 15:29:17 +01:00
|
|
|
};
|
2009-08-20 21:18:58 +01:00
|
|
|
|
2011-09-23 16:08:55 +01:00
|
|
|
passthru = rec {
|
2011-09-29 22:55:12 +01:00
|
|
|
majorVersion = "1.8";
|
|
|
|
minorVersion = "7";
|
2012-01-29 18:00:22 +00:00
|
|
|
patchLevel = "357";
|
2011-09-23 16:08:55 +01:00
|
|
|
libPath = "lib/ruby/${majorVersion}";
|
|
|
|
gemPath = "lib/ruby/gems/${majorVersion}";
|
2009-08-20 21:18:58 +01:00
|
|
|
};
|
2009-06-30 15:29:17 +01:00
|
|
|
}
|