2008-04-11 11:23:33 +02:00
|
|
|
args : with args;
|
|
|
|
rec {
|
2009-06-30 16:29:17 +02:00
|
|
|
|
|
|
|
# some packages (eg ruby-debug) still require 1.8. So let's stick to that for
|
|
|
|
# now if nobody has different requirements
|
|
|
|
|
2011-01-21 09:24:46 +01:00
|
|
|
version = "1.4.1";
|
2008-04-11 11:23:33 +02:00
|
|
|
src = fetchurl {
|
2010-09-08 11:56:53 +02:00
|
|
|
url = "http://production.cf.rubygems.org/rubygems/${name}.tgz";
|
2011-01-21 09:24:46 +01:00
|
|
|
sha256 = "189wg1msb4sdjvdzv9ia6q3lvjlygpp67wlbkl7cjb22bpjy4w4b";
|
2008-04-11 11:23:33 +02:00
|
|
|
};
|
|
|
|
|
2010-01-15 20:35:06 +01:00
|
|
|
|
2008-04-11 11:23:33 +02:00
|
|
|
buildInputs = [ruby makeWrapper];
|
|
|
|
configureFlags = [];
|
|
|
|
|
2009-05-20 01:25:58 +02:00
|
|
|
doInstall = fullDepEntry (''
|
2008-04-11 11:23:33 +02:00
|
|
|
ruby setup.rb --prefix=$out/
|
|
|
|
wrapProgram $out/bin/gem --prefix RUBYLIB : $out/lib:$out/lib
|
2010-01-15 20:35:06 +01:00
|
|
|
find $out -type f -name "*.rb" | xargs sed -i "s@/usr/bin/env@$(type -p env)@g"
|
2011-01-21 09:24:46 +01:00
|
|
|
mkdir -pv $out/nix-support
|
|
|
|
cat > $out/nix-support/setup-hook <<EOF
|
|
|
|
export RUBYOPT=rubygems
|
|
|
|
addToSearchPath RUBYLIB $out/lib
|
|
|
|
|
|
|
|
addGemPath() {
|
|
|
|
addToSearchPath GEM_PATH \$1/${ruby.gemPath}
|
|
|
|
}
|
|
|
|
|
|
|
|
envHooks+=(addGemPath)
|
|
|
|
EOF'') ["minInit" "addInputs" "doUnpack" "defEnsureDir"];
|
2008-04-11 11:23:33 +02:00
|
|
|
|
|
|
|
/* doConfigure should be specified separately */
|
2010-01-15 20:35:06 +01:00
|
|
|
phaseNames = ["doPatch" "doInstall"];
|
2008-04-11 11:23:33 +02:00
|
|
|
|
|
|
|
name = "rubygems-" + version;
|
|
|
|
meta = {
|
2008-08-03 00:25:54 +02:00
|
|
|
description = "Ruby gems package collection";
|
2008-10-19 14:59:34 +02:00
|
|
|
longDescription = ''
|
2009-06-30 16:29:20 +02:00
|
|
|
see comment in rubyLibs to get to know how to use ruby gems in nix
|
2008-10-19 14:59:34 +02:00
|
|
|
'';
|
2008-04-11 11:23:33 +02:00
|
|
|
};
|
2009-06-30 16:29:20 +02:00
|
|
|
|
|
|
|
# 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 */ ];
|
2008-04-11 11:23:33 +02:00
|
|
|
}
|