diff options
Diffstat (limited to 'pkgs/development/ruby-modules/bundled-common/default.nix')
-rw-r--r-- | pkgs/development/ruby-modules/bundled-common/default.nix | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/pkgs/development/ruby-modules/bundled-common/default.nix b/pkgs/development/ruby-modules/bundled-common/default.nix index 0812ff590a50..66f33f6e31f4 100644 --- a/pkgs/development/ruby-modules/bundled-common/default.nix +++ b/pkgs/development/ruby-modules/bundled-common/default.nix @@ -1,4 +1,4 @@ -{ stdenv, runCommand, ruby, lib +{ stdenv, runCommand, ruby, lib, rsync , defaultGemConfig, buildRubyGem, buildEnv , makeWrapper , bundler @@ -13,6 +13,7 @@ , lockfile ? null , gemset ? null , ruby ? defs.ruby +, copyGemFiles ? false # Copy gem files instead of symlinking , gemConfig ? defaultGemConfig , postBuild ? null , document ? [] @@ -96,7 +97,8 @@ let envPaths = lib.attrValues gems ++ lib.optional (!hasBundler) bundler; - basicEnv = buildEnv { + + basicEnvArgs = { inherit buildInputs ignoreCollisions; name = name'; @@ -154,5 +156,17 @@ let }; }; }; + + basicEnv = + if copyGemFiles then + runCommand name' basicEnvArgs '' + mkdir -p $out + for i in $paths; do + ${rsync}/bin/rsync -a $i/lib $out/ + done + eval "$postBuild" + '' + else + buildEnv basicEnvArgs; in basicEnv |