From d380c264c373edcf7c6d5ac2eb5eac4271e8ffda Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Mon, 25 Feb 2013 06:16:32 -0500 Subject: [PATCH] Add ruby-2.0.0-p0 --- .../interpreters/ruby/ruby-2.0.nix | 57 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 1 + 2 files changed, 58 insertions(+) create mode 100644 pkgs/development/interpreters/ruby/ruby-2.0.nix diff --git a/pkgs/development/interpreters/ruby/ruby-2.0.nix b/pkgs/development/interpreters/ruby/ruby-2.0.nix new file mode 100644 index 00000000000..7c47bac0bbb --- /dev/null +++ b/pkgs/development/interpreters/ruby/ruby-2.0.nix @@ -0,0 +1,57 @@ +{ 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/2.0/${name}.tar.bz2"; + sha256 = "0pr9jf01cfap93xcngyd5zpns67ffjsgaxkm0qr1r464rj9d7066"; + }; + + # 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); + + enableParallelBuilding = true; + + configureFlags = ["--enable-shared" ]; + + 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 = "2.0"; + minorVersion = "0"; + patchLevel = "0"; + libPath = "lib/ruby/${majorVersion}"; + gemPath = "lib/ruby/gems/${majorVersion}"; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e721388ecde..4d2ff8589f4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2905,6 +2905,7 @@ let ruby18 = callPackage ../development/interpreters/ruby/ruby-18.nix { }; ruby19 = callPackage ../development/interpreters/ruby/ruby-19.nix { }; + ruby2 = lowPrio (callPackage ../development/interpreters/ruby/ruby-2.0.nix { }); ruby = ruby19;