mirror of
https://gitlab.com/gabmus/envision.git
synced 2025-07-28 11:48:53 +00:00
feat: add support for mercury
This commit is contained in:
parent
c27fc65c62
commit
b0eda9993d
9 changed files with 126 additions and 50 deletions
57
scripts/build_mercury.sh
Executable file
57
scripts/build_mercury.sh
Executable file
|
@ -0,0 +1,57 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -ev
|
||||
|
||||
PREFIX=$1
|
||||
|
||||
CACHE_DIR=$2
|
||||
|
||||
if [[ -z $PREFIX ]] || [[ -z $CACHE_DIR ]]; then
|
||||
echo "Usage: $0 PREFIX CACHE_DIR"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ONNX_VER=$(curl -sSL "https://api.github.com/repos/microsoft/onnxruntime/releases/latest" | jq -r .tag_name | tr -d v)
|
||||
SYS_ARCH=$(uname -m)
|
||||
|
||||
if [[ $SYS_ARCH == x*64 ]]; then
|
||||
ARCH="x64"
|
||||
elif [[ $SYS_ARCH == arm64 ]] || [[ $ARCH == aarch64 ]]; then
|
||||
ARCH="aarch64"
|
||||
else
|
||||
echo "CPU architecture '$SYS_ARCH' is not supported"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ONNX="onnxruntime-linux-${ARCH}-${ONNX_VER}"
|
||||
ONNX_URL="https://github.com/microsoft/onnxruntime/releases/download/v${ONNX_VER}/${ONNX}.tgz"
|
||||
|
||||
mkdir -p "$CACHE_DIR"
|
||||
|
||||
curl -sSL "$ONNX_URL" -o "${CACHE_DIR}/onnxruntime.tgz"
|
||||
|
||||
tar xf "${CACHE_DIR}/onnxruntime.tgz" --directory="${CACHE_DIR}"
|
||||
|
||||
mkdir -p "${PREFIX}/lib"
|
||||
mkdir -p "${PREFIX}/include"
|
||||
|
||||
cp -r "${CACHE_DIR}/${ONNX}/include/"* "${PREFIX}/include/"
|
||||
cp -r "${CACHE_DIR}/${ONNX}/lib/"* "${PREFIX}/lib/"
|
||||
|
||||
if [[ -z $XDG_DATA_HOME ]]; then
|
||||
DATA_HOME=$HOME/.local/share
|
||||
else
|
||||
DATA_HOME=$XDG_DATA_HOME
|
||||
fi
|
||||
|
||||
if [[ ! -d "$DATA_HOME/monado/hand-tracking-models" ]]; then
|
||||
git clone "https://gitlab.freedesktop.org/monado/utilities/hand-tracking-models" "$DATA_HOME/monado/hand-tracking-models"
|
||||
# Some weird distros aren't configured to automagically do the LFS things; do them just in case.
|
||||
cd "$DATA_HOME/monado/hand-tracking-models"
|
||||
git lfs install
|
||||
git lfs fetch
|
||||
git lfs pull
|
||||
fi
|
||||
|
||||
cd "$DATA_HOME/monado/hand-tracking-models"
|
||||
git pull
|
|
@ -2,5 +2,6 @@ install_data('_clone_or_pull.sh', install_dir: pkgdatadir / 'scripts')
|
|||
install_data('build_basalt.sh', install_dir: pkgdatadir / 'scripts')
|
||||
install_data('build_libsurvive.sh', install_dir: pkgdatadir / 'scripts')
|
||||
install_data('build_monado.sh', install_dir: pkgdatadir / 'scripts')
|
||||
install_data('build_mercury.sh', install_dir: pkgdatadir / 'scripts')
|
||||
install_data('build_opencomposite.sh', install_dir: pkgdatadir / 'scripts')
|
||||
install_data('build_wivrn.sh', install_dir: pkgdatadir / 'scripts')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue