Commit 1646d164 authored by Emmanuelle Sarrazin's avatar Emmanuelle Sarrazin

ENH: Add specific scripts to set env vars for python OTB imports

parent ccfdb6a6
......@@ -42,3 +42,10 @@ CC=${BUILD_PREFIX}/bin/${HOST}-gcc CXX=$BUILD_PREFIX/bin/${HOST}-g++ \
ninja install -j 4
ACTIVATE_DIR=$PREFIX/etc/conda/activate.d
DEACTIVATE_DIR=$PREFIX/etc/conda/deactivate.d
mkdir -p $ACTIVATE_DIR
mkdir -p $DEACTIVATE_DIR
cp $RECIPE_DIR/scripts/activate.sh $ACTIVATE_DIR/otb-activate.sh
cp $RECIPE_DIR/scripts/deactivate.sh $DEACTIVATE_DIR/otb-deactivate.sh
#!/bin/bash
# Store existing env vars and set to this conda env
if [[ -n "${PYTHONPATH}" ]]; then
export _CONDA_SET_PYTHONPATH=${PYTHONPATH}
fi
if [ -d ${CONDA_PREFIX}/lib/otb/python/ ]; then
export PYTHONPATH=${CONDA_PREFIX}/lib/otb/python/:${_CONDA_SET_PYTHONPATH}
fi
#!/bin/bash
# Restore previous PYTHONPATH env vars if they were set
unset PYTHONPATH
if [[ -n "${_CONDA_SET_PYTHONPATH}" ]]; then
export PYTHONDATA=${_CONDA_SET_PYTHONPATH}
unset _CONDA_SET_PYTHONPATH
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment