Skip to content

Commit

Permalink
Merge pull request #175871 from Artturin/fixcross1
Browse files Browse the repository at this point in the history
buildRubyGem: fix bundix cross
  • Loading branch information
marsam authored Jul 2, 2022
2 parents 4ac46f5 + 6b8ce2a commit ce577b8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
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
] ++ 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 @@ -14836,7 +14836,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

0 comments on commit ce577b8

Please sign in to comment.