install.sh 1.1 KB

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