diff --git a/PortAudioSharp/PortAudioSharp.csproj b/PortAudioSharp/PortAudioSharp.csproj index 0072f49..1a76a93 100644 --- a/PortAudioSharp/PortAudioSharp.csproj +++ b/PortAudioSharp/PortAudioSharp.csproj @@ -2,7 +2,7 @@ netstandard2.0;netcoreapp3.1;net6.0;net7.0 - linux-x64;osx-x64;win-x64 + linux-x64;osx-x64;osx-arm64;win-x64 README.md @@ -31,6 +31,7 @@ + diff --git a/scripts/generate.py b/scripts/generate.py index ddc5281..670e579 100755 --- a/scripts/generate.py +++ b/scripts/generate.py @@ -38,17 +38,17 @@ def process_linux(s): f.write(s) -def process_macos(s): +def process_macos(s, arch): libs = "libportaudio.dylib" d = get_dict() - d["dotnet_rid"] = "osx-x64" + d["dotnet_rid"] = f"osx-{arch}" d["libs"] = libs environment = jinja2.Environment() template = environment.from_string(s) s = template.render(**d) - with open("./macos/portaudio.runtime.csproj", "w") as f: + with open(f"./macos-{arch}/portaudio.runtime.csproj", "w") as f: f.write(s) @@ -68,7 +68,8 @@ def process_windows(s): def main(): s = read_proj_file("./portaudio.csproj.runtime.in") - process_macos(s) + process_macos(s, "x64") + process_macos(s, "arm64") process_linux(s) process_windows(s) diff --git a/scripts/run.sh b/scripts/run.sh index 7247e40..49485a0 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -3,10 +3,11 @@ set -ex -mkdir -p macos linux windows all +mkdir -p macos-x64 macos-arm64 linux windows all rm -rf packages -cp -v ./libportaudio.dylib ./macos +cp -v ./libportaudio.dylib ./macos-x64 +cp -v ./libportaudio.dylib ./macos-arm64 cp -v ./libportaudio.so ./linux cp -v ./portaudio.dll ./windows @@ -17,7 +18,12 @@ dotnet build -c Release dotnet pack -c Release -o ../../PortAudioSharp/packages popd -pushd macos +pushd macos-x64 +dotnet build -c Release +dotnet pack -c Release -o ../../PortAudioSharp/packages +popd + +pushd macos-arm64 dotnet build -c Release dotnet pack -c Release -o ../../PortAudioSharp/packages popd