install.sh 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 previous builds
  13. rm -rf build || true
  14. #build rrnoise statically
  15. wget https://github.com/xiph/rnnoise/archive/master.zip
  16. unzip -o master.zip && rm master.zip
  17. cd rnnoise-master && ./autogen.sh
  18. mv ../ltmain.sh ./ && ./autogen.sh #This is weird but otherwise it won't work
  19. if [ $OS = "Mac" ]; then
  20. CFLAGS="-fvisibility=hidden -fPIC " \
  21. ./configure --disable-examples --disable-doc --disable-shared --enable-static
  22. elif [ $OS = "Linux" ]; then
  23. CFLAGS="-fvisibility=hidden -fPIC -Wl,--exclude-libs,ALL" \
  24. ./configure --disable-examples --disable-doc --disable-shared --enable-static
  25. fi
  26. make -j2
  27. cd ..
  28. #build the plugin in the new directory
  29. if [ $OS = "Linux" ]; then
  30. meson build --buildtype release --prefix $INSTALL_DIR_LINUX
  31. elif [ $OS = "Mac" ]; then
  32. meson build --buildtype release --prefix $INSTALL_DIR_MAC
  33. fi
  34. cd build
  35. ninja -v
  36. #install the plugin in the system
  37. sudo ninja install
  38. #Remove static rnnoise build
  39. cd ..
  40. rm -rfv rnnoise-master