install.sh 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/sh
  2. # Installs LYNX's plugins for other hosts for the current user (no root), on Linux or macOS:
  3. # Linux CLAP -> ~/.clap VST3 -> ~/.vst3
  4. # macOS CLAP -> ~/Library/Audio/Plug-Ins/CLAP VST3 -> ~/Library/Audio/Plug-Ins/VST3
  5. # Run it again to update; ./install.sh --uninstall removes exactly what it installed (the names in PLUGINS.txt).
  6. set -e
  7. here="$(cd "$(dirname "$0")" && pwd)"
  8. if [ "$(uname -s)" = Darwin ]; then
  9. clap="$HOME/Library/Audio/Plug-Ins/CLAP"
  10. vst3="$HOME/Library/Audio/Plug-Ins/VST3"
  11. else
  12. clap="$HOME/.clap"
  13. vst3="$HOME/.vst3"
  14. fi
  15. if [ "$1" = "--uninstall" ]; then
  16. rm -rf "$clap/LYNX Plugins.clap"
  17. for b in "$here"/VST3/*.vst3; do
  18. [ -e "$b" ] && rm -rf "$vst3/$(basename "$b")"
  19. done
  20. echo "LYNX plugins removed from $clap and $vst3."
  21. exit 0
  22. fi
  23. mkdir -p "$clap" "$vst3"
  24. rm -rf "$clap/LYNX Plugins.clap"
  25. cp -R "$here/CLAP/LYNX Plugins.clap" "$clap/"
  26. for b in "$here"/VST3/*.vst3; do
  27. [ -e "$b" ] || continue
  28. rm -rf "$vst3/$(basename "$b")"
  29. cp -R "$b" "$vst3/"
  30. done
  31. if [ "$(uname -s)" = Darwin ]; then
  32. # a download is quarantined; these bundles are signed ad hoc only (no Apple Developer ID yet)
  33. xattr -dr com.apple.quarantine "$clap/LYNX Plugins.clap" 2> /dev/null || true
  34. for b in "$here"/VST3/*.vst3; do
  35. [ -e "$b" ] && xattr -dr com.apple.quarantine "$vst3/$(basename "$b")" 2> /dev/null || true
  36. done
  37. fi
  38. echo "LYNX plugins installed: CLAP in $clap, VST3 in $vst3. Rescan the plugins in your host."