-
-
Notifications
You must be signed in to change notification settings - Fork 32
/
environ
146 lines (129 loc) · 5.01 KB
/
environ
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# Environment settings for running FieldWorks
#
# Source this file in a shell and then run "mono FieldWorks.exe -app {Te,Flex}"
# Possible values for RUNMODE:
# - INSTALLED: when running an installed package
# - PACKAGING: while building the package
# Unset things from incoming environment to avoid unexpected behaviour, such
# as when FW is run from PT. Restore path to something basic, along with the
# dotnet tools path, if present.
unset LD_LIBRARY_PATH \
LD_PRELOAD \
PATH \
MONO_ENABLE_SHM \
MONO_IOMAP \
MONO_WINFORMS_XIM_STYLE \
MOZ_ASSUME_USER_NS \
MOZ_LIBDIR TEXINPUTS \
USE_GTK_DIALOGS \
WINFORMS_FONT_OVERRIDE_EXPLICITLY_SET \
WINFORMS_STYLE_TITLEBAR_COLOR_1 \
WINFORMS_STYLE_TITLEBAR_COLOR_2 \
WINFORMS_STYLE_TITLEBAR_VERTICAL_GRADIENT
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
DOTNET_TOOLS_PATHER="/etc/profile.d/dotnet-cli-tools-bin-path.sh"
if [ -f "${DOTNET_TOOLS_PATHER}" ]; then
. "${DOTNET_TOOLS_PATHER}"
fi
BASE=$(pwd)
INSTALLATION_PREFIX="${INSTALLATION_PREFIX:-/usr}"
COM=$(dirname "${BASE}")/libcom/COM
ARCH=$(uname -m)
BUILD="${BUILD:-Debug}"
MONO_PREFIX="${MONO_PREFIX:-/opt/mono5-sil}"
MONO_SILPKGDIR="${MONO_SILPKGDIR:-/opt/mono5-sil}"
# Dependency locations
# search for xulrunner and geckofx, select the best, and add its location to LD_LIBRARY_PATH
. ./environ-xulrunner
ENC_CONVERTERS="${INSTALLATION_PREFIX}/lib/fieldworks"
ICU_LIBDIR="${INSTALLATION_PREFIX}/lib/fieldworks/lib/x64"
MONO_RUNTIME=v4.0.30319
MONO_DEBUG=explicit-null-checks
MONO_ENV_OPTIONS="-O=-gshared"
# Directory settings
if [ "$RUNMODE" != "INSTALLED" ]
then
PATH="${BASE}/Output_${ARCH}/${BUILD}:\
${INSTALLATION_PREFIX}/lib/fieldworks/icu-bin:\
${COM}/build${ARCH}/bin:\
${PATH}"
LD_LIBRARY_PATH="${BASE}/Output_${ARCH}/${BUILD}:\
${ICU_LIBDIR}:\
${COM}/build${ARCH}/lib:\
${LD_LIBRARY_PATH}"
fi
# ensure we scan the default pkg-config directories (to pick up Geckofx for compiling)
PKG_CONFIG_PATH="${PKG_CONFIG_PATH:-/usr/lib/pkgconfig:/usr/share/pkgconfig}"
# Add packaged mono items to paths
PATH="${MONO_SILPKGDIR}/bin:${PATH}"
LD_LIBRARY_PATH="${MONO_SILPKGDIR}/lib:${ENC_CONVERTERS}:${LD_LIBRARY_PATH}"
PKG_CONFIG_PATH="${MONO_SILPKGDIR}/lib/pkgconfig:${ICU_LIBDIR}/pkgconfig:${PKG_CONFIG_PATH}"
MONO_GAC_PREFIX="${MONO_SILPKGDIR}:${ENC_CONVERTERS}:/usr:${MONO_PREFIX}"
if [ "$RUNMODE" != "PACKAGING" ]
then
# Make locally-built software (eg mono) visible
PATH="${MONO_PREFIX}/bin:${PATH}"
LD_LIBRARY_PATH="${MONO_PREFIX}/lib:${LD_LIBRARY_PATH}"
PKG_CONFIG_PATH="${MONO_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}"
MONO_GAC_PREFIX="${MONO_PREFIX}:${MONO_GAC_PREFIX}"
fi
if [ "$RUNMODE" = "INSTALLED" ]
then
COMPONENTS_MAP_PATH="${BASE}"
FW_ROOT="${BASE}/../../share/fieldworks"
FW_ROOTDATA="${HOME}/.config/fieldworks"
FW_ROOTCODE="${BASE}/../../share/fieldworks"
ICU_DATA="${HOME}/.config/fieldworks/Icu70"
PATH="${BASE}/icu-bin:${PATH}"
LD_LIBRARY_PATH="${BASE}:${ICU_LIBDIR}:${LD_LIBRARY_PATH}"
MONO_REGISTRY_PATH="${HOME}/.config/fieldworks/registry"
MONO_HELP_VIEWER=${BASE}/launch-xchm
else
COMPONENTS_MAP_PATH="${BASE}/Output_${ARCH}/${BUILD}"
FW_ROOT="${BASE}/DistFiles"
FW_ROOTDATA="${BASE}/DistFiles"
FW_ROOTCODE="${BASE}/DistFiles"
ICU_DATA="${BASE}/DistFiles/Icu70"
MONO_REGISTRY_PATH="${BASE}/Output_${ARCH}/registry"
MONO_HELP_VIEWER=${BASE}/Lib/linux/launch-xchm
fi
if [ "$RUNMODE" != "PACKAGING" -a "$RUNMODE" != "INSTALLED" ]
then
FW_CommonAppData=${BASE}/Output_${ARCH}/VarLibFieldworks
[ ! -d $FW_CommonAppData ] && mkdir -p $FW_CommonAppData
[ -d /var/lib/fieldworks/registry ] && cp -r /var/lib/fieldworks/registry $FW_CommonAppData
MONO_PATH="${BASE}/DistFiles:${BASE}/Output_${ARCH}/${BUILD}"
fi
MONO_PATH="${MONO_PATH}:${ENC_CONVERTERS}:${GECKOFX}"
MONO_TRACE_LISTENER="Console.Out"
#MONO_IOMAP=case
MONO_MWF_SCALING=disable
# if debugging Fieldworks for performance unset DEBUG_ENABLE_PTR_VALIDATION env var.
#DEBUG_ENABLE_PTR_VALIDATION=1
# If the standard installation directory for FLExBridge exists, and the environment
# variable is not yet set, set the environment variable for finding FLExBridge.
# (Setting the LocalMachine registry value at installation doesn't work for Linux.)
if [ -z "$FLEXBRIDGEDIR" -a -d "${INSTALLATION_PREFIX}/lib/flexbridge" ]
then
FLEXBRIDGEDIR="${INSTALLATION_PREFIX}/lib/flexbridge"
fi
# Enable the cloud api upload. Remove it or set it to nothing to disable it.
WEBONARY_API="true"
export \
PATH LD_LIBRARY_PATH PKG_CONFIG_PATH LD_PRELOAD \
COMPONENTS_MAP_PATH \
FW_ROOT FW_ROOTCODE FW_ROOTDATA \
ICU_DATA \
FLEXBRIDGEDIR \
WEBONARY_API \
MONO_HELP_VIEWER \
MONO_PATH MONO_REGISTRY_PATH \
MONO_PREFIX MONO_GAC_PREFIX \
MONO_RUNTIME MONO_DEBUG MONO_ENV_OPTIONS \
MONO_TRACE_LISTENER MONO_IOMAP MONO_MWF_SCALING FW_CommonAppData
#DEBUG_ENABLE_PTR_VALIDATION
# prevent Gecko from printing scary message about "double free or corruption" on shutdown
# (See FWNX-1216.) Tom Hindle suggested this hack as a stopgap.
MALLOC_CHECK_=0; export MALLOC_CHECK_
#sets keyboard input method to none
unset XMODIFIERS