Debian Codegraph @

crt/s2n/codebuild/bin/install_gnutls37.sh

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2 #
3 # Copyright Amazon.com, Inc. or its affiliates. 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 # A copy of the License is located at
8 #
9 # http://aws.amazon.com/apache2.0
10 #
11 # or in the "license" file accompanying this file. This file is distributed
12 # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13 # express or implied. See the License for the specific language governing
14 # permissions and limitations under the License.
15 #
16
17 set -e
18 source codebuild/bin/s2n_setup_env.shscip-shell source . . `codebuild/bin/s2n_setup_env.sh`.
19
20 usagescip-shell shell shell-project 0.0.0 usage().() {
21 echoscip-shell system . . echo. "install_gnutls37.sh build_dir install_dir os_name"
22 exit 1
23 }
24
25 if [scip-shell system . . `[`. "$#" -ne "2" ]; then
26 usagescip-shell shell shell-project 0.0.0 usage().
27 fi
28
29 GNUTLS_BUILD_DIR=$1
30 GNUTLS_INSTALL_DIR=$2
31
32 source codebuild/bin/jobs.shscip-shell source . . `codebuild/bin/jobs.sh`.
33
34 # libgmp is needed for libnettle
35 case "$DISTRO" in
36 "ubuntu")
37 sudoscip-shell system . . sudo. apt-get -qq install libgmp3-dev -y
38 ;;
39 "amazon linux")
40 sudoscip-shell system . . sudo. yum install -y gmp-devel
41 ;;
42 "darwin" )
43 # Installing an existing package is a "failure" in brew
44 brew install gmp || truescip-shell system . . true.
45 ;;
46 *)
47 echoscip-shell system . . echo. "Invalid platform! $OS_NAME"
48 usagescip-shell shell shell-project 0.0.0 usage().
49 ;;
50 esac
51
52 cd "$GNUTLS_BUILD_DIR"
53
54 # Originally from: https://ftp.gnu.org/gnu/nettle/
55 curlscip-shell system . . curl. --retry 3 https://s3-us-west-2.amazonaws.com/s2n-public-test-dependencies/2021-01-04_nettle-3.7.tar.gz --output nettle-3.7.tar.gz
56 tarscip-shell system . . tar. -xzf nettle-3.7.tar.gz
57 cd nettle-3.7
58 ./configure --prefix="$GNUTLS_INSTALL_DIR"/nettle \
59 --disable-openssl \
60 --enable-shared
61 makescip-shell system . . make. -j $JOBS
62 makescip-shell system . . make. -j $JOBS install
63 cd ..
64
65 # Install GnuTLS
66 # Originally from: https://www.gnupg.org/ftp/gcrypt/gnutls/v3.7/
67 curlscip-shell system . . curl. --retry 3 https://s3-us-west-2.amazonaws.com/s2n-public-test-dependencies/2022-01-18_gnutls-3.7.3.tar.xz --output gnutls-3.7.3.tar.xz
68 tarscip-shell system . . tar. -xJf gnutls-3.7.3.tar.xz
69 cd gnutls-3.7.3
70 PKG_CONFIG_PATH="$GNUTLS_INSTALL_DIR"/nettle/lib/pkgconfig:$PKG_CONFIG_PATH \
71 ./configure --prefix="$GNUTLS_INSTALL_DIR" \
72 --without-p11-kit \
73 --with-included-libtasn1 \
74 --with-included-unistring
75 makescip-shell system . . make. -j $JOBS
76 makescip-shell system . . make. -j $JOBS install