From 89fe201ad9751c31c60d943d46e73dc28187852f Mon Sep 17 00:00:00 2001 From: Michael Cho Date: Sat, 12 Oct 2024 18:02:25 -0400 Subject: [PATCH] extend/ENV/super: use brew libs for some Python packages This avoids using bundled libraries for: * `hidapi`[^1] * `pynacl`[^2] * `pyzmq`[^3] The build should now fail if dependency is missing. Essentially reverses default so now that using bundled copy is now opt-in via `ENV` modification, e.g. `ENV.delete "SODIUM_INSTALL"` [^1]: https://github.com/trezor/cython-hidapi/blob/0.14.0.post2/setup.py#L229 [^2]: https://github.com/pyca/pynacl/blob/1.5.0/setup.py#L71-L73 [^3]: https://github.com/zeromq/pyzmq/blob/v26.2.0/CMakeLists.txt#L41-L43 --- Library/Homebrew/extend/ENV/super.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Library/Homebrew/extend/ENV/super.rb b/Library/Homebrew/extend/ENV/super.rb index 89f7ecfa5e654..c21bd3ce846f2 100644 --- a/Library/Homebrew/extend/ENV/super.rb +++ b/Library/Homebrew/extend/ENV/super.rb @@ -93,6 +93,11 @@ def setup_build_environment(formula: nil, cc: nil, build_bottle: false, bottle_a # Prevent Go from automatically downloading a newer toolchain than the one that we have. # https://tip.golang.org/doc/toolchain self["GOTOOLCHAIN"] = "local" + # Prevent Python packages from using bundled libraries by default. + # Currently for hidapi, pyzmq and pynacl + self["HIDAPI_SYSTEM_HIDAPI"] = "1" + self["PYZMQ_NO_BUNDLE"] = "1" + self["SODIUM_INSTALL"] = "system" set_debug_symbols if debug_symbols