-
Notifications
You must be signed in to change notification settings - Fork 19
/
osx-bundler.sh
executable file
·51 lines (45 loc) · 1.54 KB
/
osx-bundler.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash -e
# Make sure we have the arguments we need
if [[ -z $1 || -z $2 ]]; then
echo "Generates a macOS bundle from a compiled dylib file"
echo "Example:"
echo -e "\t$0 Plugin target/release/plugin.dylib"
echo -e "\tCreates a Plugin.vst3 bundle"
else
# Make the bundle folder
mkdir -p "target/debug/$1.vst3/Contents/MacOS"
# Create the PkgInfo
echo "BNDL????" > "target/debug/$1.vst3/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>$1</string>
<key>CFBundleGetInfoString</key>
<string>vst3</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.rust-vst.$1</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$1</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>" > "target/debug/$1.vst3/Contents/Info.plist"
# move the provided library to the correct location
cp "$2" "target/debug/$1.vst3/Contents/MacOS/$1"
echo "Created bundle target/debug/$1.vst3"
fi