Advertisement
Guest User

Untitled

a guest
Sep 7th, 2018
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.12 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. SCRIPT="$0"
  4.  
  5. # Resolve the chain of symlinks leading to this script.
  6. while [ -L "$SCRIPT" ] ; do
  7.     LINK=$(readlink "$SCRIPT")
  8.  
  9.     case "$LINK" in
  10.         /*)
  11.             SCRIPT="$LINK"
  12.             ;;
  13.         *)
  14.             SCRIPT="$(dirname "$SCRIPT")/$LINK"
  15.             ;;
  16.     esac
  17. done
  18.  
  19. # The directory containing this shell script - an absolute path.
  20. ROOT=$(dirname "$SCRIPT")
  21. ROOT=$(cd "$ROOT"; pwd)
  22.  
  23. # The name of this shell script without the .sh on the end.
  24. BASEFILE=$(basename "$SCRIPT" .sh)
  25.  
  26. if [ -z "$RENPY_PLATFORM" ] ; then
  27.     RENPY_PLATFORM="$(uname -s)-$(uname -m)"
  28.  
  29.     case "$RENPY_PLATFORM" in
  30.         Darwin-*)
  31.             RENPY_PLATFORM="darwin-x86_64"
  32.             ROOT1="$ROOT/../Resources/autorun"
  33.             ROOT2="$ROOT/../../.."
  34.                         ;;
  35.         *-x86_64|amd64)
  36.             RENPY_PLATFORM="linux-x86_64"
  37.             ROOT1="$ROOT"
  38.             ROOT2="$ROOT"
  39.             ;;
  40.         *-i*86)
  41.             RENPY_PLATFORM="linux-i686"
  42.             ROOT1="$ROOT"
  43.             ROOT2="$ROOT"
  44.             ;;
  45.         Linux-*)
  46.             RENPY_PLATFORM="linux-$(uname -m)"
  47.             ROOT1="$ROOT"
  48.             ROOT2="$ROOT"
  49.             ;;
  50.         *)
  51.             ROOT1="$ROOT"
  52.             ROOT2="$ROOT"
  53.             ;;
  54.     esac
  55. fi
  56.  
  57.  
  58. for BASE in "$ROOT" "$ROOT1" "$ROOT2"; do
  59.     LIB="$BASE/lib/$RENPY_PLATFORM"
  60.     if test -d "$LIB"; then
  61.         break
  62.     fi
  63. done
  64.  
  65. for BASE in "$ROOT" "$ROOT1" "$ROOT2"; do
  66.     if test -e "$BASE/$BASEFILE.py"; then
  67.         break
  68.     fi
  69. done
  70.  
  71. if ! test -d "$LIB"; then
  72.     echo "Ren'Py platform files not found in:"
  73.     echo
  74.     echo "$ROOT/lib/$RENPY_PLATFORM"
  75.     echo
  76.     echo "Please compile the platform files using the instructions in README.md"
  77.     echo "or point them to an existing installation using ./after_checkout.sh <path>."
  78.     echo
  79.     echo "Alternatively, please set RENPY_PLATFORM to a different platform."
  80.     exit 1
  81. fi
  82.  
  83. if test -n "$LD_LIBRARY_PATH"; then
  84.     export LD_LIBRARY_PATH="$LIB:$LD_LIBRARY_PATH"
  85. fi
  86.  
  87. exec $RENPY_GDB "$LIB/$BASEFILE" $RENPY_PYARGS -EO "$BASE/$BASEFILE.py" "$@"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement