From 53ed144c1f511d14f7e5e109cb901a62625eb577 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 4 Mar 2022 16:07:57 -0800 Subject: [PATCH] Set DYLD search path for homebrew libs on macOS --- adafruit_platformdetect/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/adafruit_platformdetect/__init__.py b/adafruit_platformdetect/__init__.py index 018f72e2..f3ef195a 100644 --- a/adafruit_platformdetect/__init__.py +++ b/adafruit_platformdetect/__init__.py @@ -5,11 +5,17 @@ """ Attempt to detect the current platform. """ +import os import re +import sys from typing import Optional + from .board import Board from .chip import Chip +# Needed to find libs (like libusb) installed by homebrew on Apple Silicon +if sys.platform == "darwin": + os.environ["DYLD_FALLBACK_LIBRARY_PATH"] = "/opt/homebrew/lib/" # Various methods here may retain state in future, so tell pylint not to worry # that they don't use self right now: