Skip to content

Instantly share code, notes, and snippets.

@sptndc
Last active February 14, 2026 05:28
Show Gist options
  • Select an option

  • Save sptndc/ee67db7a37896bfb3fcd8b3a3666dd9c to your computer and use it in GitHub Desktop.

Select an option

Save sptndc/ee67db7a37896bfb3fcd8b3a3666dd9c to your computer and use it in GitHub Desktop.
Homebrew GnuTLS v3.8.12 fixes a patch on macOS 12.7.6
diff --git a/lib/crau/crau.h b/lib/crau/crau.h
index 53d33555b..0d4f9f13e 100644
--- a/lib/crau/crau.h
+++ b/lib/crau/crau.h
@@ -251,10 +251,9 @@ void crau_data(struct crau_context_stack_st *stack, ...)
# else
# ifndef CRAU_MAYBE_UNUSED
-# if defined(__has_c_attribute)
-# if __has_c_attribute (__maybe_unused__)
-# define CRAU_MAYBE_UNUSED [[__maybe_unused__]]
-# endif
+# if defined(__has_c_attribute) && \
+ __has_c_attribute (__maybe_unused__)
+# define CRAU_MAYBE_UNUSED [[__maybe_unused__]]
# elif defined(__GNUC__)
# define CRAU_MAYBE_UNUSED __attribute__((__unused__))
# endif
@sptndc
Copy link
Author

sptndc commented Feb 13, 2026

Alright, that's the same error I got @kalaws.

  1. You must edit Homebrew's gnutls formula by running the command brew edit gnutls.
  2. Add the code below before def install:
  patch do
    url "https://gist.githubusercontent.com/sptndc/ee67db7a37896bfb3fcd8b3a3666dd9c/raw/caede2f8c6f286e9694499ad065f02b3df701770/3.8.12-crau.h.patch"
    sha256 "e776e8f3022266b751d8ea1f6d87ed98f882802a17121f3837b10a03456f691b"
  end
  1. Run the command with HOMEBREW_NO_INSTALL_FROM_API=1 brew install gnutls if installing for the first time or HOMEBREW_NO_INSTALL_FROM_API=1 brew upgrade gnutls if you want to update gnutls.

I hope this helps!

@kalaws
Copy link

kalaws commented Feb 13, 2026

Thank you, worked like a charm!

@sptndc
Copy link
Author

sptndc commented Feb 13, 2026

Glad to hear that it fixed the installation of GnuTLS v3.8.12 for you too!

@kalaws
Copy link

kalaws commented Feb 13, 2026

I don't suppose it was virt-viewer you were installing as well? Now I'm struggling with gstreamer complaining about SSL certificate ....

@sptndc
Copy link
Author

sptndc commented Feb 14, 2026

Hi @kalaws, no I didn't install it, you'd better ask in Homebrew's Discussions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment