Skip to content
This repository has been archived by the owner on Jul 29, 2023. It is now read-only.

MacOS test #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ bin/
target/
.DS_Store
Cargo.lock
/Synth.vst
9 changes: 9 additions & 0 deletions build_example_full_mac.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

VST_NAME=Synth

sudo rm -rf "$VST_NAME.vst"
sudo rm -rf "/Library/Audio/Plug-Ins/VST/$VST_NAME.vst"
cargo build --example=synth --release
sudo ./bundle_example_mac.sh
sudo cp -R "$VST_NAME.vst" /Library/Audio/Plug-Ins/VST
59 changes: 59 additions & 0 deletions bundle_example_mac.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/bin/bash

# Modified lightly from
# https://github.com/RustAudio/vst-rs/blob/master/osx_vst_bundler.sh

VST_NAME=Synth
BUILD_OUTPUT=target/release/examples/libsynth.dylib

# Make the bundle folder
mkdir -p "$VST_NAME.vst/Contents/MacOS"

# Create the PkgInfo
echo "BNDL????" > "$VST_NAME.vst/Contents/PkgInfo"

# Build the Info.Plist
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
<plist version=\"1.0\">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>

<key>CFBundleExecutable</key>
<string>$VST_NAME</string>

<key>CFBundleGetInfoString</key>
<string>vst</string>

<key>CFBundleIconFile</key>
<string></string>

<key>CFBundleIdentifier</key>
<string>com.example.$VST_NAME</string>

<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>

<key>CFBundleName</key>
<string>$VST_NAME</string>

<key>CFBundlePackageType</key>
<string>BNDL</string>

<key>CFBundleVersion</key>
<string>1.0</string>

<key>CFBundleSignature</key>
<string>$((RANDOM % 9999))</string>

<key>CSResourcesFileMapped</key>
<string></string>

</dict>
</plist>" > "$VST_NAME.vst/Contents/Info.plist"

# Move the provided library to the correct location
cp "$BUILD_OUTPUT" "$VST_NAME.vst/Contents/MacOS/$VST_NAME"

echo "Created bundle $VST_NAME.vst"