install.sh 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. #build rrnoise statically
  13. git submodule init
  14. git config submodule.rnnoise.url "rnnoise"
  15. git submodule update
  16. cd rnnoise
  17. git submodule sync
  18. ./autogen.sh
  19. mv ../ltmain.sh ./ && ./autogen.sh #This is weird but otherwise it won't work (Related to bug #24 in rnnoise)
  20. if [ $OS = "Mac" ]; then
  21. CFLAGS="-fvisibility=hidden -fPIC " \
  22. ./configure --disable-examples --disable-doc --disable-shared --enable-static
  23. elif [ $OS = "Linux" ]; then
  24. CFLAGS="-fvisibility=hidden -fPIC -Wl,--exclude-libs,ALL" \
  25. ./configure --disable-examples --disable-doc --disable-shared --enable-static
  26. fi
  27. make
  28. cd ..
  29. #remove previous builds
  30. rm -rf build || true
  31. #build the plugin in the new directory
  32. if [ $OS = "Linux" ]; then
  33. meson build --buildtype release --prefix $INSTALL_DIR_LINUX
  34. elif [ $OS = "Mac" ]; then
  35. meson build --buildtype release --prefix $INSTALL_DIR_MAC
  36. fi
  37. cd build
  38. ninja -v