diff --git a/Formula/t/tectonic.rb b/Formula/t/tectonic.rb index 539bfba7f298..a384b5791dcd 100644 --- a/Formula/t/tectonic.rb +++ b/Formula/t/tectonic.rb @@ -38,8 +38,11 @@ class Tectonic < Formula def install ENV.cxx11 - ENV["MACOSX_DEPLOYMENT_TARGET"] = MacOS.version.to_s # needed for CLT-only builds - ENV.delete("HOMEBREW_SDKROOT") if MacOS.version == :high_sierra + + if OS.mac? + ENV["MACOSX_DEPLOYMENT_TARGET"] = MacOS.version.to_s # needed for CLT-only builds + ENV.delete("HOMEBREW_SDKROOT") if MacOS.version == :high_sierra + end # Ensure that the `openssl` crate picks up the intended library. # https://crates.io/crates/openssl#manual-configuration diff --git a/Formula/t/tmux.rb b/Formula/t/tmux.rb index feeb8df2246b..ce2ba4323546 100644 --- a/Formula/t/tmux.rb +++ b/Formula/t/tmux.rb @@ -68,12 +68,16 @@ def install --sysconfdir=#{etc} ] - # tmux finds the `tmux-256color` terminfo provided by our ncurses - # and uses that as the default `TERM`, but this causes issues for - # tools that link with the very old ncurses provided by macOS. - # https://github.com/Homebrew/homebrew-core/issues/102748 - args << "--with-TERM=screen-256color" if OS.mac? - args << "--enable-utf8proc" if MacOS.version >= :high_sierra || OS.linux? + if OS.mac? + # tmux finds the `tmux-256color` terminfo provided by our ncurses + # and uses that as the default `TERM`, but this causes issues for + # tools that link with the very old ncurses provided by macOS. + # https://github.com/Homebrew/homebrew-core/issues/102748 + args << "--with-TERM=screen-256color" + args << "--enable-utf8proc" if MacOS.version >= :high_sierra + else + args << "--enable-utf8proc" + end ENV.append "LDFLAGS", "-lresolv" system "./configure", *args diff --git a/Formula/t/trafficserver.rb b/Formula/t/trafficserver.rb index d6e3e886436f..03c002512fbe 100644 --- a/Formula/t/trafficserver.rb +++ b/Formula/t/trafficserver.rb @@ -49,7 +49,7 @@ class Trafficserver < Formula def install # Per https://luajit.org/install.html: If MACOSX_DEPLOYMENT_TARGET # is not set then it's forced to 10.4, which breaks compile on Mojave. - ENV["MACOSX_DEPLOYMENT_TARGET"] = MacOS.version.to_s + ENV["MACOSX_DEPLOYMENT_TARGET"] = MacOS.version.to_s if OS.mac? args = %W[ --prefix=#{prefix} diff --git a/Formula/t/travis.rb b/Formula/t/travis.rb index 5da38c5679cf..583663cb385b 100644 --- a/Formula/t/travis.rb +++ b/Formula/t/travis.rb @@ -184,7 +184,7 @@ class Travis < Formula def install ENV["GEM_HOME"] = libexec # gem issue on Mojave - ENV["SDKROOT"] = MacOS.sdk_path if MacOS.version == :mojave + ENV["SDKROOT"] = MacOS.sdk_path if OS.mac? && MacOS.version == :mojave resources.each do |r| r.fetch diff --git a/Formula/t/tta.rb b/Formula/t/tta.rb index 94db75ab5a14..96b5712bfa82 100644 --- a/Formula/t/tta.rb +++ b/Formula/t/tta.rb @@ -29,7 +29,14 @@ class Tta < Formula def install args = ["--disable-silent-rules"] - args << "--enable-#{MacOS.version.requires_sse4? ? "sse4" : "sse2"}" if Hardware::CPU.intel? + if Hardware::CPU.intel? + sse = if OS.mac? && MacOS.version.requires_sse4? + "sse4" + else + "sse2" + end + args << "--enable-#{sse}" + end system "./configure", *std_configure_args, *args system "make", "install" diff --git a/Formula/v/v8@3.15.rb b/Formula/v/v8@3.15.rb index 35fea8aca087..5dfc192d4cb2 100644 --- a/Formula/v/v8@3.15.rb +++ b/Formula/v/v8@3.15.rb @@ -28,7 +28,8 @@ class V8AT315 < Formula def install # Bully GYP into correctly linking with c++11 ENV.cxx11 - ENV["GYP_DEFINES"] = "clang=1 mac_deployment_target=#{MacOS.version}" + ENV["GYP_DEFINES"] = "clang=1 mac_deployment_target=#{MacOS.version}" if OS.mac? + (buildpath/"build/gyp").install resource("gyp") # fix up libv8.dylib install_name diff --git a/Formula/v/vorbis-tools.rb b/Formula/v/vorbis-tools.rb index da08d8664f5d..4fce54eaa1b4 100644 --- a/Formula/v/vorbis-tools.rb +++ b/Formula/v/vorbis-tools.rb @@ -47,15 +47,15 @@ class VorbisTools < Formula end def install - # Prevent linkage with Homebrew Curl on macOS because of `using: :homebrew_curl` above. if OS.mac? + # Prevent linkage with Homebrew Curl on macOS because of `using: :homebrew_curl` above. ENV.remove "HOMEBREW_DEPENDENCIES", "curl" ENV.remove "HOMEBREW_INCLUDE_PATHS", Formula["curl"].opt_include ENV.remove "HOMEBREW_LIBRARY_PATHS", Formula["curl"].opt_lib - end - # Workaround for Xcode 14 ld. - system "autoreconf", "--force", "--install", "--verbose" if MacOS.version >= :monterey + # Workaround for Xcode 14 ld. + system "autoreconf", "--force", "--install", "--verbose" if MacOS.version >= :monterey + end # Fix compile with newer Clang ENV.append_to_cflags "-Wno-implicit-function-declaration" if DevelopmentTools.clang_build_version >= 1403 diff --git a/Formula/v/vrpn.rb b/Formula/v/vrpn.rb index 4adeaac0dc22..76b9b6482bf3 100644 --- a/Formula/v/vrpn.rb +++ b/Formula/v/vrpn.rb @@ -24,10 +24,13 @@ class Vrpn < Formula def install mkdir "build" do - system "cmake", "..", *std_cmake_args, - "-DCMAKE_OSX_SYSROOT=#{MacOS.sdk_path}", - "-DVRPN_BUILD_CLIENTS:BOOL=OFF", - "-DVRPN_BUILD_JAVA:BOOL=OFF" + cmake_args = [ + "-DVRPN_BUILD_CLIENTS:BOOL=OFF", + "-DVRPN_BUILD_JAVA:BOOL=OFF", + ] + cmake_args << "-DCMAKE_OSX_SYSROOT=#{MacOS.sdk_path}" if OS.mac? + + system "cmake", "..", *std_cmake_args, *cmake_args system "make", "install" end end diff --git a/Formula/w/wrk.rb b/Formula/w/wrk.rb index 874f612d14d4..697ed4a5b31f 100644 --- a/Formula/w/wrk.rb +++ b/Formula/w/wrk.rb @@ -34,7 +34,7 @@ class Wrk < Formula def install ENV.deparallelize - ENV["MACOSX_DEPLOYMENT_TARGET"] = MacOS.version.to_s + ENV["MACOSX_DEPLOYMENT_TARGET"] = MacOS.version.to_s if OS.mac? ENV.append_to_cflags "-I#{Formula["luajit"].opt_include}/luajit-2.1" args = %W[ WITH_LUAJIT=#{Formula["luajit"].opt_prefix} diff --git a/Formula/y/yaws.rb b/Formula/y/yaws.rb index a4f36914b2bf..2192a97f6bfa 100644 --- a/Formula/y/yaws.rb +++ b/Formula/y/yaws.rb @@ -40,12 +40,13 @@ class Yaws < Formula skip_clean "lib/yaws/examples/include" def install - # Ensure pam headers are found on Xcode-only installs - extra_args = %W[ - --with-extrainclude=#{MacOS.sdk_path}/usr/include/security - ] - if OS.linux? - extra_args = %W[ + extra_args = if OS.mac? + # Ensure pam headers are found on Xcode-only installs + %W[ + --with-extrainclude=#{MacOS.sdk_path}/usr/include/security + ] + else + %W[ --with-extrainclude=#{Formula["linux-pam"].opt_include}/security ] end diff --git a/Formula/z/zeromq.rb b/Formula/z/zeromq.rb index 2dd393cf17bd..7235410c7086 100644 --- a/Formula/z/zeromq.rb +++ b/Formula/z/zeromq.rb @@ -37,7 +37,7 @@ class Zeromq < Formula def install # Work around "error: no member named 'signbit' in the global namespace" - if MacOS.version == :high_sierra + if OS.mac? && MacOS.version == :high_sierra ENV.delete("HOMEBREW_SDKROOT") ENV.delete("SDKROOT") end