You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

getdeps_osx.sh 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. #!/bin/bash
  2. echo "Set up dir"
  3. mkdir build
  4. cd build
  5. echo "Downloading files"
  6. if [ ! -f "glew-2.0.0.tgz" ]; then
  7. curl -L https://github.com/nigels-com/glew/releases/download/glew-2.0.0/glew-2.0.0.tgz > glew-2.0.0.tgz
  8. fi
  9. if ! type "cmake" > /dev/null; then
  10. if [ ! -f "cmake-3.9.0.tar.gz" ]; then
  11. curl https://cmake.org/files/v3.9/cmake-3.9.0.tar.gz > cmake-3.9.0.tar.gz
  12. fi
  13. fi
  14. if [ ! -f "glfw3.2.1.tar.gz" ]; then
  15. curl -L https://github.com/glfw/glfw/archive/3.2.1.tar.gz > glfw3.2.1.tar.gz
  16. fi
  17. if ! type "pkg-config" > /dev/null; then
  18. if [ ! -f "pkg-config-0.29.tar.gz" ]; then
  19. curl https://pkg-config.freedesktop.org/releases/pkg-config-0.29.tar.gz > pkg-config-0.29.tar.gz
  20. fi
  21. fi
  22. if [ ! -f "freetype-2.8.tar.gz" ]; then
  23. curl -L http://download.savannah.gnu.org/releases/freetype/freetype-2.8.tar.gz > freetype-2.8.tar.gz
  24. fi
  25. if [ ! -f "harfbuzz-1.4.7.tar.bz2" ]; then
  26. curl -L https://github.com/behdad/harfbuzz/releases/download/1.4.7/harfbuzz-1.4.7.tar.bz2 > harfbuzz-1.4.7.tar.bz2
  27. fi
  28. if [ ! -f "mbedtls-2.5.1.tar.gz" ]; then
  29. curl -L https://github.com/ARMmbed/mbedtls/archive/mbedtls-2.5.1.tar.gz > mbedtls-2.5.1.tar.gz
  30. fi
  31. #if [ ! -f "md5sum.c" ]; then
  32. # curl https://spit.mixtape.moe/view/raw/765a1dc1 > md5sum.c
  33. #fi
  34. echo "Extracing files"
  35. tar zxf glew-2.0.0.tgz
  36. if ! type "cmake" > /dev/null; then
  37. tar zxf cmake-3.9.0.tar.gz
  38. fi
  39. tar zxf glfw3.2.1.tar.gz
  40. if ! type "pkg-config" > /dev/null; then
  41. tar zxf pkg-config-0.29.tar.gz
  42. fi
  43. tar zxf freetype-2.8.tar.gz
  44. tar zxf harfbuzz-1.4.7.tar.bz2
  45. tar zxf mbedtls-2.5.1.tar.gz
  46. physicalCpuCount=$([[ $(uname) = 'Darwin' ]] &&
  47. sysctl -n hw.physicalcpu_max ||
  48. lscpu -p | egrep -v '^#' | sort -u -t, -k 2,4 | wc -l)
  49. echo "Configured for $physicalCpuCount CPUs"
  50. if [ -d "cmake-3.9.0" ]; then
  51. echo "Installing CMake"
  52. cd cmake-3.9.0
  53. sh configure --parallel=$physicalCpuCount
  54. make -j$physicalCpuCount
  55. echo "Prompting for local user password for installation"
  56. sudo make install
  57. cd ..
  58. fi
  59. echo "Installing GLEW"
  60. cd glew-2.0.0
  61. make -j$physicalCpuCount
  62. echo "Prompting for local user password for installation"
  63. sudo make install
  64. cd ..
  65. echo "Installing GLFW"
  66. cd glfw-3.2.1
  67. cmake .
  68. make -j$physicalCpuCount
  69. sudo make install
  70. cd ..
  71. if [ -d "pkg-config-0.29" ]; then
  72. echo "Installing pkg-config"
  73. cd pkg-config-0.29
  74. env LDFLAGS="-framework CoreFoundation -framework Carbon" ./configure --with-internal-glib
  75. make -j$physicalCpuCount
  76. sudo make install
  77. cd ..
  78. fi
  79. echo "Installing FreeType"
  80. cd freetype-2.8
  81. sh configure
  82. make -j$physicalCpuCount
  83. sudo make install
  84. cd ..
  85. echo "Installing HarfBuzz"
  86. cd harfbuzz-1.4.7
  87. sh configure --with-freetype=yes
  88. make -j$physicalCpuCount
  89. sudo make install
  90. cd ..
  91. echo "Installing mbedTLS"
  92. cd mbedtls-mbedtls-2.5.1
  93. cmake .
  94. make -j$physicalCpuCount
  95. sudo make install
  96. cd ..
  97. #echo "Installing md5sum"
  98. #gcc md5sum.c -o md5sum
  99. #chmod u+x md5sum
  100. #sudo cp md5sum /usr/local/bin
  101. echo "Restoring pwd"
  102. cd ..