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_lnx.sh 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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 jxf harfbuzz-1.4.7.tar.bz2
  45. physicalCpuCount=$([[ $(uname) = 'Darwin' ]] &&
  46. sysctl -n hw.physicalcpu_max ||
  47. lscpu -p | egrep -v '^#' | sort -u -t, -k 2,4 | wc -l)
  48. echo "Configured for $physicalCpuCount CPUs"
  49. if [ -d "cmake-3.9.0" ]; then
  50. echo "Installing CMake"
  51. cd cmake-3.9.0
  52. sh configure --parallel=$physicalCpuCount
  53. make -j$physicalCpuCount
  54. echo "Prompting for local user password for installation"
  55. sudo make install
  56. cd ..
  57. fi
  58. echo "Installing GLEW"
  59. cd glew-2.0.0
  60. make -j$physicalCpuCount
  61. echo "Prompting for local user password for installation"
  62. sudo make install
  63. cd ..
  64. echo "Installing GLFW"
  65. cd glfw-3.2.1
  66. cmake .
  67. make -j$physicalCpuCount
  68. sudo make install
  69. cd ..
  70. if [ -d "pkg-config-0.29" ]; then
  71. echo "Installing pkg-config"
  72. cd pkg-config-0.29
  73. env LDFLAGS="-framework CoreFoundation -framework Carbon" ./configure --with-internal-glib
  74. make -j$physicalCpuCount
  75. sudo make install
  76. cd ..
  77. fi
  78. echo "Installing FreeType"
  79. cd freetype-2.8
  80. sh configure
  81. make -j$physicalCpuCount
  82. sudo make install
  83. cd ..
  84. echo "Installing HarfBuzz"
  85. cd harfbuzz-1.4.7
  86. sh configure --with-freetype=yes
  87. make -j$physicalCpuCount
  88. sudo make install
  89. cd ..
  90. echo "Installing mbedTLS"
  91. cd mbedtls-mbedtls-2.5.1
  92. cmake .
  93. make -j$physicalCpuCount
  94. sudo make install
  95. cd ..
  96. #echo "Installing md5sum"
  97. #gcc md5sum.c -o md5sum
  98. #chmod u+x md5sum
  99. #sudo cp md5sum /usr/local/bin
  100. echo "Restoring pwd"
  101. cd ..