Skip to content

Commit e2b403e

Browse files
author
Bastian Bechtold
committed
fix bug in setup.py on macOS
where the machine was incorrectly identified.
1 parent b1271c7 commit e2b403e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

setup.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
#!/usr/bin/env python
22
import os
3-
from platform import architecture
3+
from platform import architecture, machine
44
from setuptools import setup
55
from setuptools.command.test import test as TestCommand
66
import sys
77

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

1219
if platform == 'darwin':
1320
libname = 'libsndfile_' + architecture0 + '.dylib'

0 commit comments

Comments
 (0)