Skip to content

Commit a73d0ec

Browse files
orlitzkydimpase
authored andcommitted
build/pkgs/gap_packages/spkg-install.in: fix install with system gap
When the system GAP is installed and the SPKG gap is not, the extra gap_packages need to know where to find sysinfo.gap. We can execute a "gap -c ..." command for this.
1 parent 387bf96 commit a73d0ec

File tree

1 file changed

+31
-2
lines changed

1 file changed

+31
-2
lines changed

build/pkgs/gap_packages/spkg-install.in

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
1-
GAP_ROOT="$SAGE_LOCAL/lib/gap"
2-
PKG_DIR="$GAP_ROOT/pkg"
1+
# Ask GAP for the directory where sysinfo.gap lives. This is to
2+
# support system GAP installations. This root-path gathering
3+
# command is borrowed from gap's spkg-configure.m4 and modified
4+
# to separate the paths with spaces.
5+
GAPRUN="gap -r -q --bare --nointeract -c"
6+
_cmd='Display(JoinStringsWithSeparator(GAPInfo.RootPaths," "));'
7+
GAP_ROOT_PATHS=$(${GAPRUN} "${_cmd}")
8+
9+
# Loop though GAP_ROOT_PATHS looking for sysinfo.gap
10+
GAP_ROOT=""
11+
for grp in $GAP_ROOT_PATHS; do
12+
if [ -f "${grp}/sysinfo.gap" ]; then
13+
GAP_ROOT=$grp
14+
echo "found GAP root $GAP_ROOT"
15+
break
16+
fi
17+
done
18+
19+
# Try the old sage default if nothing else worked.
20+
if [ -z "$GAP_ROOT" ]; then
21+
GAP_ROOT="$SAGE_LOCAL/lib/gap"
22+
echo "falling back to GAP root $GAP_ROOT"
23+
fi
24+
25+
# And finally, throw an error ASAP if the build is going to fail anyway.
26+
if [ ! -f "${GAP_ROOT}/sysinfo.gap" ]; then
27+
sdh_die "no sysinfo.gap in your gap root"
28+
fi
29+
30+
# Where to install these packages
31+
PKG_DIR="$SAGE_LOCAL/lib/gap/pkg"
332

433
PKG_SRC_DIR="$(pwd)/src/pkg"
534
cd "$PKG_SRC_DIR"

0 commit comments

Comments
 (0)