2011-10-03 17:35:50 +02:00
|
|
|
{ stdenv, fetchurl
|
|
|
|
, zlib, zlibSupport ? true
|
|
|
|
, openssl, opensslSupport ? true
|
|
|
|
, gdbm, gdbmSupport ? true
|
|
|
|
, ncurses, readline, cursesSupport ? false
|
|
|
|
, groff, docSupport ? false
|
2012-01-11 00:06:23 +01:00
|
|
|
, libyaml, yamlSupport ? true
|
2011-10-03 17:35:50 +02: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-02-17 21:33:15 +01:00
|
|
|
url = "ftp://ftp.ruby-lang.org/pub/ruby/1.9/${name}.tar.bz2";
|
|
|
|
sha256 = "09jmxz3lqsi5097233hc1wjnzg6z5f4y7kmlkqhskdaj6125jyn6";
|
2011-10-03 17:35:50 +02: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 07:32:17 +01:00
|
|
|
++ (op gdbmSupport gdbm)
|
|
|
|
++ (op yamlSupport libyaml);
|
2011-10-03 17:35:50 +02: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 23:01:20 +01:00
|
|
|
platforms = stdenv.lib.platforms.all;
|
2011-10-03 17:35:50 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
passthru = rec {
|
|
|
|
majorVersion = "1.9";
|
2011-11-02 16:42:29 +01:00
|
|
|
minorVersion = "3";
|
2012-02-17 21:33:15 +01:00
|
|
|
patchLevel = "125";
|
2011-10-03 17:35:50 +02:00
|
|
|
libPath = "lib/ruby/${majorVersion}";
|
|
|
|
gemPath = "lib/ruby/gems/${majorVersion}";
|
|
|
|
};
|
|
|
|
}
|