-
Notifications
You must be signed in to change notification settings - Fork 6
/
check_deps.sh
executable file
·65 lines (54 loc) · 1.65 KB
/
check_deps.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
57
58
59
60
61
62
63
64
65
#!/bin/bash
has_command() {
which "$1" $1 > /dev/null 2>&1
}
build_liboqs() {
git clone -b main https://github.com/open-quantum-safe/liboqs.git
cd liboqs
mkdir -p build && cd build
cmake -GNinja .. -DBUILD_SHARED_LIBS=ON
ninja
sudo ninja install
cd ..
}
make_venv() {
if ! [ -d ~/.pqcryptvenv ]; then
mkdir -p ~/.pqcryptvenv
printf "Making Python Virtual Environment"
python3 -m venv ~/.pqcryptvenv
source ~/.pqcryptvenv/bin/activate
pip3 install --require-virtualenv -r requirements.txt
else
source ~/.pqcryptvenv/bin/activate
pip3 install --require-virtualenv -r requirements.txt
fi
}
apt_system() {
printf "Debian/Ubuntu based found!!\n\n"
sudo apt-get update
sudo apt install astyle cmake gcc ninja-build libssl-dev python3-pytest python3-pytest-xdist unzip xsltproc doxygen graphviz python3-yaml python3-pip git python3-venv
}
dnf_system() {
printf "Fedora based system!!\n\n"
sudo dnf install astyle cmake gcc-c++ ninja-build openssl-devel python3-pytest python3-pytest-xdist unzip xsltproc doxygen graphviz python3-yaml python3-pip git python3
}
pacman_system() {
printf "Arch Linux based found!!\n\n"
sudo pacman -S astyle cmake gcc ninja python-pytest python-pytest-xdist unzip libxslt doxygen graphviz python-yaml python-pip git openssl python-cryptography python-argon2_cffi
}
if has_command apt-get; then
apt_system
elif has_command dnf; then
dnf_system
elif has_command pacman; then
pacman_system
else
printf "\n\nDistribution not yet supported!\n\n"
fi
make_venv
if ! [ -d /usr/local/include/oqs ]; then
build_liboqs
else
printf "\n\nliboqs already built, not rebuilding!\n\n"
fi
deactivate