ruby treewide: don't merge source into top-level
Keep the `source` attrset distinct to prevent its entries from merging with the top level attrs. Since each type of source has a different set of entries for `source`, this is the easiest way to keep them together. This will pave the way for a new `url` type of source. This is a mass-rebuild of many ruby packages, notably those using `git` type sources.
This commit is contained in:
@@ -41,7 +41,6 @@ lib.makeOverridable (
|
||||
, patches ? []
|
||||
, gemPath ? []
|
||||
, dontStrip ? true
|
||||
, remotes ? ["https://rubygems.org"]
|
||||
# Assume we don't have to build unless strictly necessary (e.g. the source is a
|
||||
# git checkout).
|
||||
# If you need to apply patches, make sure to set `dontBuild = false`;
|
||||
@@ -56,12 +55,14 @@ let
|
||||
src = attrs.src or (
|
||||
if type == "gem" then
|
||||
fetchurl {
|
||||
urls = map (remote: "${remote}/gems/${gemName}-${version}.gem") remotes;
|
||||
inherit (attrs) sha256;
|
||||
urls = map (
|
||||
remote: "${remote}/gems/${gemName}-${version}.gem"
|
||||
) (attrs.source.remotes or [ "https://rubygems.org" ]);
|
||||
inherit (attrs.source) sha256;
|
||||
}
|
||||
else if type == "git" then
|
||||
fetchgit {
|
||||
inherit (attrs) url rev sha256 fetchSubmodules;
|
||||
inherit (attrs.source) url rev sha256 fetchSubmodules;
|
||||
leaveDotGit = true;
|
||||
}
|
||||
else
|
||||
@@ -74,7 +75,7 @@ let
|
||||
|
||||
in
|
||||
|
||||
stdenv.mkDerivation (attrs // {
|
||||
stdenv.mkDerivation ((builtins.removeAttrs attrs ["source"]) // {
|
||||
inherit ruby;
|
||||
inherit doCheck;
|
||||
inherit dontBuild;
|
||||
@@ -161,9 +162,9 @@ stdenv.mkDerivation (attrs // {
|
||||
${lib.optionalString (type == "git") ''
|
||||
ruby ${./nix-bundle-install.rb} \
|
||||
${gemName} \
|
||||
${attrs.url} \
|
||||
${attrs.source.url} \
|
||||
${src} \
|
||||
${attrs.rev} \
|
||||
${attrs.source.rev} \
|
||||
${version} \
|
||||
${lib.escapeShellArgs buildFlags}
|
||||
''}
|
||||
|
||||
Reference in New Issue
Block a user