nixpkgs/pkgs/development/interpreters/ruby/rubygems.nix

38 lines
1 KiB
Nix
Raw Normal View History

args : with args;
2014-10-31 02:44:57 +01:00
rec {
2014-10-28 05:16:14 +01:00
name = "rubygems-" + version;
2014-08-08 00:13:56 +02:00
version = "2.4.1";
src = fetchurl {
url = "http://production.cf.rubygems.org/rubygems/${name}.tgz";
2014-08-08 00:13:56 +02:00
sha256 = "0cpr6cx3h74ykpb0cp4p4xg7a8j0bhz3sk271jq69l4mm4zy4h4f";
};
buildInputs = [ruby makeWrapper];
configureFlags = [];
doInstall = fullDepEntry (''
ruby setup.rb --prefix=$out/
wrapProgram $out/bin/gem --prefix RUBYLIB : $out/lib
find $out -type f -name "*.rb" | xargs sed -i "s@/usr/bin/env@$(type -p env)@g"
mkdir -pv $out/nix-support
cat > $out/nix-support/setup-hook <<EOF
export RUBYOPT=rubygems
addToSearchPath RUBYLIB $out/lib
EOF'') ["minInit" "addInputs" "doUnpack" "defEnsureDir"];
/* doConfigure should be specified separately */
phaseNames = ["doPatch" "doInstall"];
meta = {
description = "Ruby gems package collection";
longDescription = ''
Nix can create nix packages from gems.
2014-09-12 00:26:13 +02:00
To use it by installing gem-nix package.
'';
};
patches = [ ./gem_hook.patch ];
}