-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
build-openssl-win32.sh
executable file
·56 lines (46 loc) · 1.23 KB
/
build-openssl-win32.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
# bundle OpenSSL for better reproducibility.
set -e
OPENSSL_VERSION=3.0.7
ROOT=$(cd "$(dirname "$0")" && pwd)
: "${RUNNER_TEMP:=$ROOT/working}"
: "${RUNNER_TOOL_CACHE:=$RUNNER_TEMP/dist}"
PERL_DIR=$PERL_VERSION
if [[ "x$PERL_MULTI_THREAD" != "x" ]]; then
PERL_DIR="$PERL_DIR-thr"
fi
PREFIX=$(cygpath "$RUNNER_TOOL_CACHE\\perl\\$PERL_DIR\\x64")
# detect the number of CPU Core
JOBS=$(nproc)
mkdir -p "$RUNNER_TEMP"
cd "$RUNNER_TEMP"
echo "::group::download OpenSSL source"
(
set -eux
cd "$RUNNER_TEMP"
curl --retry 3 -sSL "https://github.com/openssl/openssl/archive/refs/tags/openssl-$OPENSSL_VERSION.tar.gz" -o openssl.tar.gz
)
echo "::endgroup::"
echo "::group::extract OpenSSL source"
(
set -eux
cd "$RUNNER_TEMP"
tar zxvf openssl.tar.gz
)
echo "::endgroup::"
echo "::group::build OpenSSL"
(
set -eux
cd "$RUNNER_TEMP/openssl-openssl-$OPENSSL_VERSION"
./Configure --prefix="$PREFIX" --openssldir="$PREFIX" --libdir=lib mingw64
make "-j$JOBS" build_sw
make install_sw
)
echo "::endgroup::"
# configure for building Net::SSLeay
cat <<__END__ >> "$GITHUB_ENV"
OPENSSL_PREFIX=$(cygpath --windows "$PREFIX")
__END__
cat <<__END__ >> "$GITHUB_PATH"
$(cygpath --windows "$PREFIX/bin")
__END__