From e9eda43928d5c34275ae4679c82046e71078007b Mon Sep 17 00:00:00 2001 From: zimbatm Date: Sun, 24 Jan 2016 22:48:26 +0000 Subject: [PATCH] buildRubyGem: fix missing libobjc in darwin This was preventing any ruby gem with a c extension to build. mkmf would fail with a misleading error: /nix/store/dmkcai8fnv21qxiasx628nim3mq4r4wg-ruby-2.2.3-p0/lib/ruby/2.2.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first. --- .../development/interpreters/ruby/build-ruby-gem/default.nix | 4 +++- pkgs/development/interpreters/ruby/gemconfig/default.nix | 5 ----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/pkgs/development/interpreters/ruby/build-ruby-gem/default.nix b/pkgs/development/interpreters/ruby/build-ruby-gem/default.nix index d050faca2454..c5b9fba37aa0 100644 --- a/pkgs/development/interpreters/ruby/build-ruby-gem/default.nix +++ b/pkgs/development/interpreters/ruby/build-ruby-gem/default.nix @@ -18,7 +18,8 @@ # Normal gem packages can be used outside of bundler; a binstub is created in # $out/bin. -{ lib, ruby, rubygems, bundler, fetchurl, fetchgit, makeWrapper, git, buildRubyGem +{ lib, ruby, rubygems, bundler, fetchurl, fetchgit, makeWrapper, git, + buildRubyGem, darwin } @ defs: lib.makeOverridable ( @@ -85,6 +86,7 @@ stdenv.mkDerivation (attrs // { buildInputs = [ ruby rubygems makeWrapper ] ++ lib.optionals (type == "git") [ git bundler ] + ++ lib.optional stdenv.isDarwin darwin.libobjc ++ buildInputs; name = attrs.name or (namePrefix + gemName); diff --git a/pkgs/development/interpreters/ruby/gemconfig/default.nix b/pkgs/development/interpreters/ruby/gemconfig/default.nix index ae8c0ee6e6ad..787c3be54e35 100644 --- a/pkgs/development/interpreters/ruby/gemconfig/default.nix +++ b/pkgs/development/interpreters/ruby/gemconfig/default.nix @@ -79,7 +79,6 @@ in "--with-exslt-lib=${libxslt}/lib" "--with-exslt-include=${libxslt}/include" ] ++ lib.optional stdenv.isDarwin "--with-iconv-dir=${libiconv}"; - buildInputs = lib.optional stdenv.isDarwin darwin.libobjc; }; patron = attrs: { @@ -143,10 +142,6 @@ in ''; }; - unf_ext = attrs: { - buildInputs = lib.optional stdenv.isDarwin darwin.libobjc; - }; - xapian-ruby = attrs: { # use the system xapian dontBuild = false;