Skip to content

Commit

Permalink
fix bug in setup.py on macOS
Browse files Browse the repository at this point in the history
where the machine was incorrectly identified.
  • Loading branch information
Bastian Bechtold committed Feb 9, 2023
1 parent b1271c7 commit e2b403e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
#!/usr/bin/env python
import os
from platform import architecture
from platform import architecture, machine
from setuptools import setup
from setuptools.command.test import test as TestCommand
import sys

# environment variables for cross-platform package creation
platform = os.environ.get('PYSOUNDFILE_PLATFORM', sys.platform)
architecture0 = os.environ.get('PYSOUNDFILE_ARCHITECTURE', architecture()[0])
architecture0 = os.environ.get('PYSOUNDFILE_ARCHITECTURE')
if architecture0 is None:
# follow the same decision tree as in soundfile.py after
# _find_library('sndfile') fails:
if sys.platform == 'win32':
architecture0 = architecture()[0] # 64bit or 32bit
else:
architecture0 = machine() # x86_64 or arm64

if platform == 'darwin':
libname = 'libsndfile_' + architecture0 + '.dylib'
Expand Down

0 comments on commit e2b403e

Please sign in to comment.