simplify expressions

This commit is contained in:
Charles Strahan 2014-10-27 22:13:36 +00:00
parent b4c81a1f15
commit 9eedf0f218
2 changed files with 5 additions and 15 deletions

View file

@ -21,6 +21,7 @@
, which, postgresql, v8_3_16_14, clang }:
let
id = x: x;
v8 = v8_3_16_14;
gems = lib.mapAttrs (name: config:
@ -31,17 +32,10 @@ let
instantiate = (name: attrs:
let
# Turn dependency strings into actual derivations.
gemPath = map (name: builtins.getAttr name gems) (attrs.dependencies or []);
fix = if (builtins.hasAttr name fixes)
then (builtins.getAttr name fixes) attrs
else {};
gemPath = map (name: gems."${name}") (attrs.dependencies or []);
fixedAttrs = (fixes."${name}" or id) attrs;
in
buildRubyGem (attrs // {
inherit gemPath;
# Disable the checkPhase as there no single way to run tests for a given
# gem: https://github.com/rubygems/rubygems/issues/730
checkPhase = ":";
} // fix)
buildRubyGem (fixedAttrs // { inherit gemPath; })
);
fixes = {

View file

@ -48,11 +48,7 @@ in ruby.stdenv.mkDerivation (attrs // {
fi
'';
checkPhase = ''
runHook preCheck
${attrs.checkPhase or "${rake}/bin/rake spec"}
runHook postCheck
'';
checkPhase = "true";
buildPhase = ''
runHook preBuild