3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/interpreters/ruby/rubygems.nix

38 lines
1 KiB
Nix
Raw Normal View History

args : with args;
rec {
version = "1.8.25";
src = fetchurl {
url = "http://production.cf.rubygems.org/rubygems/${name}.tgz";
sha256 = "1j0wiy829nsfrpdzr9xzs39jf1lga3f5b7773vxqfs3lz3fli4v4";
};
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"];
name = "rubygems-" + version;
meta = {
description = "Ruby gems package collection";
longDescription = ''
Nix can create nix packages from gems.
2014-09-11 23:26:13 +01:00
To use it by installing gem-nix package.
'';
};
patches = [ ./gem_hook.patch ];
}