Last active
June 21, 2017 06:15
-
-
Save whs/4e90f2cdff9910c042024477829940dd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| set -e | |
| cd `dirname $0`/../ | |
| if [ -e /usr/lib/libsodium.so ]; then | |
| echo "Using system libsodium in /usr/lib" | |
| exit | |
| fi | |
| if [ -e /usr/local/lib/libsodium.so ]; then | |
| echo "Using system libsodium in /usr/local/lib" | |
| exit | |
| fi | |
| if [ -f gs/libsodium.so.18.2.0 ]; then | |
| HASH=293e483b43002d58db56f9db9419a31db621cb4541c83b64202190e0c8b23191 | |
| ACTUAL=`sha256sum gs/libsodium.so.18.2.0|cut -f1 -d " "` | |
| if [ "$ACTUAL" != "$HASH" ]; then | |
| echo "libsodium hash does not match" | |
| echo "expected $HASH actual $ACTUAL" | |
| exit 2 | |
| fi | |
| mv gs/libsodium.so.18.2.0 /usr/local/lib/ | |
| ln -s /usr/local/lib/libsodium.so.18.2.0 /usr/local/lib/libsodium.so.18 | |
| ln -s /usr/local/lib/libsodium.so.18.2.0 /usr/local/lib/libsodium.so | |
| echo "Using custom libsodium with hash $ACTUAL" | |
| else | |
| echo libsodium not found | |
| exit 1 | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment