Author: urkud
Date: Fri Jan 21 08:24:52 2011
New Revision: 25654
URL: https://svn.nixos.org/websvn/nix/?rev=25654&sc=1

Log:
Rework ruby gems

Added:
   nixpkgs/trunk/pkgs/development/interpreters/ruby/gem_hook.patch
   nixpkgs/trunk/pkgs/development/interpreters/ruby/gems-generated.nix
   nixpkgs/trunk/pkgs/development/interpreters/ruby/rubygems.nix
      - copied, changed from r25653, 
nixpkgs/trunk/pkgs/development/interpreters/ruby/gems.nix
Deleted:
   nixpkgs/trunk/pkgs/development/interpreters/ruby/gem_nix_command.patch
   nixpkgs/trunk/pkgs/development/interpreters/ruby/gems.nix
Modified:
   nixpkgs/trunk/pkgs/development/interpreters/ruby/libs.nix
   nixpkgs/trunk/pkgs/top-level/all-packages.nix

Added: nixpkgs/trunk/pkgs/development/interpreters/ruby/gem_hook.patch
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ nixpkgs/trunk/pkgs/development/interpreters/ruby/gem_hook.patch     Fri Jan 
21 08:24:52 2011        (r25654)
@@ -0,0 +1,18 @@
+diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb
+index d1ef3cb..bf15652 100755
+--- a/lib/rubygems/installer.rb
++++ b/lib/rubygems/installer.rb
+@@ -545,6 +545,13 @@ Results logged to #{File.join(Dir.pwd, 'gem_make.out')}
+ 
+       say path if Gem.configuration.really_verbose
+     end
++
++    if !ENV['NIX_POST_EXTRACT_FILES_HOOK'].nil?
++      print "\nrunning NIX_POST_EXTRACT_FILES_HOOK 
#{ENV['NIX_POST_EXTRACT_FILES_HOOK']} #{@gem_dir}\n"
++      print `#{ENV['NIX_POST_EXTRACT_FILES_HOOK']} #{@gem_dir}`
++      print "\nrunning NIX_POST_EXTRACT_FILES_HOOK done\n"
++    end
++
+   end
+ 
+   ##

Added: nixpkgs/trunk/pkgs/development/interpreters/ruby/gems-generated.nix
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ nixpkgs/trunk/pkgs/development/interpreters/ruby/gems-generated.nix Fri Jan 
21 08:24:52 2011        (r25654)
@@ -0,0 +1,34 @@
+# WARNING: automatically generated file
+# Generated by 'gem nix' command that comes from 'nix' gem
+g: # Get dependencies from patched gems
+{
+  aliases = {
+    nix = g.nix_0_1;
+    rake = g.rake_0_8_7;
+  };
+  gem_nix_args = [ ''nix'' ''rake'' ];
+  gems = {
+    nix_0_1 = {
+      basename = ''nix'';
+      meta = {
+        description = ''Nix package manager interface'';
+        homepage = ''http://gitorious.org/ruby-nix'';
+        longDescription = ''Adds 'gem nix' command that dumps given set of 
gems to format suitable for Nix package manager'';
+      };
+      name = ''nix-0.1'';
+      requiredGems = [  ];
+      sha256 = ''16lc3yfjcsm1s5jjfazlwia1vhy6x401f0mam79r2qkcic70xnap'';
+    };
+    rake_0_8_7 = {
+      basename = ''rake'';
+      meta = {
+        description = ''Ruby based make-like utility.'';
+        homepage = ''http://rake.rubyforge.org'';
+        longDescription = ''Rake is a Make-like program implemented in Ruby. 
Tasks and dependencies are specified in standard Ruby syntax.'';
+      };
+      name = ''rake-0.8.7'';
+      requiredGems = [  ];
+      sha256 = ''03z1zm7xwl2r9v945ambwbd9sn2smbi34xldmac7qjcmsvd7pcqh'';
+    };
+  };
+}

Modified: nixpkgs/trunk/pkgs/development/interpreters/ruby/libs.nix
==============================================================================
--- nixpkgs/trunk/pkgs/development/interpreters/ruby/libs.nix   Fri Jan 21 
08:24:46 2011        (r25653)
+++ nixpkgs/trunk/pkgs/development/interpreters/ruby/libs.nix   Fri Jan 21 
08:24:52 2011        (r25654)
@@ -12,1149 +12,110 @@
   to your .bashrc
 */
 
-{pkgs, stdenv}:
-let libs =
-  let 
-    inherit (pkgs) fetchurl sourceFromHead writeScript makeWrapper;
-    ruby = pkgs.ruby; # select ruby version here
-    rubygems = pkgs.rubygemsFun ruby; # for bootstrapping
-    inherit (pkgs.lib) mergeAttrsByFuncDefaults optional;
-    inherit (builtins) hasAttr getAttr;
+{stdenv, fetchurl, writeScript, makeWrapper, rubygems, ruby,
+ncurses, xapianBindings, sqlite, libxml2, libxslt, libffi, zlib, libuuid}:
 
-    patchUsrBinEnv = writeScript "path-usr-bin-env" ''
-      #!/bin/sh
-      set -x
-      echo "==================="
-      find "$1" -type f -name "*.rb" | xargs sed -i "s@/usr/bin/env@$(type -p 
env)@g"
-      find "$1" -type f -name "*.mk" | xargs sed -i "s@/usr/bin/env@$(type -p 
env)@g"
-    '';
-
-    # these settings are merged into the automatically generated settings
-    # either the nameNoVersion or name must match
-    patches = {
-      sup = {
-        buildInputs = [ pkgs.ncurses pkgs.xapianBindings libs.ncursesw ];
-      };
-      sqlite3_ruby = { propagatedBuildInputs = [ pkgs.sqlite ]; };
-      rails = {
-        gemFlags = "--no-ri --no-rdoc";
-        propagatedBuildInputs = [ libs.mime_types libs.rake ];
-      };
-      ncurses = { buildInputs = [ pkgs.ncurses ]; };
-      ncursesw = { buildInputs = [ pkgs.ncurses ]; };
-      nokogiri = {
-        buildFlags=["--with-xml2-dir=${pkgs.libxml2} 
--with-xml2-include=${pkgs.libxml2}/include/libxml2"
-                    "--with-xslt-dir=${pkgs.libxslt}" ];
-      };
-
-      ffi = {
-        postUnpack = "onetuh";
-        propagatedBuildInputs = [ libs.rake ];
-        buildFlags=["--with-ffi-dir=${pkgs.libffi}"];
-        NIX_POST_EXTRACT_FILES_HOOK = patchUsrBinEnv;
-      };
-
-      xrefresh_server =
-      let patch = fetchurl {
-          url = "http://mawercer.de/~nix/xrefresh.diff.gz";;
-          sha256 = "1f7bnmn1pgkmkml0ms15m5lx880hq2sxy7vsddb3sbzm7n1yyicq";
-        };
-      in {
-        propagatedBuildInputs = [ libs.rb_inotify ];
-
-        # monitor implementation for Linux
-        postInstall = ''
-          cd $out/gems/*;
-          cat ${patch} | gunzip | patch -p 1;
-        '';
-      };
-
-      xapian_full = {
-        buildInputs = [ libs.rake pkgs.zlib pkgs.libuuid ];
-      };
+let
+  gemsGenerated = (import ./gems-generated.nix) gemsWithVersions;
+  patchUsrBinEnv = writeScript "path-usr-bin-env" ''
+    #!/bin/sh
+    set -x
+    echo "==================="
+    find "$1" -type f -name "*.rb" | xargs sed -i "s@/usr/bin/env@$(type -p 
env)@g"
+    find "$1" -type f -name "*.mk" | xargs sed -i "s@/usr/bin/env@$(type -p 
env)@g"
+  '';
+  patches = {
+    sup = {
+      buildInputs = [ ncurses xapianBindings gems.ncursesw ];
+    };
+    sqlite3_ruby = { propagatedBuildInputs = [ sqlite ]; };
+    rails = {
+      gemFlags = "--no-ri --no-rdoc";
+      propagatedBuildInputs = [ gems.mime_types gems.rake ];
+    };
+    ncurses = { buildInputs = [ ncurses ]; };
+    ncursesw = { buildInputs = [ ncurses ]; };
+    nokogiri = {
+      buildFlags=["--with-xml2-dir=${libxml2} 
--with-xml2-include=${libxml2}/include/libxml2"
+                  "--with-xslt-dir=${libxslt}" ];
     };
 
-    rubyDerivation = args :
-      let completeArgs = (mergeAttrsByFuncDefaults 
-          ([{
-            buildInputs = [rubygems ruby pkgs.makeWrapper];
-            unpackPhase = ":";
-            configurePhase=":";
-            bulidPhase=":";
-
-            # TODO add some abstraction for this kind of env path 
concatenation. It's used multiple times
-            installPhase = ''
-              ensureDir "$out/nix-support"
-              export HOME=$TMP/home; mkdir "$HOME"
-
-              gem install -V --ignore-dependencies -i "$out" "$src" $gemFlags 
-- $buildFlags
-              rm -fr $out/cache # don't keep the .gem file here
-
-              THIS_RUBY_LIB=$(echo $out/gems/*/lib)
-              THIS_GEM_PATH=$out
-
-              cat >> $out/nix-support/setup-hook << EOF 
-                declare -A RUBYLIB_HASH # using bash4 hashs
-                declare -A GEM_PATH_HASH # using bash4 hashs
-
-                if [ -n "$THIS_RUBY_LIB" ]; then
-                  RUBYLIB_HASH["$THIS_RUBY_LIB"]=
-                fi
-                for path in \''${!RUBYLIB_HASH[@]}; do
-                  export RUBYLIB=\''${RUBYLIB}\''${RUBYLIB:+:}\$path
-                done
-                GEM_PATH_HASH["$THIS_GEM_PATH"]=
-                for path in \''${!GEM_PATH_HASH[@]}; do
-                  export GEM_PATH=\''${GEM_PATH}\''${GEM_PATH:+:}\$path
-                done
-              EOF
-              . $out/nix-support/setup-hook
-
-              for prog in $out/bin/*; do
-                wrapProgram "$prog" \
-                  --prefix RUBYLIB : "$RUBYLIB":${rubygems}/lib \
-                  --prefix GEM_PATH : "$GEM_PATH" \
-                  --set RUBYOPT 'rubygems'
-              done
-
-              for prog in $out/gems/*/bin/*; do
-                [ -e "$out/bin/$(basename $prog)" ] && continue || true
-                sed -i '1s@.*@#!  ${ruby}/bin/ruby@' "$prog"
-                t="$out/bin/$(basename "$prog")"
-                cat >> "$t" << EOF
-              #!/bin/sh
-              export GEM_PATH=$GEM_PATH:\$GEM_PATH
-              #export RUBYLIB=$RUBYLIB:\$RUBYLIB
-              exec $(type -p ruby) $prog "\$@"
-              EOF
-                chmod +x "$t"
-              done
-
-              runHook postInstall
-            '';
-
-
-          } args ]
-            ++ optional (hasAttr args.name patches) (getAttr args.name patches)
-            ++ optional (hasAttr args.nameNoVersion patches) (getAttr 
args.nameNoVersion patches)
-          )); in stdenv.mkDerivation (removeAttrs completeArgs 
["mergeAttrBy"]);
-  in
-  rec {
-
-  # ================ START automatically generated code ================
-
-         # WARNING: automatically generated CODE
-         # This section has been generated by gem nix sup chronic 
rubygems-update xrefresh-server rb-inotify jeweler ncursesw sqlite3-ruby rails 
haml bundler rake rails3-generators enumerated_attribute haml-rails jquery-rails
-         # the gem nix command has been added by a nix patch to ruby gems
-      
-  rails3_generators_0_13_0 = rubyDerivation {
-     name = "ruby-rails3-generators-0.13.0"; # full_name
-     nameNoVersion = "rails3_generators";
-     propagatedBuildInputs = [  ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/rails3-generators-0.13.0.gem";;
-       sha256 = "0g7qylily8dkllyy201kgyczm303dmg5r64zy49isccq63iq6k3c";
-     };
-     meta = {
-       homepage = "http://github.com/indirect/rails3-generators";;
-       license = []; # one of ?
-       description = ''Rails 3 compatible generators for DataMapper, 
Factory-girl, Authlogic, Mongomapper, Mongoid, Shoulda, Formtastic and Simp''; 
# cut to 120 chars
-       longDescription = ''Rails 3 compatible generators for DataMapper, 
Factory-girl, Authlogic, Mongomapper, Mongoid, Shoulda, Formtastic and 
SimpleForm'';
-     };
-  };
-
-  builder_2_1_2 = rubyDerivation {
-     name = "ruby-builder-2.1.2"; # full_name
-     nameNoVersion = "builder";
-     propagatedBuildInputs = [  ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/builder-2.1.2.gem";;
-       sha256 = "0hp5gsvp63mqqvi7dl95zwci916vj6l1slgz4crip1rijk3v2806";
-     };
-     meta = {
-       homepage = "http://onestepback.org";;
-       license = []; # one of ?
-       description = ''Builder provides a number of builder objects that make 
creating structured data simple to do[...]'';
-       longDescription = ''Builder provides a number of builder objects that 
make creating structured data simple to do.  Currently the following builder 
objects are supported:  * XML Markup * XML Events'';
-     };
-  };
-
-  rake_0_8_7 = rubyDerivation {
-     name = "ruby-rake-0.8.7"; # full_name
-     nameNoVersion = "rake";
-     propagatedBuildInputs = [  ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/rake-0.8.7.gem";;
-       sha256 = "03z1zm7xwl2r9v945ambwbd9sn2smbi34xldmac7qjcmsvd7pcqh";
-     };
-     meta = {
-       homepage = "http://rake.rubyforge.org";;
-       license = []; # one of ?
-       description = ''Rake is a Make-like program implemented in Ruby[...]'';
-       longDescription = ''Rake is a Make-like program implemented in Ruby. 
Tasks and dependencies are specified in standard Ruby syntax.'';
-     };
-  };
-
-  haml_rails_0_2 = rubyDerivation {
-     name = "ruby-haml-rails-0.2"; # full_name
-     nameNoVersion = "haml_rails";
-     propagatedBuildInputs = [   ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/haml-rails-0.2.gem";;
-       sha256 = "132lfx6vqiphbbhxfzss5qny92yzfbpyj0qk7dn3q5y7irvp5wha";
-     };
-     meta = {
-       homepage = "http://github.com/indirect/haml-rails";;
-       license = []; # one of ?
-       description = ''Haml-rails provides Haml generators for Rails 3[...]'';
-       longDescription = ''Haml-rails provides Haml generators for Rails 3. It 
also enables Haml as the templating engine for you, so you don't have to screw 
around in your own application.rb when your Gemfile already clearly indicated 
what templating engine you have installed. Hurrah.'';
-     };
-  };
-
-  meta_programming_0_2_2 = rubyDerivation {
-     name = "ruby-meta_programming-0.2.2"; # full_name
-     nameNoVersion = "meta_programming";
-     propagatedBuildInputs = [  ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/meta_programming-0.2.2.gem";;
-       sha256 = "0k32z7ndfpravrz3hihg96x3wcdfrzsdj2pg48zkcb3gb428f2av";
-     };
-     meta = {
-       homepage = "http://github.com/jeffp/meta_programming/tree/master";;
-       license = []; # one of ?
-       description = ''Collection of meta-programming methods for Ruby[...]'';
-       longDescription = ''Collection of meta-programming methods for Ruby'';
-     };
-  };
-
-  haml_3_0_18 = rubyDerivation {
-     name = "ruby-haml-3.0.18"; # full_name
-     nameNoVersion = "haml";
-     propagatedBuildInputs = [  ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/haml-3.0.18.gem";;
-       sha256 = "1bi951vk6fkxcc4dakwmcgbqf72zhr5bna9p8a4q4ajn3arvnq7y";
-     };
-     meta = {
-       homepage = "http://haml-lang.com/";;
-       license = []; # one of ?
-       description = ''      Haml (HTML Abstraction Markup Language) is a 
layer on top of XHTML or XML       that's designed to express the stru''; # cut 
to 120 chars
-       longDescription = ''      Haml (HTML Abstraction Markup Language) is a 
layer on top of XHTML or XML
-      that's designed to express the structure of XHTML or XML documents
-      in a non-repetitive, elegant, easy way,
-      using indentation rather than closing tags
-      and allowing Ruby to be embedded with ease.
-      It was originally envisioned as a plugin for Ruby on Rails,
-      but it can function as a stand-alone templating engine.
-'';
-     };
-  };
-
-  polyglot_0_3_1 = rubyDerivation {
-     name = "ruby-polyglot-0.3.1"; # full_name
-     nameNoVersion = "polyglot";
-     propagatedBuildInputs = [  ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/polyglot-0.3.1.gem";;
-       sha256 = "1shk5hqnz7hg14y2ms16mcwd2p546wq57pci5m26qg64m28gz4xg";
-     };
-     meta = {
-       homepage = "http://polyglot.rubyforge.org";;
-       license = []; # one of ?
-       description = ''Allows custom language loaders for specified file 
extensions to be hooked into require[...]'';
-       longDescription = ''Allows custom language loaders for specified file 
extensions to be hooked into require'';
-     };
-  };
-
-  arel_1_0_1 = rubyDerivation {
-     name = "ruby-arel-1.0.1"; # full_name
-     nameNoVersion = "arel";
-     propagatedBuildInputs = [  ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/arel-1.0.1.gem";;
-       sha256 = "117j8z0clq8001jqk4aajq3whxzn5fan4ivdsbjvcdba2wfhd7z0";
-     };
-     meta = {
-       homepage = "http://github.com/brynary/arel";;
-       license = []; # one of ?
-       description = ''Arel is a Relational Algebra for Ruby of SQL queries 
and it 2) adapts to various RDBMS systems. It is intended to be a fr''; # cut 
to 120 chars
-       longDescription = ''Arel is a Relational Algebra for Ruby. It 1) 
simplifies the generation complex
-of SQL queries and it 2) adapts to various RDBMS systems. It is intended to be
-a framework framework; that is, you can build your own ORM with it, focusing on
-innovative object and collection modeling as opposed to database compatibility
-and query generation.'';
-     };
-  };
-
-  abstract_1_0_0 = rubyDerivation {
-     name = "ruby-abstract-1.0.0"; # full_name
-     nameNoVersion = "abstract";
-     propagatedBuildInputs = [  ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/abstract-1.0.0.gem";;
-       sha256 = "1gizb9kzwf3c6xip7fwa818b98c72x4jlhbm808s5pwdjbqw3h9k";
-     };
-     meta = {
-       homepage = "http://rubyforge.org/projects/abstract";;
-       license = []; # one of ?
-       description = '''abstract[...]'';
-       longDescription = '''abstract.rb' is a library which enable you to 
define abstract method in Ruby.'';
-     };
-  };
-
-  sqlite3_ruby_1_3_1 = rubyDerivation {
-     name = "ruby-sqlite3-ruby-1.3.1"; # full_name
-     nameNoVersion = "sqlite3_ruby";
-     propagatedBuildInputs = [  ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/sqlite3-ruby-1.3.1.gem";;
-       sha256 = "17ci8jgnzda091my53x0qnapy673fx55fd1agf5xdkylzwb00v9q";
-     };
-     meta = {
-       homepage = "http://github.com/luislavena/sqlite3-ruby";;
-       license = []; # one of ?
-       description = ''This module allows Ruby programs to interface with the 
SQLite3 database engine (http://www SQLite engine installed in ord''; # cut to 
120 chars
-       longDescription = ''This module allows Ruby programs to interface with 
the SQLite3
-database engine (http://www.sqlite.org).  You must have the
-SQLite engine installed in order to build this module.
-
-Note that this module is NOT compatible with SQLite 2.x.'';
-     };
-  };
-
-  git_1_2_5 = rubyDerivation {
-     name = "ruby-git-1.2.5"; # full_name
-     nameNoVersion = "git";
-     propagatedBuildInputs = [  ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/git-1.2.5.gem";;
-       sha256 = "19dy8sakv4x7pnvjddqjyd4j74cji14wikhz95iaqqrc9n4z43hk";
-     };
-     meta = {
-       homepage = "http://github.com/schacon/ruby-git";;
-       license = []; # one of ?
-       description = ''[...]'';
-       longDescription = '''';
-     };
-  };
-
-  rails_3_0_0 = rubyDerivation {
-     name = "ruby-rails-3.0.0"; # full_name
-     nameNoVersion = "rails";
-     propagatedBuildInputs = [ activesupport_3_0_0 actionpack_3_0_0 
activerecord_3_0_0 activeresource_3_0_0 actionmailer_3_0_0 railties_3_0_0 
bundler_1_0_0 ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/rails-3.0.0.gem";;
-       sha256 = "1zjyijz5814vv1l5j4si66fcvf17jkfh6336mr4xh9vx0wa2r6js";
-     };
-     meta = {
-       homepage = "http://www.rubyonrails.org";;
-       license = []; # one of ?
-       description = ''Ruby on Rails is a full-stack web framework optimized 
for programmer happiness and sustainable productivity[...]'';
-       longDescription = ''Ruby on Rails is a full-stack web framework 
optimized for programmer happiness and sustainable productivity. It encourages 
beautiful code by favoring convention over configuration.'';
-     };
-  };
-
-  treetop_1_4_8 = rubyDerivation {
-     name = "ruby-treetop-1.4.8"; # full_name
-     nameNoVersion = "treetop";
-     propagatedBuildInputs = [ polyglot_0_3_1 ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/treetop-1.4.8.gem";;
-       sha256 = "10cg8dp4ljm6gfsdx9x20kk5c2vrmw5y25dfsy7s0pxn60f3s6qg";
-     };
-     meta = {
-       homepage = "http://functionalform.blogspot.com";;
-       license = []; # one of ?
-       description = ''[...]'';
-       longDescription = '''';
-     };
-  };
-
-  rack_test_0_5_4 = rubyDerivation {
-     name = "ruby-rack-test-0.5.4"; # full_name
-     nameNoVersion = "rack_test";
-     propagatedBuildInputs = [  ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/rack-test-0.5.4.gem";;
-       sha256 = "0afkvjq45v61j2y3k9dfi4r6fnj26b4ky1ggn7sdk5asq7v6dmzx";
-     };
-     meta = {
-       homepage = "http://github.com/brynary/rack-test";;
-       license = []; # one of ?
-       description = ''Rack::Test is a small, simple testing API for Rack apps 
own or as a reusable starting point for Web frameworks and testin''; # cut to 
120 chars
-       longDescription = ''Rack::Test is a small, simple testing API for Rack 
apps. It can be used on its
-own or as a reusable starting point for Web frameworks and testing libraries
-to build on. Most of its initial functionality is an extraction of Merb 1.0's
-request helpers feature.'';
-     };
-  };
-
-  chronic_0_2_3 = rubyDerivation {
-     name = "ruby-chronic-0.2.3"; # full_name
-     nameNoVersion = "chronic";
-     propagatedBuildInputs = [  ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/chronic-0.2.3.gem";;
-       sha256 = "0gm4i9iwpvsk07nzvy8fmyad4y7i284vvdrxrlbgb23lr17qpl17";
-     };
-     meta = {
-       homepage = "    http://chronic.rubyforge.org/";;
-       license = []; # one of ?
-       description = ''Chronic is a natural language date/time parser written 
in pure Ruby[...]'';
-       longDescription = ''Chronic is a natural language date/time parser 
written in pure Ruby. See below for the wide variety of formats Chronic will 
parse.'';
-     };
-  };
-
-  ncurses_0_9_1 = rubyDerivation {
-     name = "ruby-ncurses-0.9.1"; # full_name
-     nameNoVersion = "ncurses";
-     propagatedBuildInputs = [  ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/ncurses-0.9.1.gem";;
-       sha256 = "0j9k3rfxglkivwnpdkbfk4acfnivfisyj8f0msf3zkid4hnj4r2h";
-     };
-     meta = {
-       homepage = "http://ncurses-ruby.berlios.de/";;
-       license = []; # one of ?
-       description = ''[...]'';
-       longDescription = '''';
-     };
-  };
-
-  xapian_full_1_1_3_4 = rubyDerivation {
-     name = "ruby-xapian-full-1.1.3.4"; # full_name
-     nameNoVersion = "xapian_full";
-     propagatedBuildInputs = [  ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/xapian-full-1.1.3.4.gem";;
-       sha256 = "0yc08y7v5yh0lfidc0rkr072q88jvp5prv7pllv4qn4wryna8mwl";
-     };
-     meta = {
-       homepage = "";
-       license = []; # one of ?
-       description = ''Xapian bindings for Ruby without dependency on system 
Xapian library[...]'';
-       longDescription = ''Xapian bindings for Ruby without dependency on 
system Xapian library'';
-     };
-  };
-
-  i18n_0_4_1 = rubyDerivation {
-     name = "ruby-i18n-0.4.1"; # full_name
-     nameNoVersion = "i18n";
-     propagatedBuildInputs = [  ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/i18n-0.4.1.gem";;
-       sha256 = "0haw8102610j2vydr52y64w2dqav6amda0ddwy6vp09rr6prazkq";
-     };
-     meta = {
-       homepage = "http://github.com/svenfuchs/i18n";;
-       license = []; # one of ?
-       description = ''New wave Internationalization support for Ruby[...]'';
-       longDescription = ''New wave Internationalization support for Ruby.'';
-     };
-  };
-
-  ncursesw_1_2_4_1 = rubyDerivation {
-     name = "ruby-ncursesw-1.2.4.1"; # full_name
-     nameNoVersion = "ncursesw";
-     propagatedBuildInputs = [  ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/ncursesw-1.2.4.1.gem";;
-       sha256 = "0cn13h14pk8yds8aklpdcpzl0z6rqifpmaz4lw29g10lgwvfv409";
-     };
-     meta = {
-       homepage = "http://ncurses-ruby.berlios.de/";;
-       license = []; # one of ?
-       description = ''Hacked up version of ncurses gem that supports wide 
characters and ruby1[...]'';
-       longDescription = ''Hacked up version of ncurses gem that supports wide 
characters and ruby1.9.1. Original ncurses gem by [email protected].'';
-     };
-  };
-
-  ffi_0_6_3 = rubyDerivation {
-     name = "ruby-ffi-0.6.3"; # full_name
-     nameNoVersion = "ffi";
-     propagatedBuildInputs = [ rake_0_8_7 ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/ffi-0.6.3.gem";;
-       sha256 = "08qnxqcnjq4i2vv1jfwdxdlsphqjrrh7r0cw8x2q0x9vjd27ncbb";
-     };
-     meta = {
-       homepage = "http://wiki.github.com/ffi/ffi";;
-       license = []; # one of ?
-       description = ''Ruby-FFI is a ruby extension for programmatically 
loading dynamic libraries, binding functions within them, and calling t''; # 
cut to 120 chars
-       longDescription = ''Ruby-FFI is a ruby extension for programmatically 
loading dynamic
-libraries, binding functions within them, and calling those functions
-from Ruby code. Moreover, a Ruby-FFI extension works without changes
-on Ruby and JRuby. Discover why should you write your next extension
-using Ruby-FFI here[http://wiki.github.com/ffi/ffi/why-use-ffi].'';
-     };
-  };
-
-  term_ansicolor_1_0_5 = rubyDerivation {
-     name = "ruby-term-ansicolor-1.0.5"; # full_name
-     nameNoVersion = "term_ansicolor";
-     propagatedBuildInputs = [  ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/term-ansicolor-1.0.5.gem";;
-       sha256 = "1xhcc4dkfylj14w413pmd8jhc04wj3nlw0xa6qy9h0fnbbyh6bc1";
-     };
-     meta = {
-       homepage = "http://flori.github.com/term-ansicolor";;
-       license = []; # one of ?
-       description = ''[...]'';
-       longDescription = '''';
-     };
-  };
-
-  rubygems_update_1_3_7 = rubyDerivation {
-     name = "ruby-rubygems-update-1.3.7"; # full_name
-     nameNoVersion = "rubygems_update";
-     propagatedBuildInputs = [  ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/rubygems-update-1.3.7.gem";;
-       sha256 = "0378s1nvxmmwrl8l7yx9xglm5ks1lsdjr0ms3wx127q5hm07szdg";
-     };
-     meta = {
-       homepage = "http://rubygems.org/";;
-       license = []; # one of ?
-       description = ''RubyGems is a package management framework for Ruby  
This gem is an update for the RubyGems software. You must have an in''; # cut 
to 120 chars
-       longDescription = ''RubyGems is a package management framework for Ruby.
-
-This gem is an update for the RubyGems software. You must have an
-installation of RubyGems before this update can be applied.
-
-See Gem for information on RubyGems (or `ri Gem`)
-
-To upgrade to the latest RubyGems, run:
-
-  $ gem update --system  # you might need to be an administrator or root
-
-NOTE:  RubyGems 1.1 and 1.2 have problems upgrading when there is no
-rubygems-update installed.  You will need to use the following instructions
-if you see "Nothing to update".
-
-If you have an older version of RubyGems installed, then you can still
-do it in two steps:
-
-  $ gem install rubygems-update  # again, might need to be admin/root
-  $ update_rubygems              # ... here too
-
-If you don't have any RubyGems install, there is still the pre-gem approach to
-getting software, doing it manually:
-
-1. Download from: http://rubyforge.org/frs/?group_id=126
-2. Unpack into a directory and cd there
-3. Install with: ruby setup.rb  # you may need admin/root privilege
-
-For more details and other options, see:
-
-  ruby setup.rb --help'';
-     };
-  };
-
-  trollop_1_16_2 = rubyDerivation {
-     name = "ruby-trollop-1.16.2"; # full_name
-     nameNoVersion = "trollop";
-     propagatedBuildInputs = [  ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/trollop-1.16.2.gem";;
-       sha256 = "0frrp90dw266h3kf9g925dppir9l7p8jxknw6dn5nz6fa6c4g5lg";
-     };
-     meta = {
-       homepage = "http://trollop.rubyforge.org";;
-       license = []; # one of ?
-       description = ''Trollop is a commandline option parser for Ruby that 
just gets out of your way For that, you get a nice automatically-gen''; # cut 
to 120 chars
-       longDescription = ''Trollop is a commandline option parser for Ruby 
that just
-gets out of your way. One line of code per option is all you need to write.
-For that, you get a nice automatically-generated help page, robust option
-parsing, command subcompletion, and sensible defaults for everything you don't
-specify.'';
-     };
-  };
-
-  enumerated_attribute_0_2_16 = rubyDerivation {
-     name = "ruby-enumerated_attribute-0.2.16"; # full_name
-     nameNoVersion = "enumerated_attribute";
-     propagatedBuildInputs = [ meta_programming_0_2_2 ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/enumerated_attribute-0.2.16.gem";;
-       sha256 = "01m9jmim5dcyayv3pznrm1y152dd4jrp2jj89m18inbn5446dzqi";
-     };
-     meta = {
-       homepage = "http://github.com/jeffp/enumerated_attribute/tree/master";;
-       license = []; # one of ?
-       description = ''Enumerated model attributes and view helpers[...]'';
-       longDescription = ''Enumerated model attributes and view helpers'';
-     };
-  };
-
-  railties_3_0_0 = rubyDerivation {
-     name = "ruby-railties-3.0.0"; # full_name
-     nameNoVersion = "railties";
-     propagatedBuildInputs = [  thor_0_14_0   ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/railties-3.0.0.gem";;
-       sha256 = "0zj216hvs7yjlhjk0066d5rlm1csf2rarxx6c9bpxrmabnw1rb93";
-     };
-     meta = {
-       homepage = "http://www.rubyonrails.org";;
-       license = []; # one of ?
-       description = ''Rails internals: application bootup, plugins, 
generators, and rake tasks[...]'';
-       longDescription = ''Rails internals: application bootup, plugins, 
generators, and rake tasks.'';
-     };
-  };
-
-  rack_mount_0_6_13 = rubyDerivation {
-     name = "ruby-rack-mount-0.6.13"; # full_name
-     nameNoVersion = "rack_mount";
-     propagatedBuildInputs = [  ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/rack-mount-0.6.13.gem";;
-       sha256 = "133dwla6hq6a75m0la7cm26d5hvlsi02vm4lvph73d6kqazry0y6";
-     };
-     meta = {
-       homepage = "http://github.com/josh/rack-mount";;
-       license = []; # one of ?
-       description = ''Stackable dynamic tree based Rack router[...]'';
-       longDescription = ''Stackable dynamic tree based Rack router'';
-     };
-  };
-
-  activemodel_3_0_0 = rubyDerivation {
-     name = "ruby-activemodel-3.0.0"; # full_name
-     nameNoVersion = "activemodel";
-     propagatedBuildInputs = [  builder_2_1_2 i18n_0_4_1 ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/activemodel-3.0.0.gem";;
-       sha256 = "1dp18ifh658pgdkq8fd32yw3hi99wk5in2c7pb3mjyabg4zg5mv6";
-     };
-     meta = {
-       homepage = "http://www.rubyonrails.org";;
-       license = []; # one of ?
-       description = ''A toolkit for building modeling frameworks like Active 
Record and Active Resource[...]'';
-       longDescription = ''A toolkit for building modeling frameworks like 
Active Record and Active Resource. Rich support for attributes, callbacks, 
validations, observers, serialization, internationalization, and testing.'';
-     };
-  };
-
-  gettext_2_1_0 = rubyDerivation {
-     name = "ruby-gettext-2.1.0"; # full_name
-     nameNoVersion = "gettext";
-     propagatedBuildInputs = [ locale_2_0_5 ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/gettext-2.1.0.gem";;
-       sha256 = "17g048gp7gh3c311l5jw2sbanma2havj4yqhaaa50b3rx72y4xwz";
-     };
-     meta = {
-       homepage = "http://gettext.rubyforge.org/";;
-       license = []; # one of ?
-       description = ''        Ruby-GetText-Package is a GNU GetText-like 
program for Ruby         The catalog file(po-file) is same format with''; # cut 
to 120 chars
-       longDescription = ''        Ruby-GetText-Package is a GNU GetText-like 
program for Ruby.
-        The catalog file(po-file) is same format with GNU GetText.
-        So you can use GNU GetText tools for maintaining.
-'';
-     };
-  };
-
-  lockfile_1_4_3 = rubyDerivation {
-     name = "ruby-lockfile-1.4.3"; # full_name
-     nameNoVersion = "lockfile";
-     propagatedBuildInputs = [  ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/lockfile-1.4.3.gem";;
-       sha256 = "0cxbyvxr3s5xsx85yghcs69d4lwwj0pg5la5cz2fp12hkk2szab3";
-     };
-     meta = {
-       homepage = "http://codeforpeople.com/lib/ruby/lockfile/";;
-       license = []; # one of ?
-       description = ''[...]'';
-       longDescription = '''';
-     };
-  };
-
-  thor_0_14_0 = rubyDerivation {
-     name = "ruby-thor-0.14.0"; # full_name
-     nameNoVersion = "thor";
-     propagatedBuildInputs = [  ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/thor-0.14.0.gem";;
-       sha256 = "115zxz418hmmsjk1sc2f19xzd74ap066qb7p1lh539q6zkalzrj1";
-     };
-     meta = {
-       homepage = "http://yehudakatz.com";;
-       license = []; # one of ?
-       description = ''A scripting framework that replaces rake, sake and 
rubigen[...]'';
-       longDescription = ''A scripting framework that replaces rake, sake and 
rubigen'';
-     };
-  };
-
-  activerecord_3_0_0 = rubyDerivation {
-     name = "ruby-activerecord-3.0.0"; # full_name
-     nameNoVersion = "activerecord";
-     propagatedBuildInputs = [   arel_1_0_1  ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/activerecord-3.0.0.gem";;
-       sha256 = "1l2662myqbay37xpssna149rgqjq0fq670f1hpagmh1nr0fziwlr";
-     };
-     meta = {
-       homepage = "http://www.rubyonrails.org";;
-       license = []; # one of ?
-       description = ''Databases on Rails[...]'';
-       longDescription = ''Databases on Rails. Build a persistent domain model 
by mapping database tables to Ruby classes. Strong conventions for 
associations, validations, aggregations, migrations, and testing come 
baked-in.'';
-     };
-  };
-
-  actionpack_3_0_0 = rubyDerivation {
-     name = "ruby-actionpack-3.0.0"; # full_name
-     nameNoVersion = "actionpack";
-     propagatedBuildInputs = [  activemodel_3_0_0   rack_1_2_1 rack_test_0_5_4 
rack_mount_0_6_13 tzinfo_0_3_23 erubis_2_6_6 ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/actionpack-3.0.0.gem";;
-       sha256 = "1qjmx3alkinnfi9mdvzz3cfsfj20kf6iqvhwia167l45wqd14s7z";
-     };
-     meta = {
-       homepage = "http://www.rubyonrails.org";;
-       license = []; # one of ?
-       description = ''Web apps on Rails[...]'';
-       longDescription = ''Web apps on Rails. Simple, battle-tested 
conventions for building and testing MVC web applications. Works with any 
Rack-compatible server.'';
-     };
-  };
-
-  erubis_2_6_6 = rubyDerivation {
-     name = "ruby-erubis-2.6.6"; # full_name
-     nameNoVersion = "erubis";
-     propagatedBuildInputs = [ abstract_1_0_0 ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/erubis-2.6.6.gem";;
-       sha256 = "19yd2a4zb371b8vi11hv4p4s4s9yzp6924frc0ar9hv5kbw3nxvm";
-     };
-     meta = {
-       homepage = "http://www.kuwata-lab.com/erubis/";;
-       license = []; # one of ?
-       description = ''  Erubis is an implementation of eRuby and has the 
following features:    * Very fast, almost three times faster than ERB''; # cut 
to 120 chars
-       longDescription = ''  Erubis is an implementation of eRuby and has the 
following features:
-
-  * Very fast, almost three times faster than ERB and about 10% faster than 
eruby.
-  * Multi-language support (Ruby/PHP/C/Java/Scheme/Perl/Javascript)
-  * Auto escaping support
-  * Auto trimming spaces around '&lt;% %&gt;'
-  * Embedded pattern changeable (default '&lt;% %&gt;')
-  * Enable to handle Processing Instructions (PI) as embedded pattern (ex. 
'&lt;?rb ... ?&gt;')
-  * Context object available and easy to combine eRuby template with YAML 
datafile
-  * Print statement available
-  * Easy to extend and customize in subclass
-  * Ruby on Rails support
-'';
-     };
-  };
-
-  json_pure_1_4_6 = rubyDerivation {
-     name = "ruby-json_pure-1.4.6"; # full_name
-     nameNoVersion = "json_pure";
-     propagatedBuildInputs = [  ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/json_pure-1.4.6.gem";;
-       sha256 = "0cd6a97nk8m7yqm0lxbgs63yxlnk4mhbmpgjjfzdw01n1gm95kfv";
-     };
-     meta = {
-       homepage = "http://flori.github.com/json";;
-       license = []; # one of ?
-       description = ''This is a JSON implementation in pure Ruby[...]'';
-       longDescription = ''This is a JSON implementation in pure Ruby.'';
-     };
-  };
-
-  xrefresh_server_0_3_0 = rubyDerivation {
-     name = "ruby-xrefresh-server-0.3.0"; # full_name
-     nameNoVersion = "xrefresh_server";
-     propagatedBuildInputs = [ json_1_4_6 term_ansicolor_1_0_5 ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/xrefresh-server-0.3.0.gem";;
-       sha256 = "1k80hadnmaxi8q8fw879xaj0ragy4bmqjqm7zjkv9bq8njb3i0c5";
-     };
-     meta = {
-       homepage = "http://github.com/darwin/xrefresh-server";;
-       license = []; # one of ?
-       description = ''XRefresh is browser refresh automation for web 
developers[...]'';
-       longDescription = ''XRefresh is browser refresh automation for web 
developers'';
-     };
-  };
-
-  bundler_1_0_0 = rubyDerivation {
-     name = "ruby-bundler-1.0.0"; # full_name
-     nameNoVersion = "bundler";
-     propagatedBuildInputs = [  ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/bundler-1.0.0.gem";;
-       sha256 = "0x1gsm8gqfa3czndm3v0b8v5sh08wjz1cr7xi383ipmnziimaq30";
-     };
-     meta = {
-       homepage = "http://gembundler.com";;
-       license = []; # one of ?
-       description = ''Bundler manages an application's dependencies through 
its entire life, across many machines, systematically and repeatabl''; # cut to 
120 chars
-       longDescription = ''Bundler manages an application's dependencies 
through its entire life, across many machines, systematically and repeatably'';
-     };
-  };
-
-  actionmailer_3_0_0 = rubyDerivation {
-     name = "ruby-actionmailer-3.0.0"; # full_name
-     nameNoVersion = "actionmailer";
-     propagatedBuildInputs = [  mail_2_2_5 ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/actionmailer-3.0.0.gem";;
-       sha256 = "15a7ikp7b76mlnrd78cprm6p7qj2vf1zj6x8an0zwnpxy95fqn3q";
-     };
-     meta = {
-       homepage = "http://www.rubyonrails.org";;
-       license = []; # one of ?
-       description = ''Email on Rails[...]'';
-       longDescription = ''Email on Rails. Compose, deliver, receive, and test 
emails using the familiar controller/view pattern. First-class support for 
multipart email and attachments.'';
-     };
-  };
-
-  rack_1_2_1 = rubyDerivation {
-     name = "ruby-rack-1.2.1"; # full_name
-     nameNoVersion = "rack";
-     propagatedBuildInputs = [  ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/rack-1.2.1.gem";;
-       sha256 = "0bwsfiprvnwxgwwbr2cwv3aca5d707bfcm2zff4d0nsnbfgll0bj";
-     };
-     meta = {
-       homepage = "http://rack.rubyforge.org";;
-       license = []; # one of ?
-       description = ''Rack provides minimal, modular and adaptable interface 
for developing web applications in Ruby the simplest way possible,''; # cut to 
120 chars
-       longDescription = ''Rack provides minimal, modular and adaptable 
interface for developing
-web applications in Ruby.  By wrapping HTTP requests and responses in
-the simplest way possible, it unifies and distills the API for web
-servers, web frameworks, and software in between (the so-called
-middleware) into a single method call.
-
-Also see http://rack.rubyforge.org.
-'';
-     };
-  };
-
-  rubyforge_2_0_4 = rubyDerivation {
-     name = "ruby-rubyforge-2.0.4"; # full_name
-     nameNoVersion = "rubyforge";
-     propagatedBuildInputs = [ json_pure_1_4_6 ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/rubyforge-2.0.4.gem";;
-       sha256 = "1wdaa4nzy39yzy848fa1rybi72qlyf9vhi1ra9wpx9rpi810fwh1";
-     };
-     meta = {
-       homepage = "http://codeforpeople.rubyforge.org/rubyforge/";;
-       license = []; # one of ?
-       description = ''A script which automates a limited set of rubyforge 
operations  * Run 'rubyforge help' for complete usage. * Setup: For f''; # cut 
to 120 chars
-       longDescription = ''A script which automates a limited set of rubyforge 
operations.
-
-* Run 'rubyforge help' for complete usage.
-* Setup: For first time users AND upgrades to 0.4.0:
-  * rubyforge setup (deletes your username and password, so run sparingly!)
-  * edit ~/.rubyforge/user-config.yml
-  * rubyforge config
-* For all rubyforge upgrades, run 'rubyforge config' to ensure you have 
latest.'';
-     };
-  };
-
-  json_1_4_6 = rubyDerivation {
-     name = "ruby-json-1.4.6"; # full_name
-     nameNoVersion = "json";
-     propagatedBuildInputs = [  ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/json-1.4.6.gem";;
-       sha256 = "1ibyw6hiclircn2f9f4kcznff4rdhcfsjxdzb4z9d9bd3ha1l96k";
-     };
-     meta = {
-       homepage = "http://flori.github.com/json";;
-       license = []; # one of ?
-       description = ''This is a JSON implementation as a Ruby extension in 
C[...]'';
-       longDescription = ''This is a JSON implementation as a Ruby extension 
in C.'';
-     };
-  };
-
-  locale_2_0_5 = rubyDerivation {
-     name = "ruby-locale-2.0.5"; # full_name
-     nameNoVersion = "locale";
-     propagatedBuildInputs = [  ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/locale-2.0.5.gem";;
-       sha256 = "007yx9rx52as4ykkcm1aw29vgm6rk5xz8012814ynhlp1i0z1fi8";
-     };
-     meta = {
-       homepage = "http://locale.rubyforge.org/";;
-       license = []; # one of ?
-       description = ''    Ruby-Locale is the pure ruby library which provides 
basic APIs for localization [...]'';
-       longDescription = ''    Ruby-Locale is the pure ruby library which 
provides basic APIs for localization.
-'';
-     };
-  };
-
-  mime_types_1_16 = rubyDerivation {
-     name = "ruby-mime-types-1.16"; # full_name
-     nameNoVersion = "mime_types";
-     propagatedBuildInputs = [  ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/mime-types-1.16.gem";;
-       sha256 = "1slp7g2xv9ygcapqv13qgh3g6ipx5k5c3imb5sdyh0b9ip5s34y3";
-     };
-     meta = {
-       homepage = "http://mime-types.rubyforge.org/";;
-       license = []; # one of ?
-       description = ''MIME::Types for Ruby originally based on and 
synchronized with MIME::Types for Perl by Mark Overmeer, copyright 2001 - 20''; 
# cut to 120 chars
-       longDescription = ''MIME::Types for Ruby originally based on and 
synchronized with MIME::Types for Perl by Mark Overmeer, copyright 2001 - 2009. 
As of version 1.15, the data format for the MIME::Type list has changed and the 
synchronization will no longer happen.'';
-     };
-  };
-
-  rb_inotify_0_8_1 = rubyDerivation {
-     name = "ruby-rb-inotify-0.8.1"; # full_name
-     nameNoVersion = "rb_inotify";
-     propagatedBuildInputs = [ ffi_0_6_3 ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/rb-inotify-0.8.1.gem";;
-       sha256 = "1z67kvhb8g8cgvlcfsh2gqhzqjijg8x02nafmifz9n9md5nvscar";
-     };
-     meta = {
-       homepage = "http://github.com/nex3/rb-notify";;
-       license = []; # one of ?
-       description = ''A Ruby wrapper for Linux's inotify, using FFI[...]'';
-       longDescription = ''A Ruby wrapper for Linux's inotify, using FFI'';
-     };
-  };
-
-  net_ssh_2_0_23 = rubyDerivation {
-     name = "ruby-net-ssh-2.0.23"; # full_name
-     nameNoVersion = "net_ssh";
-     propagatedBuildInputs = [  ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/net-ssh-2.0.23.gem";;
-       sha256 = "1fllf6mgwc213m5mn266qwhl65zc84wl8rq9m3lvbggw9mh5ynrr";
-     };
-     meta = {
-       homepage = "http://github.com/net-ssh/net-ssh";;
-       license = []; # one of ?
-       description = ''Net::SSH: a pure-Ruby implementation of the SSH2 client 
protocol[...]'';
-       longDescription = ''Net::SSH: a pure-Ruby implementation of the SSH2 
client protocol.'';
-     };
-  };
+    ffi = {
+      postUnpack = "onetuh";
+      propagatedBuildInputs = [ gems.rake ];
+      buildFlags=["--with-ffi-dir=${libffi}"];
+      NIX_POST_EXTRACT_FILES_HOOK = patchUsrBinEnv;
+    };
 
-  highline_1_6_1 = rubyDerivation {
-     name = "ruby-highline-1.6.1"; # full_name
-     nameNoVersion = "highline";
-     propagatedBuildInputs = [  ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/highline-1.6.1.gem";;
-       sha256 = "1dxlw2jcr4k1vv3sdaqi37kkh9v6cn3dq32ksz6k4yalcv6fhk7d";
-     };
-     meta = {
-       homepage = "http://highline.rubyforge.org";;
-       license = []; # one of ?
-       description = ''A high-level IO library that provides validation, type 
conversion, and more for command-line interfaces crank out anythin''; # cut to 
120 chars
-       longDescription = ''A high-level IO library that provides validation, 
type conversion, and more for
-command-line interfaces. HighLine also includes a complete menu system that can
-crank out anything from simple list selection to complete shells with just
-minutes of work.
-'';
-     };
-  };
+    xrefresh_server =
+    let patch = fetchurl {
+        url = "http://mawercer.de/~nix/xrefresh.diff.gz";;
+        sha256 = "1f7bnmn1pgkmkml0ms15m5lx880hq2sxy7vsddb3sbzm7n1yyicq";
+      };
+    in {
+      propagatedBuildInputs = [ gems.rb_inotify ];
+
+      # monitor implementation for Linux
+      postInstall = ''
+        cd $out/${ruby.gemPath}/gems/*
+        zcat ${patch} | patch -p 1
+      '';
+    };
 
-  activeresource_3_0_0 = rubyDerivation {
-     name = "ruby-activeresource-3.0.0"; # full_name
-     nameNoVersion = "activeresource";
-     propagatedBuildInputs = [   ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/activeresource-3.0.0.gem";;
-       sha256 = "0c5dflwbhl397kifz9i0g63p72xc3jyhk7q8sswp95ijg5smyx2y";
-     };
-     meta = {
-       homepage = "http://www.rubyonrails.org";;
-       license = []; # one of ?
-       description = ''REST on Rails[...]'';
-       longDescription = ''REST on Rails. Wrap your RESTful web app with Ruby 
classes and work with them like Active Record models.'';
-     };
+    xapian_full = {
+      buildInputs = [ gems.rake zlib libuuid ];
+      gemFlags = "--no-rdoc --no-ri";
+    };
   };
+  gemDefaults = { name, basename, requiredGems, sha256, meta }:
+    {
+      buildInputs = [rubygems ruby makeWrapper];
+      unpackPhase = ":";
+      configurePhase=":";
+      bulidPhase=":";
 
-  jeweler_1_4_0 = rubyDerivation {
-     name = "ruby-jeweler-1.4.0"; # full_name
-     nameNoVersion = "jeweler";
-     propagatedBuildInputs = [ git_1_2_5 rubyforge_2_0_4 gemcutter_0_6_1 ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/jeweler-1.4.0.gem";;
-       sha256 = "0hsz38wc37k1zzmy1jjvsqj6am14n410bbxk1dhq55cgapnwm3kb";
-     };
-     meta = {
-       homepage = "http://github.com/technicalpickles/jeweler";;
-       license = []; # one of ?
-       description = ''Simple and opinionated helper for creating Rubygem 
projects on GitHub[...]'';
-       longDescription = ''Simple and opinionated helper for creating Rubygem 
projects on GitHub'';
-     };
-  };
+      src = fetchurl {
+        url = "http://rubygems.org/downloads/${name}.gem";;
+        inherit sha256;
+      };
 
-  gemcutter_0_6_1 = rubyDerivation {
-     name = "ruby-gemcutter-0.6.1"; # full_name
-     nameNoVersion = "gemcutter";
-     propagatedBuildInputs = [  ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/gemcutter-0.6.1.gem";;
-       sha256 = "01ydbsz4ys6rkaghiibf7y7sbicnc5bppb2ay3agq1rqjvgprcr0";
-     };
-     meta = {
-       homepage = "http://rubygems.org";;
-       license = []; # one of ?
-       description = ''Adds several commands to RubyGems for managing gems and 
more on RubyGems[...]'';
-       longDescription = ''Adds several commands to RubyGems for managing gems 
and more on RubyGems.org.'';
-     };
-  };
+      name = "ruby-${name}";
 
-  mail_2_2_5 = rubyDerivation {
-     name = "ruby-mail-2.2.5"; # full_name
-     nameNoVersion = "mail";
-     propagatedBuildInputs = [   treetop_1_4_8 ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/mail-2.2.5.gem";;
-       sha256 = "0f6qwhwkc9hdqq5qkwzwjsqlwpvy7rcbra7pbl87l6q0mfaqiciv";
-     };
-     meta = {
-       homepage = "http://github.com/mikel/mail";;
-       license = []; # one of ?
-       description = ''A really Ruby Mail handler[...]'';
-       longDescription = ''A really Ruby Mail handler.'';
-     };
-  };
+      propagatedBuildInputs = requiredGems;
+      inherit meta;
 
-  sup_0_11 = rubyDerivation {
-     name = "ruby-sup-0.11"; # full_name
-     nameNoVersion = "sup";
-     propagatedBuildInputs = [ xapian_full_1_1_3_4 ncurses_0_9_1 rmail_1_0_0 
highline_1_6_1 net_ssh_2_0_23 trollop_1_16_2 lockfile_1_4_3 mime_types_1_16 
gettext_2_1_0 ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/sup-0.11.gem";;
-       sha256 = "0dijz1vl1kk4axfnry71bnl2585y1hw0n6sizg9aag7r9m13194q";
-     };
-     meta = {
-       homepage = "http://sup.rubyforge.org/";;
-       license = []; # one of ?
-       description = ''Sup is a console-based email client for people with a 
lot of email[...]'';
-       longDescription = ''Sup is a console-based email client for people with 
a lot of email. It supports tagging, very fast full-text search, automatic 
contact-list management, and more. If you're the type of person who treats 
email as an extension of your long-term memory, Sup is for you.  Sup makes it 
easy to: - Handle massive amounts of email.  - Mix email from different 
sources: mbox files (even across different machines), Maildir directories, IMAP 
folders, POP accounts, and GMail accounts.  - Instantaneously search over your 
entire email collection. Search over body text, or use a query language to 
combine search predicates in any way.  - Handle multiple accounts. Replying to 
email sent to a particular account will use the correct SMTP server, signature, 
and from address.  - Add custom code to handle certain types of messages or to 
handle certain types of text within messages.  - Organize email with 
user-defined labels, automatically track recent contacts, and much m!
 ore!  The goal of Sup is to become the email client of choice for nerds 
everywhere.'';
-     };
-  };
+      installPhase = ''
+        export HOME=$TMP/home; mkdir -pv "$HOME"
 
-  jquery_rails_0_1_2 = rubyDerivation {
-     name = "ruby-jquery-rails-0.1.2"; # full_name
-     nameNoVersion = "jquery_rails";
-     propagatedBuildInputs = [  ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/jquery-rails-0.1.2.gem";;
-       sha256 = "1z2qw5nmvjpgx5b79kxvi4gl102aq8brp32fpbysmzv2ghsqgvqn";
-     };
-     meta = {
-       homepage = "http://rubygems.org/gems/jquery-rails";;
-       license = []; # one of ?
-       description = ''This gem provides a Rails generator to install jQuery 
and the jQuery-ujs driver into your Rails 3 application, and then h''; # cut to 
120 chars
-       longDescription = ''This gem provides a Rails generator to install 
jQuery and the jQuery-ujs driver into your Rails 3 application, and then have 
them included automatically instead of Prototype.'';
-     };
-  };
+        gem install -V --ignore-dependencies \
+        -i "$out/${ruby.gemPath}" -n "$out/bin" "$src" $gemFlags -- $buildFlags
+        rm -frv $out/${ruby.gemPath}/cache # don't keep the .gem file here
 
-  tzinfo_0_3_23 = rubyDerivation {
-     name = "ruby-tzinfo-0.3.23"; # full_name
-     nameNoVersion = "tzinfo";
-     propagatedBuildInputs = [  ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/tzinfo-0.3.23.gem";;
-       sha256 = "020qk9yfc4s5mi624isn9r7hbncgk3l3ri783y7mn4ac6y4jkpgd";
-     };
-     meta = {
-       homepage = "http://tzinfo.rubyforge.org/";;
-       license = []; # one of ?
-       description = ''TZInfo is a Ruby library that uses the standard tz 
(Olson) database to provide daylight savings aware transformations bet''; # cut 
to 120 chars
-       longDescription = ''TZInfo is a Ruby library that uses the standard tz 
(Olson) database to provide daylight savings aware transformations between 
times in different time zones.'';
-     };
-  };
+        addToSearchPath GEM_PATH $out/${ruby.gemPath}
 
-  activesupport_3_0_0 = rubyDerivation {
-     name = "ruby-activesupport-3.0.0"; # full_name
-     nameNoVersion = "activesupport";
-     propagatedBuildInputs = [  ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/activesupport-3.0.0.gem";;
-       sha256 = "0bad6iqqajlzy61ky4his0d4cfzq4f77qihyn6yygq9pn1ma6mvx";
-     };
-     meta = {
-       homepage = "http://www.rubyonrails.org";;
-       license = []; # one of ?
-       description = ''A toolkit of support libraries and Ruby core extensions 
extracted from the Rails framework[...]'';
-       longDescription = ''A toolkit of support libraries and Ruby core 
extensions extracted from the Rails framework. Rich support for multibyte 
strings, internationalization, time zones, and testing.'';
-     };
-  };
+        for prog in $out/bin/*; do
+          wrapProgram "$prog" \
+            --prefix GEM_PATH : "$GEM_PATH" \
+            --prefix RUBYLIB : "${rubygems}/lib" \
+            --set RUBYOPT 'rubygems'
+        done
 
-  rmail_1_0_0 = rubyDerivation {
-     name = "ruby-rmail-1.0.0"; # full_name
-     nameNoVersion = "rmail";
-     propagatedBuildInputs = [  ];
-     src = fetchurl {
-       url = "http://gems.rubyforge.org/gems/rmail-1.0.0.gem";;
-       sha256 = "0nsg7yda1gdwa96j4hlrp2s0m06vrhcc4zy5mbq7gxmlmwf9yixp";
-     };
-     meta = {
-       homepage = "http://www.rfc20.org/rubymail";;
-       license = []; # one of ?
-       description = ''RMail is a lightweight mail library containing various 
utility classes and modules that allow ruby scripts to parse, modi''; # cut to 
120 chars
-       longDescription = ''RMail is a lightweight mail library containing 
various utility classes and modules that allow ruby scripts to parse, modify, 
and generate MIME mail messages.'';
-     };
-  };
+        for prog in $out/gems/*/bin/*; do
+          [[ -e "$out/bin/$(basename $prog)" ]]
+        done
 
-# aliases
-rmail=rmail_1_0_0;
-tzinfo=tzinfo_0_3_23;
-jquery_rails=jquery_rails_0_1_2;
-activeresource=activeresource_3_0_0;
-term_ansicolor=term_ansicolor_1_0_5;
-rb_inotify=rb_inotify_0_8_1;
-activerecord=activerecord_3_0_0;
-rails=rails_3_0_0;
-highline=highline_1_6_1;
-rubygems_update=rubygems_update_1_3_7;
-sqlite3_ruby=sqlite3_ruby_1_3_1;
-polyglot=polyglot_0_3_1;
-haml=haml_3_0_18;
-rake=rake_0_8_7;
-sup=sup_0_11;
-thor=thor_0_14_0;
-railties=railties_3_0_0;
-treetop=treetop_1_4_8;
-mime_types=mime_types_1_16;
-rubyforge=rubyforge_2_0_4;
-abstract=abstract_1_0_0;
-mail=mail_2_2_5;
-gemcutter=gemcutter_0_6_1;
-rack=rack_1_2_1;
-activemodel=activemodel_3_0_0;
-rack_mount=rack_mount_0_6_13;
-haml_rails=haml_rails_0_2;
-rails3_generators=rails3_generators_0_13_0;
-net_ssh=net_ssh_2_0_23;
-json=json_1_4_6;
-xrefresh_server=xrefresh_server_0_3_0;
-erubis=erubis_2_6_6;
-xapian_full=xapian_full_1_1_3_4;
-ncurses=ncurses_0_9_1;
-arel=arel_1_0_1;
-jeweler=jeweler_1_4_0;
-bundler=bundler_1_0_0;
-gettext=gettext_2_1_0;
-trollop=trollop_1_16_2;
-git=git_1_2_5;
-locale=locale_2_0_5;
-actionmailer=actionmailer_3_0_0;
-json_pure=json_pure_1_4_6;
-actionpack=actionpack_3_0_0;
-i18n=i18n_0_4_1;
-chronic=chronic_0_2_3;
-rack_test=rack_test_0_5_4;
-activesupport=activesupport_3_0_0;
-lockfile=lockfile_1_4_3;
-enumerated_attribute=enumerated_attribute_0_2_16;
-ffi=ffi_0_6_3;
-meta_programming=meta_programming_0_2_2;
-builder=builder_2_1_2;
-ncursesw=ncursesw_1_2_4_1;
-  # ================ END automatically generated code ================
-  }; in libs
+        runHook postInstall
+      '';
+    };
+  gem = aName: a@{ name, basename, requiredGems, sha256, meta }:
+    stdenv.mkDerivation (removeAttrs (stdenv.lib.mergeAttrsByFuncDefaults
+      [
+        (gemDefaults a)
+        (stdenv.lib.maybeAttr name {} patches)
+        (stdenv.lib.maybeAttr basename {} patches)
+      ]
+    ) ["mergeAttrBy"]);
+  gemsWithVersions = stdenv.lib.mapAttrs gem gemsGenerated.gems;
+  gems = gemsWithVersions // gemsGenerated.aliases;
+in
+gems

Copied and modified: 
nixpkgs/trunk/pkgs/development/interpreters/ruby/rubygems.nix (from r25653, 
nixpkgs/trunk/pkgs/development/interpreters/ruby/gems.nix)
==============================================================================
--- nixpkgs/trunk/pkgs/development/interpreters/ruby/gems.nix   Fri Jan 21 
08:24:46 2011        (r25653, copy source)
+++ nixpkgs/trunk/pkgs/development/interpreters/ruby/rubygems.nix       Fri Jan 
21 08:24:52 2011        (r25654)
@@ -43,5 +43,5 @@
 
   # TODO don't resolve 302 redirects but make nix resolve in fetchurl and
   # nix-prefetch-url. This should be done on stdenv-updates.
-  patches = [ ./gem_nix_command.patch /* see longDescription above */ ];
+  patches = [ ./gem_hook.patch /* see longDescription above */ ];
 }

