-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: fix tool dep installation for linux & macos
- Loading branch information
Showing
2 changed files
with
46 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eux | ||
|
||
# TODO: support windows somehow | ||
|
||
CAPNP_VERSION="1.0.2" | ||
PROTOC_VERSION="24.3" # Keep in sync with veilid-core/build.rs | ||
|
||
build_dir=$(mktemp -d) | ||
trap "rm -rf $build_dir" EXIT | ||
|
||
cd $build_dir | ||
mkdir -p capnp-build protoc-install | ||
|
||
# Install capnp | ||
pushd capnp-build | ||
curl -O https://capnproto.org/capnproto-c++-${CAPNP_VERSION}.tar.gz | ||
tar zxf capnproto-c++-${CAPNP_VERSION}.tar.gz | ||
cd capnproto-c++-1.0.2 | ||
./configure | ||
sudo make -j6 install | ||
popd | ||
|
||
# Install protoc | ||
pushd protoc-install | ||
UNAME_M=$(uname -m) | ||
if [[ "$UNAME_M" == "x86_64" ]]; then | ||
PROTOC_ARCH=x86_64 | ||
elif [[ "$UNAME_M" == "aarch64" ]]; then | ||
PROTOC_ARCH=aarch_64 | ||
else | ||
echo Unsupported build architecture | ||
exit 1 | ||
fi | ||
PROTOC_OS="linux" | ||
if [ "$(uname -o)" == "Darwin" ]; then | ||
PROTOC_OS="osx" | ||
fi | ||
|
||
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOC_VERSION/protoc-$PROTOC_VERSION-$PROTOC_OS-$PROTOC_ARCH.zip | ||
unzip protoc-$PROTOC_VERSION-$PROTOC_OS-$PROTOC_ARCH.zip | ||
sudo cp -r bin include /usr/local/ | ||
popd |