Skip to content

Commit 8b61f50

Browse files
committed
Fix post_build script to work for dist builds
1 parent ff5444a commit 8b61f50

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@
3838
zip_safe = True
3939

4040

41-
def post_install():
41+
def post_build(output_path):
4242
if system == 'Darwin':
4343
# Bizarrely, on macOS, there doesn't seem to be another way to do this: you MUST use install_name_tool
4444
import subprocess
4545
# It could be either of these, so try both
46-
subprocess.run(["install_name_tool", "-change", "/usr/local/lib/libportaudio.dylib", "@rpath/libportaudio.dylib", "./_sounddevice.abi3.so"])
47-
subprocess.run(["install_name_tool", "-change", "/usr/local/lib/libportaudio.2.dylib", "@rpath/libportaudio.dylib", "./_sounddevice.abi3.so"])
46+
subprocess.run(["install_name_tool", "-change", "/usr/local/lib/libportaudio.dylib", "@rpath/libportaudio.dylib", output_path])
47+
subprocess.run(["install_name_tool", "-change", "/usr/local/lib/libportaudio.2.dylib", "@rpath/libportaudio.dylib", output_path])
4848

4949

5050
try:
@@ -75,7 +75,7 @@ class PostBuildCommand(build_ext):
7575

7676
def run(self):
7777
build_ext.run(self)
78-
post_install()
78+
post_build(self.get_ext_fullpath('_sounddevice'))
7979

8080

8181
cmdclass['build_ext'] = PostBuildCommand

0 commit comments

Comments
 (0)