.travis-install.sh 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/bin/sh
  2. #
  3. # Copyright 2017, gRPC Authors All rights reserved.
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. #
  17. #
  18. # Install dependencies that aren't available as Ubuntu packages (or already present on macOS).
  19. #
  20. # Everything goes into $HOME/local.
  21. #
  22. # Scripts should add
  23. # - $HOME/local/bin to PATH
  24. # - $HOME/local/lib to LD_LIBRARY_PATH
  25. #
  26. cd
  27. mkdir -p local
  28. if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
  29. PROTOC_URL=https://github.com/google/protobuf/releases/download/v3.5.1/protoc-3.5.1-osx-x86_64.zip
  30. else
  31. # Install swift
  32. SWIFT_URL=https://swift.org/builds/swift-${SWIFT_VERSION}-release/ubuntu1404/swift-${SWIFT_VERSION}-RELEASE/swift-${SWIFT_VERSION}-RELEASE-ubuntu14.04.tar.gz
  33. echo $SWIFT_URL
  34. curl -fSsL $SWIFT_URL -o swift.tar.gz
  35. tar -xzf swift.tar.gz --strip-components=2 --directory=local
  36. PROTOC_URL=https://github.com/google/protobuf/releases/download/v3.5.1/protoc-3.5.1-linux-x86_64.zip
  37. fi
  38. # Install protoc
  39. echo $PROTOC_URL
  40. curl -fSsL $PROTOC_URL -o protoc.zip
  41. unzip -q protoc.zip -d local
  42. # Verify installation
  43. find local