]> Repositories - Adafruit_Blinka-hackapet.git/blobdiff - setup.py
Blinka will work with i2c-3 enabled with no code changes!
[Adafruit_Blinka-hackapet.git] / setup.py
index 7663c15e1b50c8421ff4d1ce6b05a34f388dae29..a8f9b1c73c985d098428c274cc153ff2d41eeb37 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -17,6 +17,18 @@ here = os.path.abspath(os.path.dirname(__file__))
 with io.open(os.path.join(here, 'README.rst'), encoding='utf-8') as f:
     long_description = '\n' + f.read()
 
+board_reqs = []
+if os.path.exists('/proc/device-tree/compatible'):
+    with open('/proc/device-tree/compatible', 'rb') as f:
+        compat = f.read()
+    if b'nvidia,tegra' in compat:
+        board_reqs = ['Jetson.GPIO']
+    if b'brcm,bcm2835' in compat or \
+       b'brcm,bcm2836' in compat or \
+       b'brcm,bcm2837' in compat or \
+       b'brcm,bcm2838' in compat:
+        board_reqs = ['RPi.GPIO', 'rpi_ws281x>=4.0.0']
+
 setup(
     name='Adafruit-Blinka',
     use_scm_version=True,
@@ -37,11 +49,9 @@ setup(
     install_requires=[
         "Adafruit-PlatformDetect",
         "Adafruit-PureIO",
-        "RPi.GPIO; platform_machine=='armv7l' or platform_machine=='armv6l'",
-        "rpi_ws281x>=4.0.0; platform_machine=='armv7l' or platform_machine=='armv6l'",
-        "spidev; sys_platform=='linux'",
-        "sysv_ipc"
-    ],
+        "spidev>=3.4; sys_platform=='linux'",
+        "sysv_ipc; platform_system != 'Windows'"
+    ] + board_reqs,
     license='MIT',
     classifiers=[
         # Trove classifiers