# https://github.com/conda/conda/issues/1679:
#  Internally R_system() calls system() which
# uses /bin/sh to launch various programs. If
# /bin/sh is called with LD_LIBRARY_PATH that
# loads condas shared libraries things break.
#  It may be that not setting LD_LIBRARY_PATH
# causes other things to break, in which case
# R_system() will need to be modified so that
# it calls execve() with an environment which
# has these modifications to LD_LIBRARY_PATH
# removed which may be tricky to orchestrate
if [ "$(uname -s)" = "Linux" ]; then
  return 0
fi
: ${JAVA_HOME=/workspace/croot/r-base_1695428141831/_build_env/x86_64-conda_cos6-linux-gnu/sysroot/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.181.x86_64/jre}
: ${R_JAVA_LD_LIBRARY_PATH=${JAVA_HOME}/lib/amd64/server}
if test -n "/workspace/croot/r-base_1695428141831/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib"; then
: ${R_LD_LIBRARY_PATH=${R_HOME}/lib:/workspace/croot/r-base_1695428141831/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/lib}
else
: ${R_LD_LIBRARY_PATH=${R_HOME}/lib}
fi
if test -n "${R_JAVA_LD_LIBRARY_PATH}"; then
  R_LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}:${R_JAVA_LD_LIBRARY_PATH}"
fi
## This is DYLD_FALLBACK_LIBRARY_PATH on Darwin (macOS) and
## LD_LIBRARY_PATH elsewhere.
## However, on macOS >=10.11 (if SIP is enabled, the default), the
## environment value will not be passed to a script such as R.sh, so
## would not seen here.
if test -z "${LD_LIBRARY_PATH}"; then
  LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}"
else
  LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}"
fi
export LD_LIBRARY_PATH
