Merge pull request #13677 from carlocab/python-libexec

ENV/super: add Python's `libexec/"bin"` directory when applicable
This commit is contained in:
Carlo Cabrera 2022-08-15 18:47:02 +08:00 committed by GitHub
commit fb4c6d92bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -130,8 +130,13 @@ module Superenv
sig { returns(T::Array[Pathname]) }
def homebrew_extra_paths
[]
# Reverse sort by version so that we prefer the newest when there are multiple.
deps.select { |d| d.name.match? Version.formula_optionally_versioned_regex(:python) }
.sort_by(&:version)
.reverse
.map { |d| d.opt_libexec/"bin" }
end
alias generic_homebrew_extra_paths homebrew_extra_paths
sig { returns(T.nilable(PATH)) }
def determine_path

View File

@ -26,7 +26,7 @@ module Superenv
end
def homebrew_extra_paths
paths = []
paths = generic_homebrew_extra_paths
paths += %w[binutils make].map do |f|
bin = Formulary.factory(f).opt_bin
bin if bin.directory?