summary refs log tree commit diff
path: root/pkgs/development/interpreters/ruby/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/interpreters/ruby/default.nix')
-rw-r--r--pkgs/development/interpreters/ruby/default.nix18
1 files changed, 13 insertions, 5 deletions
diff --git a/pkgs/development/interpreters/ruby/default.nix b/pkgs/development/interpreters/ruby/default.nix
index 12f4759f85d8..fcd57205dcfe 100644
--- a/pkgs/development/interpreters/ruby/default.nix
+++ b/pkgs/development/interpreters/ruby/default.nix
@@ -12,15 +12,18 @@ let
 in
 
 stdenv.mkDerivation rec {
-  version = "1.8.7-p302";
+  version = with passthru; "${majorVersion}.${minorVersion}-p${patchLevel}";
   
   name = "ruby-${version}";
   
   src = fetchurl {
     url = "ftp://ftp.ruby-lang.org/pub/ruby/1.8/${name}.tar.gz";
-    sha256 = "18a4w0n1n0sij7gkb3196dnqav5zr0c5p26f08k7cw6y0i9dz0sq";
+    sha256 = "0qf50wa1ziziagnxarj8z6yrsivrhchq1j9017ff3z2z7d31l9kc";
   };
 
+  # 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)
@@ -30,6 +33,8 @@ stdenv.mkDerivation rec {
   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";
@@ -37,8 +42,11 @@ stdenv.mkDerivation rec {
     description = "The Ruby language";
   };
 
-  passthru = {
-    # install ruby libs into "$out/${ruby.libPath}"
-    libPath = "lib/ruby-1.8";
+  passthru = rec {
+    majorVersion = "1.8";
+    minorVersion = "7";
+    patchLevel = "330";
+    libPath = "lib/ruby/${majorVersion}";
+    gemPath = "lib/ruby/gems/${majorVersion}";
   };
 }