.travis-install.sh 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. SWIFT_VERSION=5.0.2
  29. PROTOBUF_VERSION=3.9.1
  30. if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
  31. PROTOC_URL=https://github.com/google/protobuf/releases/download/v${PROTOBUF_VERSION}/protoc-${PROTOBUF_VERSION}-osx-x86_64.zip
  32. else
  33. # Install swift
  34. SWIFT_URL=https://swift.org/builds/swift-${SWIFT_VERSION}-release/ubuntu1804/swift-${SWIFT_VERSION}-RELEASE/swift-${SWIFT_VERSION}-RELEASE-ubuntu18.04.tar.gz
  35. echo $SWIFT_URL
  36. curl -fSsL $SWIFT_URL -o swift.tar.gz
  37. tar -xzf swift.tar.gz --strip-components=2 --directory=local
  38. PROTOC_URL=https://github.com/google/protobuf/releases/download/v${PROTOBUF_VERSION}/protoc-${PROTOBUF_VERSION}-linux-x86_64.zip
  39. fi
  40. # Install protoc
  41. echo $PROTOC_URL
  42. curl -fSsL $PROTOC_URL -o protoc.zip
  43. unzip -q protoc.zip -d local
  44. # Verify installation
  45. find local