[Nix-dev] Making ruby19 build.

David Brown nix at davidb.org
Fri May 14 18:04:20 CEST 2010


r18483 disabled ruby19 because of incorrect use of makeOverridable.
It's just a copy of the ruby 1.8 (default.nix) expression, with the
version changed.

I'm not sure what the proper way to do this, but the patch below at
least allows ruby19 to be built.  Do we want to break Ruby out into
separate directories, or just generalize this again?

The second patch, below that, updates the ruby19 version to the latest
version.

David

 From 97d175a5d4f0cc62ffc28a4168eb4d53bd9fd0e7 Mon Sep 17 00:00:00 2001
From: David Brown <nix at davidb.org>
Date: Fri, 14 May 2010 08:28:11 -0700
Subject: [PATCH 1/2] Fix ruby19 to not use overrides

---
  pkgs/development/interpreters/ruby/ruby-19.nix |   26 ++++++++++++++++++++++-
  pkgs/top-level/all-packages.nix                |    4 ++-
  2 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/pkgs/development/interpreters/ruby/ruby-19.nix b/pkgs/development/interpreters/ruby/ruby-19.nix
index 82393fe..ab65cc1 100644
--- a/pkgs/development/interpreters/ruby/ruby-19.nix
+++ b/pkgs/development/interpreters/ruby/ruby-19.nix
@@ -1,14 +1,36 @@
-{ ruby18, fetchurl }:
+{ stdenv, fetchurl, ncurses, readline
+, zlib ? null
+, openssl ? null
+, gdbm ? null
+}:
  
-ruby18.override rec {
+stdenv.mkDerivation rec {
    version = "1.9.1-p243";
+
    name = "ruby-${version}";
+
    src = fetchurl {
      url = "ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-${version}.tar.gz";
      sha256 = "1r4bls76dg97lqgwkxi6kbxzirkvjm21d4i2qyz469lnncvqwn9i";
    };
  
+  buildInputs = [ncurses readline]
+    ++ (stdenv.lib.optional (zlib != null) zlib)
+    ++ (stdenv.lib.optional (openssl != null) openssl)
+    ++ (stdenv.lib.optional (gdbm != null) gdbm);
+
+  configureFlags = ["--enable-shared" "--enable-pthread"];
+
+  # NIX_LDFLAGS = "-lpthread -lutil";
+
+  meta = {
+    license = "Ruby";
+    homepage = "http://www.ruby-lang.org/en/";
+    description = "The Ruby language";
+  };
+
    passthru = {
+    # install ruby libs into "$out/${ruby.libPath}"
      libPath = "lib/ruby-1.9";
    };
  }
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 95f086c..17a3a14 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -2832,7 +2832,9 @@ let
    ruby18 = import ../development/interpreters/ruby {
      inherit fetchurl stdenv readline ncurses zlib openssl gdbm;
    };
-  #ruby19 = import ../development/interpreters/ruby/ruby-19.nix { inherit ruby18 fetchurl; };
+  ruby19 = lowPrio (import ../development/interpreters/ruby/ruby-19.nix {
+    inherit fetchurl stdenv readline ncurses zlib openssl gdbm;
+  });
    ruby = ruby18;
  
    rubyLibs = recurseIntoAttrs (import ../development/interpreters/ruby/libs.nix {
-- 
1.7.1

 From 6322c3931ae5c123f21c5f112fe6196c23cb2c2c Mon Sep 17 00:00:00 2001
From: David Brown <nix at davidb.org>
Date: Fri, 14 May 2010 08:57:32 -0700
Subject: [PATCH 2/2] Update ruby19 to 1.9.1-p376

---
  pkgs/development/interpreters/ruby/ruby-19.nix |    4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pkgs/development/interpreters/ruby/ruby-19.nix b/pkgs/development/interpreters/ruby/ruby-19.nix
index ab65cc1..b52add6 100644
--- a/pkgs/development/interpreters/ruby/ruby-19.nix
+++ b/pkgs/development/interpreters/ruby/ruby-19.nix
@@ -5,13 +5,13 @@
  }:
  
  stdenv.mkDerivation rec {
-  version = "1.9.1-p243";
+  version = "1.9.1-p376";
  
    name = "ruby-${version}";
  
    src = fetchurl {
      url = "ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-${version}.tar.gz";
-    sha256 = "1r4bls76dg97lqgwkxi6kbxzirkvjm21d4i2qyz469lnncvqwn9i";
+    sha256 = "1ji1kd03bf2p7ckp8011pifcidsmmzydz5g1bcywygr88lbgrf2q";
    };
  
    buildInputs = [ncurses readline]
-- 
1.7.1




More information about the nix-dev mailing list