Skip to content

Commit

Permalink
chore: Match on HTTP git and handle when root
Browse files Browse the repository at this point in the history
  • Loading branch information
bushidocodes committed Mar 26, 2021
1 parent 23783c0 commit ba6dd4b
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions install_deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,25 @@
# Installs dependencies, builds Silverfish, and places it into your path
# Be sure to validate the Rust and LLVM install scripts we invoke below!

sudo="sudo"
if [[ $(whoami) == "root" ]]; then
sudo=""
fi

# Exit if not executing script from project root because we use relative paths
# We want to match without case because the URL of the git repo is case insensitive, but the resulting
# directory is case sensitive. Thus, we can end up with either "aWsm" or "awsm."
shopt -s nocasematch
if [[ $(git remote get-url origin) != *"/aWsm.git" || $(git rev-parse --show-toplevel) != $(pwd) ]]; then
if [[ $(git remote get-url origin) != *"/awsm"* || $(git rev-parse --show-toplevel) != $(pwd) ]]; then
echo "Install script must be run from project root."
exit 1
fi
shopt -u nocasematch

# Install Build Dependencies
sudo apt install build-essential --yes
sudo apt install cmake --yes
$sudo apt install build-essential --yes
$sudo apt install cmake --yes
$sudo apt install lsb-release wget software-properties-common --yes

# Initialize Wasmception submodule
# Check to see if ./wasmception directory exists and is not empty.
Expand All @@ -38,13 +44,13 @@ source "$HOME/.cargo/env"
export PATH="$HOME/.cargo/bin:$PATH"

# Install LLVM build dependencies
LLVM_VERSION=9
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" bash $LLVM_VERSION
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-$LLVM_VERSION 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-$LLVM_VERSION 100
sudo update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-$LLVM_VERSION 100
sudo apt install libc++-dev libc++abi-dev --yes
LLVM_VERSION=11
$sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" bash $LLVM_VERSION
$sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-$LLVM_VERSION 100
$sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-$LLVM_VERSION 100
$sudo update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-$LLVM_VERSION 100
$sudo apt install libc++-dev libc++abi-dev --yes

# Build and install Silverfish
cargo build --release
sudo cp -t /usr/bin ./target/release/silverfish
$sudo cp -t /usr/bin ./target/release/silverfish

0 comments on commit ba6dd4b

Please sign in to comment.