Ruby: Separate 'install the current version of ruby' from 'install version x of ruby' when x is also the current version

svn path=/nixpkgs/trunk/; revision=29600
This commit is contained in:
Shea Levy 2011-10-03 15:35:50 +00:00
parent 4d2b6a350b
commit 936c460abb
3 changed files with 55 additions and 54 deletions

View File

@ -1,52 +1 @@
{ stdenv, fetchurl
, zlib, zlibSupport ? true
, openssl, opensslSupport ? true
, gdbm, gdbmSupport ? true
, ncurses, readline, cursesSupport ? false
, groff, docSupport ? false
}:
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 = "0zmxdqzprbdc5mvmba1i94mpqnqxxlh460jri7bx6i29bibigj0w";
};
# 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";
};
passthru = rec {
majorVersion = "1.9";
minorVersion = "2";
patchLevel = "290";
libPath = "lib/ruby/${majorVersion}";
gemPath = "lib/ruby/gems/${majorVersion}";
};
}
import ./ruby-19.nix

View File

@ -0,0 +1,52 @@
{ stdenv, fetchurl
, zlib, zlibSupport ? true
, openssl, opensslSupport ? true
, gdbm, gdbmSupport ? true
, ncurses, readline, cursesSupport ? false
, groff, docSupport ? false
}:
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 = "0zmxdqzprbdc5mvmba1i94mpqnqxxlh460jri7bx6i29bibigj0w";
};
# 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";
};
passthru = rec {
majorVersion = "1.9";
minorVersion = "2";
patchLevel = "290";
libPath = "lib/ruby/${majorVersion}";
gemPath = "lib/ruby/gems/${majorVersion}";
};
}

View File

@ -2601,8 +2601,8 @@ let
regina = callPackage ../development/interpreters/regina {};
ruby18 = callPackage ../development/interpreters/ruby/ruby-18.nix { };
ruby19 = callPackage ../development/interpreters/ruby { };
ruby = ruby19;
ruby19 = callPackage ../development/interpreters/ruby/ruby-19.nix { };
ruby = callPackage ../development/interpreters/ruby { };
rubyLibs = recurseIntoAttrs (callPackage ../development/interpreters/ruby/libs.nix { });