Skip to content

Commit

Permalink
Updated compile.rb to set target version to 10.15; adjusted arm patch
Browse files Browse the repository at this point in the history
  • Loading branch information
uiryuu committed May 28, 2024
1 parent 49da490 commit 3c526eb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions other/compile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def livecheck(package)
end

def setup_rb(package)
system "sd 'def install' 'def install\n\tENV[\"CFLAGS\"] = \"-mmacosx-version-min=10.11\"\n\tENV[\"LDFLAGS\"] = \"-mmacosx-version-min=10.11\"\n\tENV[\"CXXFLAGS\"] = \"-mmacosx-version-min=10.11\"\n' $(brew edit --print-path #{package})"
system "sd 'def install' 'def install\n\tENV[\"CFLAGS\"] = \"-mmacosx-version-min=10.15\"\n\tENV[\"LDFLAGS\"] = \"-mmacosx-version-min=10.15\"\n\tENV[\"CXXFLAGS\"] = \"-mmacosx-version-min=10.15\"\n' $(brew edit --print-path #{package})"
end

def setup_env
Expand All @@ -78,7 +78,7 @@ def setup_env
ENV["HOMEBREW_NO_INSTALL_FROM_API"] = "1"
FileUtils.cd $homebrew_path
system "git reset --hard HEAD"
print "Applying Homebrew patch (MACOSX_DEPLOYMENT_TARGET & oldest CPU)\n"
print "Applying Homebrew patch (MACOSX_DEPLOYMENT_TARGET)\n"
system "git apply #{$current_dir}/#{$homebrew_patch}"
end

Expand All @@ -98,28 +98,28 @@ def reset
p.remove_line 'ENV["MACOSX_DEPLOYMENT_TARGET"] = MacOS.version'
end

# Patch formulas to set deployment target to be 10.11
# Patch formulas to set deployment target to be 10.15
if arch != "arm64"
patch_formula 'libpng', 'luajit', 'glib' do |p|
p.append_after_line 'def install' do
%q(
ENV["CFLAGS"] = "-mmacosx-version-min=10.11"
ENV["LDFLAGS"] = "-mmacosx-version-min=10.11"
ENV["CXXFLAGS"] = "-mmacosx-version-min=10.11"
ENV["CFLAGS"] = "-mmacosx-version-min=10.15"
ENV["LDFLAGS"] = "-mmacosx-version-min=10.15"
ENV["CXXFLAGS"] = "-mmacosx-version-min=10.15"
)
end
end

patch_formula 'rubberband' do |p|
p.append_after_line 'args = ["-Dresampler=libsamplerate"]' do
'args << "-Dcpp_args=-mmacosx-version-min=10.11"'
'args << "-Dcpp_args=-mmacosx-version-min=10.15"'
end
end

patch_formula 'jpeg-xl' do |p|
p.append_after_line 'system "cmake", "-S", ".", "-B", "build",' do
%q(
"-DCMAKE_CXX_FLAGS=-mmacosx-version-min=10.11",
"-DCMAKE_CXX_FLAGS=-mmacosx-version-min=10.15",
"-DCMAKE_CXX_FLAGS='-O2 -fno-sized-deallocation'",
)
end
Expand Down
8 changes: 4 additions & 4 deletions other/homebrew_arm.patch
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
diff --git a/Library/Homebrew/extend/ENV/super.rb b/Library/Homebrew/extend/ENV/super.rb
index 40ef42a4b..1a6eec870 100644
index 6be9069013..55ca7c6bf4 100644
--- a/Library/Homebrew/extend/ENV/super.rb
+++ b/Library/Homebrew/extend/ENV/super.rb
@@ -62,6 +62,7 @@ module Superenv
@@ -60,6 +60,7 @@ module Superenv
super
send(compiler)

+ self["MACOSX_DEPLOYMENT_TARGET"] = "11.0"
self["HOMEBREW_ENV"] = "super"
self["MAKEFLAGS"] ||= "-j#{determine_make_jobs}"
self["PATH"] = determine_path
self["RUSTFLAGS"] = Hardware.rustflags_target_cpu

0 comments on commit 3c526eb

Please sign in to comment.