From 7e5d965cb79506808b02322a2412e2ec638a4238 Mon Sep 17 00:00:00 2001 From: Yilin Guo Date: Mon, 7 Dec 2020 22:24:40 -0800 Subject: [PATCH] fix gdbm build on ARM Mac --- Formula/python@3.9.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Formula/python@3.9.rb b/Formula/python@3.9.rb index af369992d7d37..3705898b5ebba 100644 --- a/Formula/python@3.9.rb +++ b/Formula/python@3.9.rb @@ -129,6 +129,8 @@ def install end # Avoid linking to libgcc https://mail.python.org/pipermail/python-dev/2012-February/116205.html args << "MACOSX_DEPLOYMENT_TARGET=#{MacOS.version}" + cflags << "-I#{Formula["gdbm"].opt_include}" + ldflags << "-L#{Formula["gdbm"].opt_lib}" # We want our readline! This is just to outsmart the detection code, # superenv makes cc always find includes/libs! @@ -138,6 +140,8 @@ def install inreplace "setup.py" do |s| s.gsub! "sqlite_setup_debug = False", "sqlite_setup_debug = True" + s.gsub! "db_setup_debug = False", "db_setup_debug = True" + s.gsub! "dbm_setup_debug = False", "dbm_setup_debug = True" s.gsub! "for d_ in self.inc_dirs + sqlite_inc_paths:", "for d_ in ['#{Formula["sqlite"].opt_include}']:" end