bootstrap-osx.sh 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #!/usr/bin/env bash
  2. # This script's purpose is to ease compiling qTox for users.
  3. #
  4. # NO AUTOMATED BUILDS SHOULD DEPEND ON IT.
  5. #
  6. # This script is and will be a subject to breaking changes, and at no time one
  7. # should expect it to work - it's something that you could try to use but
  8. # don't expect that it will work for sure.
  9. #
  10. # If script doesn't work, you should use instructions provided in INSTALL.md
  11. # before reporting issues like “qTox doesn't compile”.
  12. #
  13. # With that being said, reporting that this script doesn't work would be nice.
  14. #
  15. # If you are contributing code to qTox that change its dependencies / the way
  16. # it's being build, please keep in mind that changing just bootstrap.sh
  17. # *IS NOT* and will not be sufficient - you should update INSTALL.md first.
  18. set -eu -o pipefail
  19. # copy libs to given destination
  20. copy_libs() {
  21. local dest="$@"
  22. local libs=(
  23. /usr/local/lib/libsodium*
  24. /usr/local/lib/libvpx*
  25. /usr/local/lib/libopus*
  26. /usr/local/lib/libav*
  27. /usr/local/lib/libswscale*
  28. /usr/local/lib/libqrencode*
  29. /usr/local/lib/libsqlcipher*
  30. )
  31. echo Copying libraries…
  32. for lib in "${libs[@]}"
  33. do
  34. cp -v "$lib" "$dest"
  35. done
  36. }
  37. # copy includes to given destination
  38. copy_includes() {
  39. local dest="$@"
  40. local includes=(
  41. /usr/local/include/vpx*
  42. /usr/local/include/sodium*
  43. /usr/local/include/qrencode*
  44. /usr/local/include/libav*
  45. /usr/local/include/libswscale*
  46. /usr/local/include/sqlcipher*
  47. )
  48. echo Copying include files…
  49. for include in "${includes[@]}"
  50. do
  51. cp -v -r "$include" "$dest"
  52. done
  53. }
  54. main() {
  55. local libs_dir="libs/lib"
  56. local inc_dir="libs/include"
  57. echo Creating directories…
  58. mkdir -v -p "$libs_dir" "$inc_dir"
  59. copy_libs "$libs_dir"
  60. copy_includes "$inc_dir"
  61. echo Done.
  62. }
  63. main