install_deps.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/bin/bash
  2. if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
  3. brew update
  4. brew install jq zip
  5. else
  6. sudo apt-get update
  7. sudo apt-get install -y fakeroot jq
  8. triplet=
  9. case $BUILDARCH in
  10. arm)
  11. arch=armhf
  12. triplet=arm-linux-gnueabihf
  13. ;;
  14. arm64)
  15. arch=arm64
  16. triplet=aarch64-linux-gnu
  17. ;;
  18. esac
  19. if [[ -n "$triplet" ]]; then
  20. sed 's/^deb /deb [arch=amd64] '/g -i /etc/apt/sources.list
  21. echo "deb [arch=$arch] http://ports.ubuntu.com/ubuntu-ports/ trusty main" | sudo tee -a /etc/apt/sources.list.d/$arch.list >/dev/null
  22. sudo dpkg --add-architecture $arch
  23. sudo apt-get update
  24. sudo apt-get install libc6-dev-$arch-cross gcc-$triplet g++-$triplet `apt-cache search x11proto | grep ^x11proto | cut -f 1 -d ' '` xz-utils pkg-config
  25. mkdir -p dl
  26. cd dl
  27. apt-get download libx11-dev:$arch libx11-6:$arch libxkbfile-dev:$arch libxkbfile1:$arch libxau-dev:$arch libxdmcp-dev:$arch libxcb1-dev:$arch libsecret-1-dev:$arch libsecret-1-0:$arch libpthread-stubs0-dev:$arch libglib2.0-dev:$arch libglib2.0-0:$arch libffi-dev:$arch libffi6:$arch zlib1g:$arch libpcre3-dev:$arch libpcre3:$arch
  28. for i in *.deb; do ar x $i; sudo tar -C / -xf data.tar.*; rm -f data.tar.*; done
  29. cd ..
  30. export CC=/usr/bin/$triplet-gcc
  31. export CXX=/usr/bin/$triplet-g++
  32. export CC_host=/usr/bin/gcc
  33. export CXX_host=/usr/bin/g++
  34. export PKG_CONFIG_LIBDIR=/usr/lib/$triplet/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
  35. else
  36. sudo apt-get install libx11-dev libxkbfile-dev libsecret-1-dev rpm
  37. fi
  38. fi