2011-09-23 17:08:55 +02:00
|
|
|
{ stdenv, fetchurl
|
|
|
|
, zlib, zlibSupport ? true
|
|
|
|
, openssl, opensslSupport ? true
|
|
|
|
, gdbm, gdbmSupport ? true
|
|
|
|
, ncurses, readline, cursesSupport ? false
|
|
|
|
, groff, docSupport ? false
|
|
|
|
}:
|
2009-06-30 16:29:17 +02:00
|
|
|
|
2011-09-23 17:08:55 +02:00
|
|
|
let
|
|
|
|
op = stdenv.lib.optional;
|
|
|
|
ops = stdenv.lib.optionals;
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
version = with passthru; "${majorVersion}.${minorVersion}-p${patchLevel}";
|
|
|
|
|
2009-06-30 16:29:17 +02:00
|
|
|
name = "ruby-${version}";
|
2011-09-23 17:08:55 +02:00
|
|
|
|
2009-06-30 16:29:17 +02:00
|
|
|
src = fetchurl {
|
2013-11-24 17:49:03 +01:00
|
|
|
url = "http://cache.ruby-lang.org/pub/ruby/1.8/${name}.tar.bz2";
|
|
|
|
sha256 = "b4e34703137f7bfb8761c4ea474f7438d6ccf440b3d35f39cc5e4d4e239c07e3";
|
2011-09-23 17:08:55 +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)
|
|
|
|
++ (op gdbmSupport gdbm);
|
|
|
|
|
|
|
|
configureFlags = ["--enable-shared" "--enable-pthread"];
|
|
|
|
|
|
|
|
installFlags = stdenv.lib.optionalString docSupport "install-doc";
|
2013-12-27 00:38:10 +01:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
# Bundler tries to create this directory
|
|
|
|
mkdir -pv $out/${passthru.gemPath}
|
|
|
|
mkdir -p $out/nix-support
|
|
|
|
cat > $out/nix-support/setup-hook <<EOF
|
|
|
|
addGemPath() {
|
|
|
|
addToSearchPath GEM_PATH \$1/${passthru.gemPath}
|
|
|
|
}
|
|
|
|
|
|
|
|
envHooks+=(addGemPath)
|
|
|
|
EOF
|
|
|
|
'';
|
2011-09-23 17:08:55 +02:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
license = "Ruby";
|
|
|
|
homepage = "http://www.ruby-lang.org/en/";
|
|
|
|
description = "The Ruby language";
|
2009-06-30 16:29:17 +02:00
|
|
|
};
|
2009-08-20 22:18:58 +02:00
|
|
|
|
2011-09-23 17:08:55 +02:00
|
|
|
passthru = rec {
|
2011-09-29 23:55:12 +02:00
|
|
|
majorVersion = "1.8";
|
|
|
|
minorVersion = "7";
|
2013-11-24 17:49:03 +01:00
|
|
|
patchLevel = "374";
|
2011-09-23 17:08:55 +02:00
|
|
|
libPath = "lib/ruby/${majorVersion}";
|
|
|
|
gemPath = "lib/ruby/gems/${majorVersion}";
|
2009-08-20 22:18:58 +02:00
|
|
|
};
|
2009-06-30 16:29:17 +02:00
|
|
|
}
|