summary refs log tree commit diff
path: root/pkgs/development/interpreters/ruby/gems.nix
blob: d971ee22d65d23b35aa13a40d3925e4ca61b0fb6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
args : with args; 
rec {
  version = "1.2.0";
  src = fetchurl {
    url = "http://rubyforge.org/frs/download.php/38646/rubygems-${version}.tgz";
    sha256 = "0b9ppgs9av4z344s13wp40ki72prxyz3q0hmsf5swx7xhl54bbr8";
  };

  buildInputs = [ruby makeWrapper];
  configureFlags = [];

  doInstall = fullDepEntry (''
    ruby setup.rb --prefix=$out/
    wrapProgram $out/bin/gem --prefix RUBYLIB : $out/lib:$out/lib
  '') ["minInit" "addInputs" "doUnpack" "defEnsureDir"];

  /* doConfigure should be specified separately */
  phaseNames = ["doInstall"];
      
  name = "rubygems-" + version;
  meta = {
    description = "Ruby gems package collection";
    longDescription = ''
      Example usage:
      gem install -i .ruby-gems json
      ruby -I ~/.ruby-gems/gems/json-1.1.3/lib your-script.rb
      Probably there are better ways to handle this all. Go on and fix it.
    '';
  };
}