Created
August 27, 2023 22:15
-
-
Save Qyriad/211fc88293dec3d84b29898a6c64ac2f to your computer and use it in GitHub Desktop.
Homebrew patch to show output of build commands (or other subprocs), and to *not* set `-DCMAKE_VERBOSE_MAKEFILE` unless `-v` is passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/Library/Homebrew/env_config.rb b/Library/Homebrew/env_config.rb | |
| index 03bb33852..5eadae8ff 100644 | |
| --- a/Library/Homebrew/env_config.rb | |
| +++ b/Library/Homebrew/env_config.rb | |
| @@ -399,6 +399,10 @@ module Homebrew | |
| SUDO_ASKPASS: { | |
| description: "If set, pass the `-A` option when calling `sudo`(8).", | |
| }, | |
| + HOMEBREW_KEEP_OUTPUT: { | |
| + description: "If set, system commands run by Homebrew will not have their output suppressed.", | |
| + boolean: true, | |
| + }, | |
| all_proxy: { | |
| description: "Use this SOCKS5 proxy for `curl`(1), `git`(1) and `svn`(1) when downloading through Homebrew.", | |
| }, | |
| diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb | |
| index 44240c9d9..e6118e678 100644 | |
| --- a/Library/Homebrew/formula.rb | |
| +++ b/Library/Homebrew/formula.rb | |
| @@ -1653,11 +1653,12 @@ class Formula | |
| -DCMAKE_INSTALL_LIBDIR=#{install_libdir} | |
| -DCMAKE_BUILD_TYPE=Release | |
| -DCMAKE_FIND_FRAMEWORK=#{find_framework} | |
| - -DCMAKE_VERBOSE_MAKEFILE=ON | |
| -Wno-dev | |
| -DBUILD_TESTING=OFF | |
| ] | |
| + args << "-DCMAKE_VERBOSE_MAKEFILE=ON" if verbose? | |
| + | |
| # Avoid false positives for clock_gettime support on 10.11. | |
| # CMake cache entries for other weak symbols may be added here as needed. | |
| args << "-DHAVE_CLOCK_GETTIME:INTERNAL=0" if MacOS.version == "10.11" && MacOS::Xcode.version >= "8.0" | |
| @@ -2678,7 +2679,7 @@ class Formula | |
| log.puts Time.now, "", cmd, args, "" | |
| log.flush | |
| - if verbose? | |
| + if verbose? || Homebrew::EnvConfig.keep_output? | |
| rd, wr = IO.pipe | |
| begin | |
| pid = fork do |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment