1#!/bin/bash 2 3set -euo pipefail 4 5# If no vectors are specified, use the original-vector by default 6# input config 7RES_SRC_LOCATION="resources" 8PACKAGE_SRC_LOCATION="$RES_SRC_LOCATION/osx-vst2" 9 10SVG_SRC_LOCATION="assets/SurgeClassic/exported" 11FONT_SRC_LOCATION="$RES_SRC_LOCATION/fonts" 12 13BUNDLE_RES_SRC_LOCATION="$RES_SRC_LOCATION/osx-resources" 14EXEC_LOCATION="$1" 15#EXEC_LOCATION="target/vst2/Debug/Surge-Debug.dylib" 16 17# output configs 18OUTPUT_DIR="$2" 19BUNDLE_NAME="Surge.vst" 20BUNDLE_DIR="$OUTPUT_DIR/$BUNDLE_NAME" 21EXEC_TARGET_NAME="Surge" 22 23echo Creating VST Bundle... 24 25# create basic bundle structure 26 27if test -d "$BUNDLE_DIR"; then 28 rm -rf "$BUNDLE_DIR" 29fi 30 31mkdir -p "$BUNDLE_DIR/Contents/MacOS" 32 33# copy executable 34cp "$EXEC_LOCATION" "$BUNDLE_DIR/Contents/MacOS/$EXEC_TARGET_NAME" 35 36# copy Info.plist and PkgInfo 37cp $PACKAGE_SRC_LOCATION/* "$BUNDLE_DIR/Contents/" 38 39# copy bundle resources 40cp -R "$BUNDLE_RES_SRC_LOCATION" "$BUNDLE_DIR/Contents/Resources" 41 42mkdir "$BUNDLE_DIR/Contents/Resources/svg" 43cp $SVG_SRC_LOCATION/*svg "$BUNDLE_DIR/Contents/Resources/svg" 44 45mkdir "$BUNDLE_DIR/Contents/Resources/fonts"; 46cp $FONT_SRC_LOCATION/* "$BUNDLE_DIR/Contents/Resources/fonts"; 47 48