Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions pkgs/development/ruby-modules/gem/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# Normal gem packages can be used outside of bundler; a binstub is created in
# $out/bin.

{ lib, fetchurl, fetchgit, makeWrapper, gitMinimal, darwin
{ lib, fetchurl, fetchgit, makeWrapper, gitMinimal, libobjc
, ruby, bundler
} @ defs:

Expand All @@ -35,6 +35,7 @@ lib.makeOverridable (
, namePrefix ? (let
rubyName = builtins.parseDrvName ruby.name;
in "${rubyName.name}${rubyName.version}-")
, nativeBuildInputs ? []
, buildInputs ? []
, meta ? {}
, patches ? []
Expand Down Expand Up @@ -87,11 +88,15 @@ stdenv.mkDerivation ((builtins.removeAttrs attrs ["source"]) // {
inherit dontStrip;
inherit type;

buildInputs = [
nativeBuildInputs = [
ruby makeWrapper
] ++ lib.optionals (type == "git") [ gitMinimal ]
++ lib.optionals (type != "gem") [ bundler ]
++ lib.optional stdenv.isDarwin darwin.libobjc
++ nativeBuildInputs;

buildInputs = [
ruby
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't ruby be in the nativeBuildInputs only?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't ruby be in the nativeBuildInputs only?

ruby contains libraries and addGemPath,addRubyLibPath envHooks which add paths from buildInputs to GEM_PATH and RUBYLIB

] ++ lib.optionals stdenv.isDarwin [ libobjc ]
++ buildInputs;

#name = builtins.trace (attrs.name or "no attr.name" ) "${namePrefix}${gemName}-${version}";
Expand Down
4 changes: 3 additions & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14584,7 +14584,9 @@ with pkgs;

inherit (ocamlPackages) reason;

buildRubyGem = callPackage ../development/ruby-modules/gem { };
buildRubyGem = callPackage ../development/ruby-modules/gem {
inherit (darwin) libobjc;
};
defaultGemConfig = callPackage ../development/ruby-modules/gem-config {
inherit (darwin) DarwinTools cctools;
inherit (darwin.apple_sdk.frameworks) CoreServices;
Expand Down