From da134c37f20e70e1c1059e85b98c75e43a3b164d Mon Sep 17 00:00:00 2001 From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Date: Tue, 1 Feb 2022 13:01:32 +0800 Subject: [PATCH] plotutils: fix erroneous use of the `-flat_namespace` flag None of our usual patches apply to their `configure` script, but, conveniently, we don't need one if we set `MACOSX_DEPLOYMENT_TARGET` appropriately. Let's also pass `--without-x` on macOS to avoid opportunistic linkage with X11 libraries. This is needed for bottling on Monterey. See #94212. --- Formula/plotutils.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Formula/plotutils.rb b/Formula/plotutils.rb index 3a8680d51090a..18aeb7b2591c5 100644 --- a/Formula/plotutils.rb +++ b/Formula/plotutils.rb @@ -30,6 +30,9 @@ def install # Fix usage of libpng to be 1.5 compatible inreplace "libplot/z_write.c", "png_ptr->jmpbuf", "png_jmpbuf (png_ptr)" + # Avoid `-flat_namespace` flag. + ENV["MACOSX_DEPLOYMENT_TARGET"] = MacOS.version.to_s + args = %W[ --disable-debug --disable-dependency-tracking @@ -37,6 +40,8 @@ def install --prefix=#{prefix} --enable-libplotter ] + # Prevent opportunistic linkage to X11 + args << "--without-x" if OS.mac? system "./configure", *args system "make"