buildRubyGem: remove unecessary duplication

This commit is contained in:
zimbatm 2016-01-24 23:27:06 +00:00
parent 885acea1dd
commit 24e0fc99f9

View File

@ -50,24 +50,24 @@ lib.makeOverridable (
, passthru ? {} , passthru ? {}
, ...} @ attrs: , ...} @ attrs:
if ! builtins.elem type [ "git" "gem" ]
then throw "buildRubyGem: don't know how to build a gem of type \"${type}\""
else
let let
shellEscape = x: "'${lib.replaceChars ["'"] [("'\\'" + "'")] x}'"; shellEscape = x: "'${lib.replaceChars ["'"] [("'\\'" + "'")] x}'";
rubygems = (attrs.rubygems or defs.rubygems).override { rubygems = (attrs.rubygems or defs.rubygems).override {
inherit ruby; inherit ruby;
}; };
src = attrs.src or ( src = attrs.src or (
if type == "gem" if type == "gem" then
then fetchurl { fetchurl {
urls = map (remote: "${remote}/gems/${gemName}-${version}.gem") remotes; urls = map (remote: "${remote}/gems/${gemName}-${version}.gem") remotes;
inherit (attrs) sha256; inherit (attrs) sha256;
} else fetchgit { }
inherit (attrs) url rev sha256 fetchSubmodules; else if type == "git" then
leaveDotGit = true; fetchgit {
} inherit (attrs) url rev sha256 fetchSubmodules;
leaveDotGit = true;
}
else
throw "buildRubyGem: don't know how to build a gem of type \"${type}\""
); );
documentFlag = documentFlag =
if document == [] if document == []