forked from rotki/rotki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_deps.sh
executable file
·46 lines (37 loc) · 1.23 KB
/
install_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
#!/usr/bin/env bash
# the directory of the script
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# the temp directory used, within $DIR
# omit the -p parameter to create a temporal directory in the default location
WORK_DIR=`mktemp -d -p "$DIR"`
# check if tmp dir was created
if [[ ! "$WORK_DIR" || ! -d "$WORK_DIR" ]]; then
echo "Could not create temp dir"
exit 1
fi
# deletes the temp directory
function cleanup {
rm -rf "$WORK_DIR"
echo "Deleted temp working directory $WORK_DIR"
}
# register the cleanup function to be called on the EXIT signal
trap cleanup EXIT
# Only use this option if you can't install libsqlcipher
# through your system's package manager
# NOTE: This will add the lib to /usr/local/lib so make sure
# that ldconfig also searches that directory for libraries by editing
# /etc/ld.so.conf
SQLCIPHER_EXISTS=$(ldconfig -p | grep libsqlcipher)
if [[ $SQLCIPHER_EXISTS == "" ]]; then
# Go into the directory and build sqlciper
cd $WORK_DIR
git clone https://github.com/sqlcipher/sqlcipher
cd sqlcipher
./configure \
--enable-tempstore=yes \
CFLAGS="-DSQLITE_HAS_CODEC -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS" \
LDFLAGS="-lcrypto"
make
sudo make install
cd $DIR
fi