mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-22 14:45:27 +00:00
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:
parent
8686b98612
commit
36f1bcbeb8
|
@ -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 []);
|
||||
});
|
||||
|
|
|
@ -5,7 +5,7 @@ buildRubyGem rec {
|
|||
name = "${gemName}-${version}";
|
||||
gemName = "bundler";
|
||||
version = "1.14.6";
|
||||
sha256 = "0h3x2csvlz99v2ryj1w72vn6kixf7rl35lhdryvh7s49brnj0cgl";
|
||||
source.sha256 = "0h3x2csvlz99v2ryj1w72vn6kixf7rl35lhdryvh7s49brnj0cgl";
|
||||
dontPatchShebangs = true;
|
||||
|
||||
postFixup = ''
|
||||
|
|
|
@ -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";
|
||||
};
|
||||
|
|
|
@ -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}
|
||||
''}
|
||||
|
|
|
@ -9,14 +9,14 @@ buildRubyGem rec {
|
|||
name = "${gemName}-${version}";
|
||||
gemName = "tmuxinator";
|
||||
version = "0.10.0";
|
||||
sha256 = "199pq15qknpcafw8ryb9kk1jsrwnncg6k5l9d4n0nmms4knxlqlf";
|
||||
source.sha256 = "199pq15qknpcafw8ryb9kk1jsrwnncg6k5l9d4n0nmms4knxlqlf";
|
||||
|
||||
erubis = buildRubyGem rec {
|
||||
inherit ruby;
|
||||
name = "ruby${ruby.version}-${gemName}-${version}";
|
||||
gemName = "erubis";
|
||||
version = "2.7.0";
|
||||
sha256 = "1fj827xqjs91yqsydf0zmfyw9p4l2jz5yikg3mppz6d7fi8kyrb3";
|
||||
source.sha256 = "1fj827xqjs91yqsydf0zmfyw9p4l2jz5yikg3mppz6d7fi8kyrb3";
|
||||
};
|
||||
|
||||
thor = buildRubyGem rec {
|
||||
|
@ -24,7 +24,7 @@ buildRubyGem rec {
|
|||
name = "ruby${ruby.version}-${gemName}-${version}";
|
||||
gemName = "thor";
|
||||
version = "0.19.1";
|
||||
sha256 = "08p5gx18yrbnwc6xc0mxvsfaxzgy2y9i78xq7ds0qmdm67q39y4z";
|
||||
source.sha256 = "08p5gx18yrbnwc6xc0mxvsfaxzgy2y9i78xq7ds0qmdm67q39y4z";
|
||||
};
|
||||
|
||||
xdg = buildRubyGem rec {
|
||||
|
@ -32,7 +32,7 @@ buildRubyGem rec {
|
|||
name = "ruby${ruby.version}-${gemName}-${version}";
|
||||
gemName = "xdg";
|
||||
version = "2.2.3";
|
||||
sha256 = "1bn47fdbwxqbdvjcfg86i32hmwm36k0xl876kb85f5da5v84lzmq";
|
||||
source.sha256 = "1bn47fdbwxqbdvjcfg86i32hmwm36k0xl876kb85f5da5v84lzmq";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [ erubis thor xdg ];
|
||||
|
|
|
@ -13,7 +13,7 @@ buildRubyGem rec {
|
|||
inherit ruby;
|
||||
gemName = "hss";
|
||||
version = "1.0.1";
|
||||
sha256 = "0hdfpxxqsh6gisn8mm0knsl1aig9fir0h2x9sirk3gr36qbz5xa4";
|
||||
source.sha256 = "0hdfpxxqsh6gisn8mm0knsl1aig9fir0h2x9sirk3gr36qbz5xa4";
|
||||
|
||||
postInstall = ''
|
||||
substituteInPlace $GEM_HOME/gems/${gemName}-${version}/bin/hss \
|
||||
|
|
|
@ -5,7 +5,7 @@ buildRubyGem rec {
|
|||
name = "${gemName}-${version}";
|
||||
gemName = "gist";
|
||||
version = "4.6.1";
|
||||
sha256 = "16qvmn7syvcf4lnblngzvq8xynvb62h1xhfc7xfb0c1sjh166hff";
|
||||
source.sha256 = "16qvmn7syvcf4lnblngzvq8xynvb62h1xhfc7xfb0c1sjh166hff";
|
||||
|
||||
buildInputs = [ makeWrapper ];
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ buildRubyGem rec {
|
|||
name = "${gemName}-${version}";
|
||||
gemName = "flvtool2";
|
||||
version = "1.0.6";
|
||||
sha256 = "0xsla1061pi4ryh3jbvwsbs8qchprchbqjy7652g2g64v37i74qj";
|
||||
source.sha256 = "0xsla1061pi4ryh3jbvwsbs8qchprchbqjy7652g2g64v37i74qj";
|
||||
|
||||
meta = {
|
||||
homepage = https://github.com/unnu/flvtool2;
|
||||
|
|
Loading…
Reference in a new issue