various fixes

This commit is contained in:
Charles Strahan 2014-10-29 23:14:19 +00:00
parent d5b3a6d508
commit 845fed122a
4 changed files with 20 additions and 10 deletions

View File

@ -18,7 +18,7 @@
# (to make gems behave if necessary).
{ lib, fetchurl, writeScript, ruby, libxml2, libxslt, python, stdenv, which
, libiconv, postgresql, v8_3_16_14, clang }:
, libiconv, postgresql, v8_3_16_14, clang, sqlite, zlib, imagemagick, pkgconfig}:
let
v8 = v8_3_16_14;

View File

@ -1,4 +1,4 @@
{ ruby, fetchurl, rake, rubygemsFun, makeWrapper, lib, git }:
{ ruby, fetchurl, rubygemsFun, makeWrapper, lib, git }:
{ name
, namePrefix ? "${ruby.name}" + "-"

View File

@ -1,4 +1,4 @@
{ pkgs, lib, callPackage, gemFixes }:
{ pkgs, lib, callPackage, gemFixes, fetchurl }:
{ gemset, ruby ? pkgs.ruby, fixes ? gemFixes }@args:
@ -7,19 +7,31 @@ let
buildRubyGem = callPackage ./gem.nix { inherit ruby; };
instantiate = (name: attrs:
fetchers.gem = attrs: fetchurl {
url = "${attrs.src.source or "https://rubygems.org"}/downloads/${attrs.name}-${attrs.version}.gem";
inherit (attrs.src) sha256;
};
instantiate = (attrs:
let
gemPath = map (name: gemset''."${name}") (attrs.dependencies or []);
fixedAttrs = attrs // (fixes."${name}" or (const {})) attrs;
fixedAttrs = attrs // (fixes."${attrs.name}" or (const {})) attrs;
in
buildRubyGem (fixedAttrs // { name = "${name}-${attrs.version}"; inherit gemPath; })
buildRubyGem (
fixedAttrs // {
name = "${attrs.name}-${attrs.version}";
src = fetchers."${attrs.src.type}" attrs;
inherit gemPath;
}
)
);
gemset' = if builtins.isAttrs gemset then gemset else callPackage gemset { };
gemset'' = lib.flip lib.mapAttrs gemset' (name: attrs:
if (lib.isDerivation attrs) then attrs
else (instantiate name attrs)
if (lib.isDerivation attrs)
then attrs
else instantiate (attrs // { inherit name; })
);
in gemset''

View File

@ -4049,8 +4049,6 @@ let
loadRubyEnv = callPackage ../development/interpreters/ruby/load-ruby-env.nix { };
rake = ... # TODO
rubySqlite3 = callPackage ../development/ruby-modules/sqlite3 { };
rubygemsFun = ruby: builderDefsPackage (import ../development/interpreters/ruby/rubygems.nix) {