Skip to content

Commit da75ada

Browse files
committed
setup.py - fix pip install error
1 parent 1e8b26e commit da75ada

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

setup.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import os
22
import re
33
import subprocess
4+
from typing import Union
45

56
from setuptools import Extension, find_packages, setup
67
from setuptools.command.build_ext import build_ext
@@ -73,10 +74,26 @@ def make_distribution(self) -> None:
7374
}
7475

7576

77+
def get_fmod_path(
78+
system: Union["Windows", "Linux", "Darwin"], arch: ["x64", "x86", "arm"]
79+
) -> str:
80+
if system == "Darwin":
81+
# universal dylib
82+
return "lib/FMOD/Darwin/libfmod.dylib"
83+
84+
if system == "Windows":
85+
return f"lib/FMOD/Windows/{arch}/fmod.dll"
86+
87+
if system == "Linux":
88+
if arch == "x64":
89+
arch = "x86_64"
90+
return f"lib/FMOD/Linux/{arch}/libfmod.so"
91+
92+
raise NotImplementedError(f"Unsupported system: {system}")
93+
94+
7695
class BDistWheel(bdist_wheel):
7796
def run(self):
78-
from UnityPy.export.AudioClipConverter import get_fmod_path
79-
8097
platform_tag = self.get_tag()[2]
8198
if platform_tag.startswith("win"):
8299
system = "Windows"

0 commit comments

Comments
 (0)