install_deps.sh 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/bash
  2. if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
  3. curl -Lo $HOME/bin/jq --create-dirs https://github.com/stedolan/jq/releases/download/jq-1.6/jq-osx-amd64
  4. chmod +x $HOME/bin/jq
  5. export PATH="$HOME/bin:$PATH"
  6. else
  7. sudo apt-get update
  8. sudo apt-get install -y fakeroot jq
  9. triplet=
  10. case $BUILDARCH in
  11. arm)
  12. arch=armhf
  13. triplet=arm-linux-gnueabihf
  14. ;;
  15. arm64)
  16. arch=arm64
  17. triplet=aarch64-linux-gnu
  18. ;;
  19. esac
  20. if [[ -n "$triplet" ]]; then
  21. sed 's/^deb /deb [arch=amd64] '/g -i /etc/apt/sources.list
  22. echo "deb [arch=$arch] http://ports.ubuntu.com/ubuntu-ports/ trusty main" | sudo tee -a /etc/apt/sources.list.d/$arch.list >/dev/null
  23. sudo dpkg --add-architecture $arch
  24. sudo apt-get update
  25. 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
  26. mkdir -p dl
  27. cd dl
  28. 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
  29. for i in *.deb; do ar x $i; sudo tar -C / -xf data.tar.*; rm -f data.tar.*; done
  30. cd ..
  31. export CC=/usr/bin/$triplet-gcc
  32. export CXX=/usr/bin/$triplet-g++
  33. export CC_host=/usr/bin/gcc
  34. export CXX_host=/usr/bin/g++
  35. export PKG_CONFIG_LIBDIR=/usr/lib/$triplet/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
  36. else
  37. sudo apt-get install libx11-dev libxkbfile-dev libsecret-1-dev rpm
  38. fi
  39. fi