Modified: nixpkgs/trunk/pkgs/top-level/all-packages.nix
==============================================================================
--- nixpkgs/trunk/pkgs/top-level/all-packages.nix       Fri Jan 21 08:24:46 
2011        (r25653)
+++ nixpkgs/trunk/pkgs/top-level/all-packages.nix       Fri Jan 21 08:24:52 
2011        (r25654)
@@ -2348,9 +2348,7 @@
   #ruby19 = import ../development/interpreters/ruby/ruby-19.nix { inherit 
ruby18 fetchurl; };
   ruby = ruby18;
 
-  rubyLibs = recurseIntoAttrs (import 
../development/interpreters/ruby/libs.nix {
-    inherit pkgs stdenv;
-  });
+  rubyLibs = recurseIntoAttrs (callPackage 
../development/interpreters/ruby/libs.nix { });
 
   rake = callPackage ../development/ruby-modules/rake { };
 
@@ -2360,7 +2358,7 @@
     withBioconductor = getConfig ["rLang" "withBioconductor"] false;
   };
 
-  rubygemsFun = ruby: builderDefsPackage (import 
../development/interpreters/ruby/gems.nix) {
+  rubygemsFun = ruby: builderDefsPackage (import 
../development/interpreters/ruby/rubygems.nix) {
     inherit ruby makeWrapper;
   };
   rubygems = rubygemsFun ruby;
_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to