ruby-modules: Add new url source type
This just defers to `fetchurl` for fetching. Additionally, update the `nix-bundle-install.rb` script to handle gems installed from a path, i.e. those with a `url` source. Some parts of that script have been disabled in the `path` case that likely shouldn't be, but cause errors and aren't necessary to get `vagrant` to work.
This commit is contained in:
@@ -65,6 +65,8 @@ let
|
||||
inherit (attrs.source) url rev sha256 fetchSubmodules;
|
||||
leaveDotGit = true;
|
||||
}
|
||||
else if type == "url" then
|
||||
fetchurl attrs.source
|
||||
else
|
||||
throw "buildRubyGem: don't know how to build a gem of type \"${type}\""
|
||||
);
|
||||
@@ -84,7 +86,8 @@ stdenv.mkDerivation ((builtins.removeAttrs attrs ["source"]) // {
|
||||
|
||||
buildInputs = [
|
||||
ruby makeWrapper
|
||||
] ++ lib.optionals (type == "git") [ git bundler ]
|
||||
] ++ lib.optionals (type == "git") [ git ]
|
||||
++ lib.optionals (type != "gem") [ bundler ]
|
||||
++ lib.optional stdenv.isDarwin darwin.libobjc
|
||||
++ buildInputs;
|
||||
|
||||
@@ -159,14 +162,22 @@ stdenv.mkDerivation ((builtins.removeAttrs attrs ["source"]) // {
|
||||
|
||||
echo "buildFlags: $buildFlags"
|
||||
|
||||
${lib.optionalString (type == "url") ''
|
||||
ruby ${./nix-bundle-install.rb} \
|
||||
"path" \
|
||||
'${gemName}' \
|
||||
'${version}' \
|
||||
'${lib.escapeShellArgs buildFlags}'
|
||||
''}
|
||||
${lib.optionalString (type == "git") ''
|
||||
ruby ${./nix-bundle-install.rb} \
|
||||
${gemName} \
|
||||
${attrs.source.url} \
|
||||
${src} \
|
||||
${attrs.source.rev} \
|
||||
${version} \
|
||||
${lib.escapeShellArgs buildFlags}
|
||||
"git" \
|
||||
'${gemName}' \
|
||||
'${version}' \
|
||||
'${lib.escapeShellArgs buildFlags}' \
|
||||
'${attrs.source.url}' \
|
||||
'${src}' \
|
||||
'${attrs.source.rev}'
|
||||
''}
|
||||
|
||||
${lib.optionalString (type == "gem") ''
|
||||
|
||||
Reference in New Issue
Block a user