@@ -164,33 +164,6 @@ cdef void gasman_callback() with gil:
164
164
# ## Initialization of GAP ##################################################
165
165
# ###########################################################################
166
166
167
- def gap_root ():
168
- """
169
- Find the location of the GAP root install which is stored in the gap
170
- startup script.
171
-
172
- EXAMPLES::
173
-
174
- sage: from sage.libs.gap.util import gap_root
175
- sage: gap_root() # random output
176
- '/home/vbraun/opt/sage-5.3.rc0/local/gap/latest'
177
- """
178
- if os.path.exists(sage.env.GAP_ROOT_DIR):
179
- return sage.env.GAP_ROOT_DIR
180
-
181
- # Attempt to figure out the appropriate GAP_ROOT by reading the
182
- # local/bin/gap shell script; this is an ugly hack that exists for
183
- # historical reasons; the best approach to setting where Sage looks for
184
- # the appropriate GAP_ROOT is to set the GAP_ROOT_DIR variable
185
- SAGE_LOCAL = sage.env.SAGE_LOCAL
186
- with open (os.path.join(SAGE_LOCAL, ' bin' , ' gap' )) as f:
187
- gap_sh = f.read().splitlines()
188
- gapdir = next(x for x in gap_sh if x.strip().startswith(' GAP_ROOT' ))
189
- gapdir = gapdir.split(' "' )[1 ]
190
- gapdir = gapdir.replace(' $SAGE_LOCAL' , SAGE_LOCAL)
191
- return gapdir
192
-
193
-
194
167
# To ensure that we call initialize_libgap only once.
195
168
cdef bint _gap_is_initialized = False
196
169
@@ -245,7 +218,7 @@ cdef initialize():
245
218
cdef char * argv[16 ]
246
219
argv[0 ] = " sage"
247
220
argv[1 ] = " -l"
248
- s = str_to_bytes(gap_root() , FS_ENCODING, " surrogateescape" )
221
+ s = str_to_bytes(sage.env.GAP_LIB_DIR + " ; " + sage.env.GAP_SHARE_DIR , FS_ENCODING, " surrogateescape" )
249
222
argv[2 ] = s
250
223
251
224
argv[3 ] = " -m"
0 commit comments