From d7f3c88f5d81c20f1b7ca1d71a3f90c8dc1c91e9 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Tue, 16 Feb 2016 15:42:35 +0100 Subject: [PATCH] scripts/setenv_local.sh: set environment to run from built source tree --- scripts/setenv_local.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 scripts/setenv_local.sh diff --git a/scripts/setenv_local.sh b/scripts/setenv_local.sh new file mode 100644 index 00000000..acf39bf9 --- /dev/null +++ b/scripts/setenv_local.sh @@ -0,0 +1,32 @@ +#! /usr/bin/env bash + +# This script sets the environment to execute aubio binaries and python code +# directly from build/ python/build/ without installing libaubio on the system + +# Usage: $ source ./scripts/setenv_local.sh + +# WARNING: this script will *overwrite* existing (DY)LD_LIBRARY_PATH and +# PYTHONPATH variables. + +PYTHON_PLATFORM=`python -c "import pkg_resources, sys; print '%s-%s' % (pkg_resources.get_build_platform(), '.'.join(map(str, sys.version_info[0:2])))"` + +AUBIODIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )" +AUBIOLIB=$AUBIODIR/build/src +AUBIOPYTHON=$AUBIODIR/python/build/lib.$PYTHON_PLATFORM + +if [ "$(dirname $PWD)" == "scripts" ]; then + AUBIODIR=$(basename $PWD) +else + AUBIODIR=$(basename $PWD) +fi + +if [ "$(uname)" == "Darwin" ]; then + export DYLD_LIBRARY_PATH=$AUBIOLIB + echo export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH +else + export LD_LIBRARY_PATH=$AUBIOLIB + echo export LD_LIBRARY_PATH=$LD_LIBRARY_PATH +fi + +export PYTHONPATH=$AUBIOPYTHON +echo export PYTHONPATH=$PYTHONPATH -- 2.11.0