|
1 | | -#!/bin/tcsh -f |
| 1 | +#!/bin/sh |
2 | 2 |
|
3 | | -# |
4 | | -# Copyright (C) 2022 Autodesk, Inc. All Rights Reserved. |
5 | | -# |
6 | | -# SPDX-License-Identifier: Apache-2.0 |
7 | | -# |
8 | | - |
9 | | -# |
10 | | -# This script sets the RV_HOME environment (if not already set), |
11 | | -# makes sure the plugins are the path and launches the actual binary. |
12 | | -# |
13 | | -# NOTE: doesn't properly set RV_HOME if invoked from a link to the script |
14 | | -# and RV_HOME is not already set |
15 | | -# |
16 | | - |
17 | | -set noglob |
18 | | - |
19 | | -# |
20 | | -# Uncomment this if you want to use the pulseaudio/libsndfile package mismatch |
21 | | -# workaround below. |
22 | | -# |
23 | | -#setenv RV_USE_PULSEAUDIO_WORKAROUND 1 |
| 3 | +# Uncomment this if you want to use the pulseaudio/libsndfile package mismatch |
| 4 | +# workaround below. |
| 5 | +# export RV_USE_PULSEAUDIO_WORKAROUND=1 |
24 | 6 |
|
25 | | -# |
26 | | -# Workaround for pulseaudio/libsndfile package mismatch on FC/Cent that causes |
27 | | -# crash when accessing preferences. |
28 | | -# |
29 | | -if ((-e /usr/bin/padsp) && $?RV_USE_PULSEAUDIO_WORKAROUND) then |
30 | | - setenv OPTIONAL_PADSP /usr/bin/padsp |
31 | | -else |
32 | | - setenv OPTIONAL_PADSP "" |
33 | | -endif |
| 7 | +# Workaround for pulseaudio/libsndfile package mismatch on FC/Cent that causes |
| 8 | +# crash when accessing preferences. |
| 9 | +if [ -e /usr/bin/padsp ] && [ -n "$RV_USE_PULSEAUDIO_WORKAROUND" ]; then |
| 10 | + export OPTIONAL_PADSP="/usr/bin/padsp" |
| 11 | +else |
| 12 | + export OPTIONAL_PADSP="" |
| 13 | +fi |
34 | 14 |
|
35 | | -if ($?QT_PLUGIN_PATH) then |
| 15 | +if [ -n "$QT_PLUGIN_PATH" ]; then |
36 | 16 | echo "INFO: warning: QT_PLUGIN_PATH is set, which can cause RV to load the wrong Qt libraries/plugins. Unsetting..." |
37 | | - unsetenv QT_PLUGIN_PATH |
38 | | -endif |
| 17 | + unset QT_PLUGIN_PATH |
| 18 | +fi |
39 | 19 |
|
40 | | -# |
41 | | -# Uncomment this if you're on an older linux distro and RV is hanging in |
42 | | -# the Audio preferences or on startup with audio sources |
43 | | -# |
44 | | -#setenv PA_ALSA_EXCLUDE_DMIX_DEFAULT 1 |
| 20 | +# Uncomment this if you're on an older linux distro and RV is hanging in |
| 21 | +# the Audio preferences or on startup with audio sources |
| 22 | +# export PA_ALSA_EXCLUDE_DMIX_DEFAULT=1 |
45 | 23 |
|
46 | | -# |
47 | | -# For unknown reasons, LANG causes problems when set to |
48 | | -# interesting values (like fr_FR.UTF-8). |
49 | | -# |
50 | | -unsetenv LANG |
51 | | -
|
52 | | -if (! $?RV_HOME) then |
53 | | - set canonicalName = "`readlink -f $0`" |
54 | | - set binName = "$canonicalName:h" |
55 | | - setenv RV_HOME "$binName:h" |
56 | | -endif |
| 24 | +# For unknown reasons, LANG causes problems when set to |
| 25 | +# interesting values (like fr_FR.UTF-8). |
| 26 | +unset LANG |
57 | 27 |
|
58 | | -set platform = i386 |
59 | | -set rvbin = "$RV_HOME/bin/rv.bin.$platform" |
| 28 | +if [ -z "$RV_HOME" ]; then |
| 29 | + current_dir=$(dirname "$(readlink -f "$0")" ) |
| 30 | + root_dir=$(dirname "$current_dir" ) |
| 31 | + export RV_HOME="$root_dir" |
| 32 | +fi |
60 | 33 |
|
61 | | -if (! (-e $rvbin) ) then |
62 | | - set rvbin = "$RV_HOME/bin/rv.bin" |
63 | | -endif |
| 34 | +rvbin="$RV_HOME/bin/rv.bin.i386" |
| 35 | +if [ ! -e "$rvbin" ]; then |
| 36 | + rvbin="$RV_HOME/bin/rv.bin" |
| 37 | +fi |
64 | 38 |
|
65 | | -unsetenv BUILD_ROOT |
66 | | -setenv PATH "$RV_HOME/bin:${PATH}" |
| 39 | +unset BUILD_ROOT |
| 40 | +export PATH="$RV_HOME/bin:$PATH" |
67 | 41 |
|
68 | | -if ($?LD_LIBRARY_PATH) then |
69 | | - setenv LD_LIBRARY_PATH "$RV_HOME/lib:$LD_LIBRARY_PATH" |
| 42 | +if [ -n "$LD_LIBRARY_PATH" ]; then |
| 43 | + export LD_LIBRARY_PATH="$RV_HOME/lib:$LD_LIBRARY_PATH" |
70 | 44 | else |
71 | | - setenv LD_LIBRARY_PATH "$RV_HOME/lib" |
72 | | -endif |
| 45 | + export LD_LIBRARY_PATH="$RV_HOME/lib" |
| 46 | +fi |
73 | 47 |
|
74 | 48 | # Unless the RV_USE_SYSTEM_OPENSSL environment variable is set, use the |
75 | 49 | # OpenSSL provided with RV when the required OpenSSL version cannot be found. |
76 | | -# |
77 | | -if (! $?RV_USE_SYSTEM_OPENSSL) then |
78 | | - set required_openssl_found = "`openssl version | grep 1.1.1`" |
79 | | - if ( "$required_openssl_found" == "" ) then |
80 | | - setenv LD_LIBRARY_PATH "$RV_HOME/lib/OpenSSL:$LD_LIBRARY_PATH" |
81 | | - endif |
82 | | -endif |
| 50 | +# |
| 51 | +if [ -z "$RV_USE_SYSTEM_OPENSSL" ]; then |
| 52 | + required_openssl_found=$( openssl version | grep 1.1.1 ) |
| 53 | + if [ -z "$required_openssl_found" ]; then |
| 54 | + export LD_LIBRARY_PATH="$RV_HOME/lib/OpenSSL:$LD_LIBRARY_PATH" |
| 55 | + fi |
| 56 | +fi |
83 | 57 |
|
84 | 58 | # exec RV |
85 | | -
|
86 | | -
|
87 | | -if ("x$1" == "x") then |
88 | | - # No parameter supplied, just execute app |
89 | | - exec $OPTIONAL_PADSP $rvbin $*:q |
| 59 | +if [ "$1" = "-d" ] || [ "$1" = "--debug" ]; then |
| 60 | + shift # skip '-d / --debug' |
| 61 | + gdb "${OPTIONAL_PADSP}${rvbin}" "$@" |
90 | 62 | else |
91 | | - if ( "$1" == "-d" || "$1" == "--debug") then |
92 | | - shift # skip '-d / --debug' |
93 | | - gdb $OPTIONAL_PADSP $rvbin $*:q |
94 | | - else |
95 | | - exec $OPTIONAL_PADSP $rvbin $*:q |
96 | | - endif |
97 | | -endif |
| 63 | + exec "${OPTIONAL_PADSP}${rvbin}" "$@" |
| 64 | +fi |
0 commit comments