From 603e84caefe2be319263ad6f83637af533834cc9 Mon Sep 17 00:00:00 2001 From: Judson Date: Sun, 25 Jun 2017 17:40:22 -0700 Subject: Fixing an overload of "pname" --- pkgs/development/ruby-modules/bundled-common/default.nix | 9 +++++---- pkgs/development/ruby-modules/bundled-common/functions.nix | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'pkgs/development/ruby-modules/bundled-common') diff --git a/pkgs/development/ruby-modules/bundled-common/default.nix b/pkgs/development/ruby-modules/bundled-common/default.nix index 2aea35844fe..354353ffab1 100644 --- a/pkgs/development/ruby-modules/bundled-common/default.nix +++ b/pkgs/development/ruby-modules/bundled-common/default.nix @@ -7,6 +7,7 @@ { name , pname ? name +, mainGemName ? null , gemdir ? null , gemfile ? null , lockfile ? null @@ -44,13 +45,13 @@ let copyIfBundledByPath = { bundledByPath ? false, ...}@main: (if bundledByPath then - assert gemFiles.gemdir != nil; "cp -a ${gemFiles.gemdir}/* $out/" + assert gemFiles.gemdir != null; "cp -a ${gemFiles.gemdir}/* $out/" else "" ); - maybeCopyAll = pname: if pname == null then "" else + maybeCopyAll = pkgname: if pkgname == null then "" else let - mainGem = gems."${pname}" or (throw "bundlerEnv: gem ${pname} not found"); + mainGem = gems."${pkgname}" or (throw "bundlerEnv: gem ${pkgname} not found"); in copyIfBundledByPath mainGem; @@ -59,7 +60,7 @@ let # out. Yes, I'm serious. confFiles = runCommand "gemfile-and-lockfile" {} '' mkdir -p $out - ${maybeCopyAll pname} + ${maybeCopyAll mainGemName} cp ${gemFiles.gemfile} $out/Gemfile || ls -l $out/Gemfile cp ${gemFiles.lockfile} $out/Gemfile.lock || ls -l $out/Gemfile.lock ''; diff --git a/pkgs/development/ruby-modules/bundled-common/functions.nix b/pkgs/development/ruby-modules/bundled-common/functions.nix index 1d7c4878e13..b17a4639e77 100644 --- a/pkgs/development/ruby-modules/bundled-common/functions.nix +++ b/pkgs/development/ruby-modules/bundled-common/functions.nix @@ -7,6 +7,8 @@ rec { , gemdir ? null , ... }: { + inherit gemdir; + gemfile = if gemfile == null then assert gemdir != null; gemdir + "/Gemfile" else gemfile; -- cgit 1.4.1