install.sh 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #!/usr/bin/env bash
  2. #default installation directories
  3. INSTALL_DIR_LINUX="/usr/local/lib/lv2"
  4. INSTALL_DIR_MAC="/Library/Audio/Plug-Ins/LV2"
  5. # Detect the platform (similar to $OSTYPE)
  6. OS="`uname`"
  7. case $OS in
  8. 'Linux') OS='Linux' && echo "You are on a Linux system. Building for Linux";;
  9. 'Darwin') OS='Mac' && echo "You are on a Mac system. Building for MacOS";;
  10. *) ;;
  11. esac
  12. #Remove static rnnoise build
  13. if [ -d rnnoise-master ]; then
  14. read -p "Do you want to remove previous rnnoise build? (y/n)?" choice
  15. case "$choice" in
  16. y|Y ) rm -rf rnnoise-master && echo "Previous rnnoise build removed";;
  17. n|N ) echo "Previous rnnoise build was not removed";;
  18. * ) echo "invalid";;
  19. esac
  20. fi
  21. #only rebuild rnnoise if the user prefers to
  22. if [ ! -d rnnoise-master ]; then
  23. #build rrnoise statically
  24. wget https://github.com/xiph/rnnoise/archive/master.zip
  25. unzip -o master.zip && rm master.zip
  26. cd rnnoise-master && ./autogen.sh
  27. mv ../ltmain.sh ./ && ./autogen.sh #This is weird but otherwise it won't work
  28. if [ $OS = "Mac" ]; then
  29. CFLAGS="-fvisibility=hidden -fPIC " \
  30. ./configure --disable-examples --disable-doc --disable-shared --enable-static
  31. elif [ $OS = "Linux" ]; then
  32. CFLAGS="-fvisibility=hidden -fPIC -Wl,--exclude-libs,ALL" \
  33. ./configure --disable-examples --disable-doc --disable-shared --enable-static
  34. fi
  35. make -j2
  36. cd ..
  37. fi
  38. #remove previous builds
  39. rm -rf build || true
  40. #build the plugin in the new directory
  41. if [ $OS = "Linux" ]; then
  42. meson build --buildtype release --prefix $INSTALL_DIR_LINUX
  43. elif [ $OS = "Mac" ]; then
  44. meson build --buildtype release --prefix $INSTALL_DIR_MAC
  45. fi
  46. cd build
  47. ninja -v
  48. #install the plugin in the system
  49. sudo ninja install