#! /bin/sh
# LIBTBX_DISPATCHER DO NOT EDIT
#
# THIS IS AN AUTOMATICALLY GENERATED FILE.
# DO NOT EDIT! CHANGES WILL BE LOST.
# To customize this auto-generated script create
#
#   dispatcher_include*.sh
#
# files in "/build/cctbx-VsnXtK/cctbx-2024.10+ds2+~3.22.1+ds1/.pybuild/cpython3_3.13/build_" and run
#
#   libtbx.refresh
#
# to re-generate the dispatchers (libtbx.refresh is a subset
# of the functionality of the libtbx/configure.py command).
#
# See also:
#   "/build/cctbx-VsnXtK/cctbx-2024.10+ds2+~3.22.1+ds1/.pybuild/cpython3_3.13/build_/dispatcher_include_template.sh"
#

# ----------------------------------------------------------------------------
# The shellrealpath function resolves an absolute physical path of its
# first argument and stores it in a global shell variable RESULT.
# The function returns nonzero for unreadable or invalid symlinks
# and resets the RESULT to an empty string.

shellrealpath() {
    local ORGDIR="$PWD"
    local TARGET="$1"
    RESULT=""
    # This test fails for a symlink loop.  We can do without resolution
    # of symlinks that point to existing unreadable files.
    [ -r "$TARGET" ] || return $?
    # Check if the readlink command exists.
    type readlink >/dev/null || return $?
    while true; do
        cd "$(dirname "$TARGET")"
        TARGET="$(basename "$TARGET")"
        if [ -L "$TARGET" ]; then
            TARGET="$(readlink "$TARGET")"
            continue
        fi
        RESULT="$(pwd -P)/$TARGET"
        break
    done
    cd "$ORGDIR"
}
# ----------------------------------------------------------------------------

unset PYTHONHOME
LC_ALL=C.UTF-8
export LC_ALL
LIBTBX_BUILD="$(shellrealpath "$0" && cd "$(dirname "$RESULT")/.." && pwd)"
LIBTBX_PYEXE_BASENAME="python3.13"
export LIBTBX_PYEXE_BASENAME
LIBTBX_DISPATCHER_NAME="libtbx.latex"
export LIBTBX_DISPATCHER_NAME
SSL_CERT_FILE="/etc/ssl/certs/ca-certificates.crt"
export SSL_CERT_FILE
OPENBLAS_NUM_THREADS="1"
export OPENBLAS_NUM_THREADS
if [ -n "$PYTHONPATH" ]; then
  PYTHONPATH="$LIBTBX_BUILD/lib/python3/dist-packages/dxtbx/src:$LIBTBX_BUILD/../../..:$LIBTBX_BUILD/lib/python3/dist-packages/dxtbx/src:$LIBTBX_BUILD/lib/python3/dist-packages/boost_adaptbx:$LIBTBX_BUILD/lib:/usr/lib/python3.13/dist-packages:/usr/lib/python3/dist-packages:/usr/local/lib/python3.13/dist-packages:$PYTHONPATH"
  export PYTHONPATH
else
  PYTHONPATH="$LIBTBX_BUILD/lib/python3/dist-packages/dxtbx/src:$LIBTBX_BUILD/../../..:$LIBTBX_BUILD/lib/python3/dist-packages/dxtbx/src:$LIBTBX_BUILD/lib/python3/dist-packages/boost_adaptbx:$LIBTBX_BUILD/lib:/usr/lib/python3.13/dist-packages:/usr/lib/python3/dist-packages:/usr/local/lib/python3.13/dist-packages"
  export PYTHONPATH
fi
if [ -n "$LD_LIBRARY_PATH" ]; then
  LD_LIBRARY_PATH="$LIBTBX_BUILD/lib:/usr/lib:$LD_LIBRARY_PATH"
  export LD_LIBRARY_PATH
else
  LD_LIBRARY_PATH="$LIBTBX_BUILD/lib:/usr/lib"
  export LD_LIBRARY_PATH
fi
if [ -n "$PATH" ]; then
  PATH="$LIBTBX_BUILD/bin:$PATH"
  export PATH
else
  PATH="$LIBTBX_BUILD/bin"
  export PATH
fi
# ---------------------------------------------
# lines marked LIBTBX_PRE_DISPATCHER_INCLUDE_SH
# ---------------------------------------------
# ----------------------------------------------
# lines marked LIBTBX_POST_DISPATCHER_INCLUDE_SH
# ----------------------------------------------
LIBTBX_PYEXE="/usr/bin/$LIBTBX_PYEXE_BASENAME"
export LIBTBX_PYEXE
if [ -n "$LIBTBX__VALGRIND_FLAG__" ]; then
  exec $LIBTBX_VALGRIND "$LIBTBX_BUILD/lib/python3/dist-packages/libtbx/command_line/latex.sh" "$@"
elif [ $# -eq 0 ]; then
  exec "$LIBTBX_BUILD/lib/python3/dist-packages/libtbx/command_line/latex.sh"
else
  exec "$LIBTBX_BUILD/lib/python3/dist-packages/libtbx/command_line/latex.sh" "$@"
fi
