diff options
author | Judson <nyarly@gmail.com> | 2017-06-09 09:04:33 -0700 |
---|---|---|
committer | Judson <nyarly@gmail.com> | 2017-06-09 09:04:33 -0700 |
commit | 964d9b7a067fc48d9774c5bff37d7fff41158f5a (patch) | |
tree | 5d5ace6a96680f7fdfa88efe93a62847ce8097dd /pkgs/development/ruby-modules/bundled-common | |
parent | 0bde4071fcd056172405005e7c99a56287e3477c (diff) | |
download | nixpkgs-964d9b7a067fc48d9774c5bff37d7fff41158f5a.tar nixpkgs-964d9b7a067fc48d9774c5bff37d7fff41158f5a.tar.gz nixpkgs-964d9b7a067fc48d9774c5bff37d7fff41158f5a.tar.bz2 nixpkgs-964d9b7a067fc48d9774c5bff37d7fff41158f5a.tar.lz nixpkgs-964d9b7a067fc48d9774c5bff37d7fff41158f5a.tar.xz nixpkgs-964d9b7a067fc48d9774c5bff37d7fff41158f5a.tar.zst nixpkgs-964d9b7a067fc48d9774c5bff37d7fff41158f5a.zip |
Made gemdir handling into a common function
Diffstat (limited to 'pkgs/development/ruby-modules/bundled-common')
-rw-r--r-- | pkgs/development/ruby-modules/bundled-common/default.nix | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/pkgs/development/ruby-modules/bundled-common/default.nix b/pkgs/development/ruby-modules/bundled-common/default.nix index 30c82100d5e..2aea35844fe 100644 --- a/pkgs/development/ruby-modules/bundled-common/default.nix +++ b/pkgs/development/ruby-modules/bundled-common/default.nix @@ -7,10 +7,10 @@ { name , pname ? name -, gemdir -, gemfile -, lockfile -, gemset +, gemdir ? null +, gemfile ? null +, lockfile ? null +, gemset ? null , ruby ? defs.ruby , gemConfig ? defaultGemConfig , postBuild ? null @@ -24,8 +24,9 @@ with import ./functions.nix { inherit lib gemConfig; }; let + gemFiles = bundlerFiles args; - importedGemset = import gemset; + importedGemset = import gemFiles.gemset; filteredGemset = filterGemset { inherit ruby groups; } importedGemset; @@ -42,9 +43,9 @@ let gems = lib.flip lib.mapAttrs configuredGemset (name: attrs: buildGem name attrs); copyIfBundledByPath = { bundledByPath ? false, ...}@main: - (if bundledByPath then '' - cp -a ${gemdir}/* $out/ - '' else "" + (if bundledByPath then + assert gemFiles.gemdir != nil; "cp -a ${gemFiles.gemdir}/* $out/" + else "" ); maybeCopyAll = pname: if pname == null then "" else @@ -59,8 +60,8 @@ let confFiles = runCommand "gemfile-and-lockfile" {} '' mkdir -p $out ${maybeCopyAll pname} - cp ${gemfile} $out/Gemfile || ls -l $out/Gemfile - cp ${lockfile} $out/Gemfile.lock || ls -l $out/Gemfile.lock + cp ${gemFiles.gemfile} $out/Gemfile || ls -l $out/Gemfile + cp ${gemFiles.lockfile} $out/Gemfile.lock || ls -l $out/Gemfile.lock ''; buildGem = name: attrs: ( |