nixpkgs/pkgs/development/interpreters/ruby/ruby-19.nix
Eelco Dolstra 73fda38d0a * Enable libyaml support in Ruby by default. Libyaml is very small so
this shouldn't hurt much.

svn path=/nixpkgs/trunk/; revision=31474
2012-01-10 23:06:23 +00:00

56 lines
1.4 KiB
Nix

{ stdenv, fetchurl
, zlib, zlibSupport ? true
, openssl, opensslSupport ? true
, gdbm, gdbmSupport ? true
, ncurses, readline, cursesSupport ? false
, groff, docSupport ? false
, libyaml, yamlSupport ? true
}:
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 {
url = "ftp://ftp.ruby-lang.org/pub/ruby/1.9/${name}.tar.gz";
sha256 = "0km3ryc0cs578982x6c3y3n3xr920grnpncmznb447snwd10149v";
};
# 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)
++ (op yamlSupport libyaml);
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";
platforms = stdenv.lib.platforms.all;
};
passthru = rec {
majorVersion = "1.9";
minorVersion = "3";
patchLevel = "0";
libPath = "lib/ruby/${majorVersion}";
gemPath = "lib/ruby/gems/${majorVersion}";
};
}