summary refs log tree commit diff
path: root/pkgs/development/ruby-modules
diff options
context:
space:
mode:
authorAneesh Agrawal <aneeshusa@gmail.com>2017-10-05 04:10:57 -0400
committerAneesh Agrawal <aneeshusa@gmail.com>2018-01-04 02:28:33 -0500
commit36f1bcbeb85d8d3447e9a5dadb5801cfe615fded (patch)
tree94302aa0943cc06ca286fb6cfd24f2185fa3217b /pkgs/development/ruby-modules
parent8686b98612dc41d14df2a1f09a313d9084e5f6b6 (diff)
downloadnixpkgs-36f1bcbeb85d8d3447e9a5dadb5801cfe615fded.tar
nixpkgs-36f1bcbeb85d8d3447e9a5dadb5801cfe615fded.tar.gz
nixpkgs-36f1bcbeb85d8d3447e9a5dadb5801cfe615fded.tar.bz2
nixpkgs-36f1bcbeb85d8d3447e9a5dadb5801cfe615fded.tar.lz
nixpkgs-36f1bcbeb85d8d3447e9a5dadb5801cfe615fded.tar.xz
nixpkgs-36f1bcbeb85d8d3447e9a5dadb5801cfe615fded.tar.zst
nixpkgs-36f1bcbeb85d8d3447e9a5dadb5801cfe615fded.zip
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.
Diffstat (limited to 'pkgs/development/ruby-modules')
-rw-r--r--pkgs/development/ruby-modules/bundled-common/functions.nix4
-rw-r--r--pkgs/development/ruby-modules/bundler/default.nix2
-rw-r--r--pkgs/development/ruby-modules/gem-config/default.nix3
-rw-r--r--pkgs/development/ruby-modules/gem/default.nix15
4 files changed, 13 insertions, 11 deletions
diff --git a/pkgs/development/ruby-modules/bundled-common/functions.nix b/pkgs/development/ruby-modules/bundled-common/functions.nix
index b17a4639e77..85e93959e4b 100644
--- a/pkgs/development/ruby-modules/bundled-common/functions.nix
+++ b/pkgs/development/ruby-modules/bundled-common/functions.nix
@@ -67,8 +67,10 @@ rec {
         };
     in res;
 
-  composeGemAttrs = ruby: gems: name: attrs: ((removeAttrs attrs ["source" "platforms"]) // attrs.source // {
+  composeGemAttrs = ruby: gems: name: attrs: ((removeAttrs attrs ["platforms"]) // {
     inherit ruby;
+    inherit (attrs.source) type;
+    source = removeAttrs attrs.source ["type"];
     gemName = name;
     gemPath = map (gemName: gems."${gemName}") (attrs.dependencies or []);
   });
diff --git a/pkgs/development/ruby-modules/bundler/default.nix b/pkgs/development/ruby-modules/bundler/default.nix
index 9251c4d2a41..6ba1d5f10ec 100644
--- a/pkgs/development/ruby-modules/bundler/default.nix
+++ b/pkgs/development/ruby-modules/bundler/default.nix
@@ -5,7 +5,7 @@ buildRubyGem rec {
   name = "${gemName}-${version}";
   gemName = "bundler";
   version = "1.14.6";
-  sha256 = "0h3x2csvlz99v2ryj1w72vn6kixf7rl35lhdryvh7s49brnj0cgl";
+  source.sha256 = "0h3x2csvlz99v2ryj1w72vn6kixf7rl35lhdryvh7s49brnj0cgl";
   dontPatchShebangs = true;
 
   postFixup = ''
diff --git a/pkgs/development/ruby-modules/gem-config/default.nix b/pkgs/development/ruby-modules/gem-config/default.nix
index e434a863c0e..5361c3ce65e 100644
--- a/pkgs/development/ruby-modules/gem-config/default.nix
+++ b/pkgs/development/ruby-modules/gem-config/default.nix
@@ -31,8 +31,7 @@ let
   rainbow_rake = buildRubyGem {
     name = "rake";
     gemName = "rake";
-    remotes = ["https://rubygems.org"];
-    sha256 = "01j8fc9bqjnrsxbppncai05h43315vmz9fwg28qdsgcjw9ck1d7n";
+    source.sha256 = "01j8fc9bqjnrsxbppncai05h43315vmz9fwg28qdsgcjw9ck1d7n";
     type = "gem";
     version = "12.0.0";
   };
diff --git a/pkgs/development/ruby-modules/gem/default.nix b/pkgs/development/ruby-modules/gem/default.nix
index 62a9d60686f..eba0dc2c4a7 100644
--- a/pkgs/development/ruby-modules/gem/default.nix
+++ b/pkgs/development/ruby-modules/gem/default.nix
@@ -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}
     ''}