mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-24 07:53:19 +00:00
Simplifying interface on gemset.nix slightly.
`usesGemspec` no longer required to trigger the "copy everything into gemfile-and-lock" behavior. If the mainGem is referred to by path, that's sufficient.
This commit is contained in:
parent
3c9941114f
commit
0481a33d21
@ -76,16 +76,14 @@ let
|
|||||||
if hasBundler then gems.bundler
|
if hasBundler then gems.bundler
|
||||||
else defs.bundler.override (attrs: { inherit ruby; });
|
else defs.bundler.override (attrs: { inherit ruby; });
|
||||||
|
|
||||||
pathDerivation = {
|
pathDerivation = { gemName, version, path, ... }:
|
||||||
usesGemspec ? false, ...
|
|
||||||
}@attrs:
|
|
||||||
let
|
let
|
||||||
res = {
|
res = {
|
||||||
inherit usesGemspec;
|
|
||||||
type = "derivation";
|
type = "derivation";
|
||||||
name = attrs.gemName;
|
bundledByPath = true;
|
||||||
version = attrs.version;
|
name = gemName;
|
||||||
outPath = attrs.path;
|
version = version;
|
||||||
|
outPath = path;
|
||||||
outputs = [ "out" ];
|
outputs = [ "out" ];
|
||||||
out = res;
|
out = res;
|
||||||
outputName = "out";
|
outputName = "out";
|
||||||
@ -105,10 +103,10 @@ let
|
|||||||
|
|
||||||
gems = lib.flip lib.mapAttrs configuredGemset (name: attrs: buildGem name attrs);
|
gems = lib.flip lib.mapAttrs configuredGemset (name: attrs: buildGem name attrs);
|
||||||
|
|
||||||
maybeCopyAll = main: if main == null then "" else copyIfUseGemspec main;
|
maybeCopyAll = main: if main == null then "" else copyIfBundledByPath main;
|
||||||
|
|
||||||
copyIfUseGemspec = { usesGemspec ? false, ...}@main:
|
copyIfBundledByPath = { bundledByPath ? false, ...}@main:
|
||||||
(if usesGemspec then ''
|
(if bundledByPath then ''
|
||||||
cp -a ${gemdir}/* $out/
|
cp -a ${gemdir}/* $out/
|
||||||
'' else ""
|
'' else ""
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user