matrix-alertbot/docker/build_and_install_libolm.sh

44 lines
910 B
Bash
Raw Normal View History

2020-08-12 02:37:23 +02:00
#!/usr/bin/env sh
#
# Call with the following arguments:
#
2022-08-27 13:44:12 +02:00
# ./build_and_install_libolm.sh <libolm version> <git source dir> <python bindings install dir>
2020-08-12 02:37:23 +02:00
#
# Example:
#
2022-08-27 13:44:12 +02:00
# ./build_and_install_libolm.sh 3.1.4 /usr/local/src/olm /python-bindings
2020-08-12 02:37:23 +02:00
#
# Note that if a python bindings installation directory is not supplied, bindings will
# be installed to the default directory.
#
set -ex
2022-08-27 13:44:12 +02:00
if [[ $# -ne 3 ]]; then
echo "Usage: $0 <libolm version> <source dir> <install dir>"
exit 1
fi
version="$1"
src_dir="$2"
install_dir="$3"
2020-08-12 02:37:23 +02:00
# Download the specified version of libolm
2022-08-27 13:44:12 +02:00
git clone -b "$version" https://gitlab.matrix.org/matrix-org/olm.git "$src_dir"
cd "$src_dir"
2020-08-12 02:37:23 +02:00
# Build libolm
cmake . -Bbuild
cmake --build build
# Install
make install
# Build the python3 bindings
2022-08-27 13:44:12 +02:00
cd python
make olm-python3
2020-08-12 02:37:23 +02:00
# Install python3 bindings
2022-08-27 13:44:12 +02:00
mkdir -p "$install_dir" || true
DESTDIR="$install_dir" make install-python3