| 1 |
#!/usr/bin/env bash |
| 2 |
# install libmongocrypt |
| 3 |
# This script installs libmongocrypt into an "install" directory. |
| 4 |
set -eux |
| 5 |
|
| 6 |
LIBMONGOCRYPT_TAG="1.11.0" |
| 7 |
|
| 8 |
# Install libmongocrypt based on OS. |
| 9 |
if [ "Windows_NT" = "${OS:-}" ]; then |
| 10 |
mkdir -p c:/libmongocrypt/include |
| 11 |
mkdir -p c:/libmongocrypt/bin |
| 12 |
echo "fetching build for Windows ... begin" |
| 13 |
mkdir libmongocrypt-all |
| 14 |
cd libmongocrypt-all |
| 15 |
# The following URL is published from the upload-all task in the libmongocrypt Evergreen project. |
| 16 |
curl -L https://github.com/mongodb/libmongocrypt/releases/download/$LIBMONGOCRYPT_TAG/libmongocrypt-windows-x86_64-$LIBMONGOCRYPT_TAG.tar.gz -o libmongocrypt-all.tar.gz |
| 17 |
tar -xf libmongocrypt-all.tar.gz |
| 18 |
cd .. |
| 19 |
cp libmongocrypt-all/bin/mongocrypt.dll c:/libmongocrypt/bin |
| 20 |
cp libmongocrypt-all/include/mongocrypt/*.h c:/libmongocrypt/include |
| 21 |
|
| 22 |
rm -rf libmongocrypt-all |
| 23 |
echo "fetching build for Windows ... end" |
| 24 |
else |
| 25 |
rm -rf libmongocrypt |
| 26 |
git clone https://github.com/mongodb/libmongocrypt --depth=1 --branch $LIBMONGOCRYPT_TAG 2> /dev/null |
| 27 |
if ! ( ./libmongocrypt/.evergreen/compile.sh >| output.txt 2>&1 ); then |
| 28 |
cat output.txt 1>&2 |
| 29 |
exit 1 |
| 30 |
fi |
| 31 |
mv output.txt install |
| 32 |
rm -rf libmongocrypt |
| 33 |
fi |