-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
core:tools:zenoh: Add installer for zenoh
- Loading branch information
1 parent
f776c91
commit 86ae3fa
Showing
1 changed file
with
48 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/bash | ||
|
||
# Immediately exit on errors | ||
set -e | ||
|
||
VERSION="1.0.0" | ||
MIRROR="1" | ||
BINARIES=( | ||
"zenoh" | ||
"zenoh-plugin-webserver" | ||
) | ||
|
||
echo "Installing project Zenoh and friends with version $VERSION" | ||
|
||
# Step 1: Prepare the download URL | ||
ARCH="$(uname -m)" | ||
case "$ARCH" in | ||
x86_64 | amd64) | ||
TOOLCHAIN="x86_64-unknown-linux-musl" | ||
;; | ||
armv7l | armhf) | ||
TOOLCHAIN="armv7-unknown-linux-gnueabihf" | ||
;; | ||
aarch64 | arm64) | ||
TOOLCHAIN="aarch64-unknown-linux-musl" | ||
;; | ||
*) | ||
echo "Architecture: $ARCH is unsupported, please create a new issue on https://github.com/bluerobotics/BlueOS/issues" | ||
exit 1 | ||
;; | ||
esac | ||
echo "For architecture $ARCH, using toolchain $TOOLCHAIN" | ||
|
||
echo "Download zenoh and friends..." | ||
DOWNLOAD_FOLDER="/tmp/zenoh_and_friends" | ||
mkdir -p $DOWNLOAD_FOLDER | ||
for BINARY in "${BINARIES[@]}"; do | ||
URL="https://download.eclipse.org/zenoh/${BINARY}/${VERSION}/${BINARY}-${VERSION}-${TOOLCHAIN}-standalone.zip" | ||
echo " - Download: ${URL}" | ||
wget -q "$URL" -O "${DOWNLOAD_FOLDER}/${BINARY}.zip" | ||
done | ||
echo "Downloaded all binaries, now installing..." | ||
cd ${DOWNLOAD_FOLDER} | ||
unzip "*.zip" | ||
rm *.zip | ||
mv * /usr/bin | ||
cd - && rm -rf ${DOWNLOAD_FOLDER} | ||
echo "Install complete!" |