Skip to content

Commit

Permalink
extconf: respect AR and RANLIB in recipes on darwin
Browse files Browse the repository at this point in the history
When using Nix on Darwin, we ideally should be latching onto the
Nix-provided AR and RANLIB.
  • Loading branch information
joshheinrichs-shopify committed Nov 15, 2024
1 parent e8d30a7 commit 5509cdc
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ext/nokogiri/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,10 @@ def configure
end

if darwin? && !cross_build_p
recipe.configure_options += ["RANLIB=/usr/bin/ranlib", "AR=/usr/bin/ar"]
recipe.configure_options += [
"RANLIB=#{ENV.fetch("RANLIB", "/usr/bin/ranlib")}",
"AR=#{ENV.fetch("AR", "/usr/bin/ar")}",
]
end

if windows?
Expand Down Expand Up @@ -969,7 +972,10 @@ def configure
cflags = concat_flags(ENV["CFLAGS"], "-O2", "-U_FORTIFY_SOURCE", "-g")

if darwin? && !cross_build_p
recipe.configure_options += ["RANLIB=/usr/bin/ranlib", "AR=/usr/bin/ar"]
recipe.configure_options += [
"RANLIB=#{ENV.fetch("RANLIB", "/usr/bin/ranlib")}",
"AR=#{ENV.fetch("AR", "/usr/bin/ar")}",
]
end

if windows?
Expand Down

0 comments on commit 5509cdc

Please sign in to comment.