before_script.sh 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. #!/bin/bash
  2. #***************************************************************************
  3. # _ _ ____ _
  4. # Project ___| | | | _ \| |
  5. # / __| | | | |_) | |
  6. # | (__| |_| | _ <| |___
  7. # \___|\___/|_| \_\_____|
  8. #
  9. # Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
  10. #
  11. # This software is licensed as described in the file COPYING, which
  12. # you should have received as part of this distribution. The terms
  13. # are also available at https://curl.se/docs/copyright.html.
  14. #
  15. # You may opt to use, copy, modify, merge, publish, distribute and/or sell
  16. # copies of the Software, and permit persons to whom the Software is
  17. # furnished to do so, under the terms of the COPYING file.
  18. #
  19. # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  20. # KIND, either express or implied.
  21. #
  22. # SPDX-License-Identifier: curl
  23. #
  24. ###########################################################################
  25. set -eo pipefail
  26. autoreconf -fi
  27. if [ "$NGTCP2" = yes ]; then
  28. if [ "$TRAVIS_OS_NAME" = linux -a "$GNUTLS" ]; then
  29. cd $HOME
  30. git clone --depth 1 https://gitlab.com/gnutls/nettle.git
  31. cd nettle
  32. ./.bootstrap
  33. ./configure LDFLAGS="-Wl,-rpath,$HOME/ngbuild/lib" --disable-documentation --prefix=$HOME/ngbuild
  34. make
  35. make install
  36. cd $HOME
  37. git clone --depth 1 -b 3.7.4 https://gitlab.com/gnutls/gnutls.git pgtls
  38. cd pgtls
  39. ./bootstrap
  40. ./configure PKG_CONFIG_PATH=$HOME/ngbuild/lib/pkgconfig LDFLAGS="-Wl,-rpath,$HOME/ngbuild/lib" --with-included-libtasn1 --with-included-unistring --disable-guile --disable-doc --disable-tools --without-zstd --disable-psk-authentication --prefix=$HOME/ngbuild
  41. make
  42. make install
  43. else
  44. cd $HOME
  45. git clone --depth 1 -b OpenSSL_1_1_1j+quic https://github.com/quictls/openssl possl
  46. cd possl
  47. ./config enable-tls1_3 --prefix=$HOME/ngbuild
  48. make
  49. make install_sw
  50. fi
  51. cd $HOME
  52. git clone --depth 1 https://github.com/ngtcp2/nghttp3
  53. cd nghttp3
  54. autoreconf -i
  55. ./configure --prefix=$HOME/ngbuild --enable-lib-only
  56. make
  57. make install
  58. cd $HOME
  59. git clone --depth 1 https://github.com/ngtcp2/ngtcp2
  60. cd ngtcp2
  61. autoreconf -i
  62. if test -n "$GNUTLS"; then
  63. WITHGNUTLS="--with-gnutls"
  64. fi
  65. ./configure PKG_CONFIG_PATH=$HOME/ngbuild/lib/pkgconfig LDFLAGS="-Wl,-rpath,$HOME/ngbuild/lib" --prefix=$HOME/ngbuild --enable-lib-only $WITHGNUTLS
  66. make
  67. make install
  68. fi
  69. if [ "$TRAVIS_OS_NAME" = linux -a "$BORINGSSL" ]; then
  70. cd $HOME
  71. git clone --depth=1 https://boringssl.googlesource.com/boringssl
  72. cd boringssl
  73. mkdir -p build
  74. cd ./build
  75. CXX="g++" CC="gcc" cmake .. -GNinja -DCMAKE_BUILD_TYPE=release -DBUILD_SHARED_LIBS=1
  76. cd ..
  77. cmake --build build
  78. mkdir lib
  79. cp ./build/crypto/libcrypto.so ./lib/
  80. cp ./build/ssl/libssl.so ./lib/
  81. echo "BoringSSL lib dir: "`pwd`"/lib"
  82. cmake --build build --target clean
  83. rm -f build/CMakeCache.txt
  84. cd ./build
  85. CXX="g++" CC="gcc" cmake .. -GNinja -DCMAKE_POSITION_INDEPENDENT_CODE=on
  86. cd ..
  87. cmake --build build
  88. export LIBS=-lpthread
  89. fi
  90. if [ "$TRAVIS_OS_NAME" = linux -a "$QUICHE" ]; then
  91. cd $HOME
  92. git clone --depth=1 --recursive https://github.com/cloudflare/quiche.git
  93. curl https://sh.rustup.rs -sSf | sh -s -- -y
  94. source $HOME/.cargo/env
  95. cd $HOME/quiche
  96. #### Work-around https://github.com/curl/curl/issues/7927 #######
  97. #### See https://github.com/alexcrichton/cmake-rs/issues/131 ####
  98. sed -i -e 's/cmake = "0.1"/cmake = "=0.1.45"/' quiche/Cargo.toml
  99. cargo build -v --package quiche --release --features ffi,pkg-config-meta,qlog
  100. mkdir -v quiche/deps/boringssl/src/lib
  101. ln -vnf $(find target/release -name libcrypto.a -o -name libssl.a) quiche/deps/boringssl/src/lib/
  102. fi