From 2de2a780f34340fb1d4d88b36006038f4fdc9c3d Mon Sep 17 00:00:00 2001 From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Date: Fri, 20 Sep 2024 19:10:51 +0800 Subject: [PATCH] meson: build an `:all` bottle There are still some stray `/usr/local` and `/opt/homebrew` references that we can make the same across all our bottles. --- Formula/m/meson.rb | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Formula/m/meson.rb b/Formula/m/meson.rb index efcf9b64e4d4..4ed9509cd6be 100644 --- a/Formula/m/meson.rb +++ b/Formula/m/meson.rb @@ -32,18 +32,26 @@ def install # Make the bottles uniform. This also ensures meson checks `HOMEBREW_PREFIX` # for fulfilling dependencies rather than just `/usr/local`. mesonbuild = prefix/Language::Python.site_packages(python3)/"mesonbuild" - inreplace_files = %w[ + usr_local_files = %w[ coredata.py + options.py dependencies/boost.py dependencies/cuda.py dependencies/qt.py scripts/python_info.py utils/universal.py + compilers/mixins/apple.py ].map { |f| mesonbuild/f } - inreplace_files << (bash_completion/"meson") + usr_local_files << (bash_completion/"meson") # Passing `build.stable?` ensures a failed `inreplace` won't fail HEAD installs. - inreplace inreplace_files, "/usr/local", HOMEBREW_PREFIX, build.stable? + inreplace usr_local_files, "/usr/local", HOMEBREW_PREFIX, audit_result: build.stable? + + opt_homebrew_files = %w[dependencies/boost.py compilers/mixins/apple.py].map { |f| mesonbuild/f } + inreplace opt_homebrew_files, "/opt/homebrew", HOMEBREW_PREFIX, audit_result: build.stable? + + # Ensure meson uses our `var` directory. + inreplace mesonbuild/"options.py", "'/var/local", "'#{var}", audit_result: build.stable? end test do