install.sh 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 LV2 -> ~/.lv2
  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. lv2="$HOME/.lv2" # (Linux only: the archive has an LV2 folder there, round 190ov)
  16. if [ "$1" = "--uninstall" ]; then
  17. rm -rf "$clap/LYNX Plugins.clap"
  18. for b in "$here"/VST3/*.vst3; do
  19. [ -e "$b" ] && rm -rf "$vst3/$(basename "$b")"
  20. done
  21. for b in "$here"/LV2/*.lv2; do
  22. [ -e "$b" ] && rm -rf "$lv2/$(basename "$b")"
  23. done
  24. if [ -d "$here/LV2" ]; then
  25. echo "LYNX plugins removed from $clap, $vst3 and $lv2."
  26. else
  27. echo "LYNX plugins removed from $clap and $vst3."
  28. fi
  29. exit 0
  30. fi
  31. mkdir -p "$clap" "$vst3"
  32. rm -rf "$clap/LYNX Plugins.clap"
  33. cp -R "$here/CLAP/LYNX Plugins.clap" "$clap/"
  34. for b in "$here"/VST3/*.vst3; do
  35. [ -e "$b" ] || continue
  36. rm -rf "$vst3/$(basename "$b")"
  37. cp -R "$b" "$vst3/"
  38. done
  39. for b in "$here"/LV2/*.lv2; do
  40. [ -e "$b" ] || continue
  41. mkdir -p "$lv2"
  42. rm -rf "$lv2/$(basename "$b")"
  43. cp -R "$b" "$lv2/"
  44. done
  45. if [ "$(uname -s)" = Darwin ]; then
  46. # a download is quarantined; these bundles are signed ad hoc only (no Apple Developer ID yet)
  47. xattr -dr com.apple.quarantine "$clap/LYNX Plugins.clap" 2> /dev/null || true
  48. for b in "$here"/VST3/*.vst3; do
  49. [ -e "$b" ] && xattr -dr com.apple.quarantine "$vst3/$(basename "$b")" 2> /dev/null || true
  50. done
  51. fi
  52. if [ -d "$here/LV2" ]; then
  53. echo "LYNX plugins installed: CLAP in $clap, VST3 in $vst3, LV2 in $lv2. Rescan the plugins in your host."
  54. else
  55. echo "LYNX plugins installed: CLAP in $clap, VST3 in $vst3. Rescan the plugins in your host."
  56. fi