Skip to content

Commit bde3df7

Browse files
committed
don't use SAGE_LOCAL/share/gap, switch to GAP's "make install"
also add a workaround for Semigroups (see comment in the code)
1 parent cecae60 commit bde3df7

File tree

2 files changed

+12
-65
lines changed

2 files changed

+12
-65
lines changed

build/pkgs/gap/spkg-install.in

Lines changed: 6 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -8,43 +8,22 @@ export CFLAGS=$CFLAGS_NON_NATIVE
88
export CXXFLAGS=$CXXFLAGS_NON_NATIVE
99

1010
GAP_BUILD_ROOT="$(pwd)"
11-
GAP_ROOT="$SAGE_LOCAL/share/gap"
12-
DESTDIR_GAP_ROOT="$SAGE_DESTDIR$GAP_ROOT"
11+
GAP_ROOT="$SAGE_LOCAL/lib/gap"
1312

1413
# Enable debug info if requested.
1514
# Note that -g3 allows you to use preprocessor macros in gdb which are widely used
1615
if [ "$SAGE_DEBUG" = yes ] ; then
1716
export CFLAGS="-O0 -g3 -DDEBUG_MASTERPOINTERS -DDEBUG_GLOBAL_BAGS -DDEBUG_FUNCTIONS_BAGS $CFLAGS"
1817
fi
1918

20-
sdh_configure $SAGE_CONFIGURE_GMP
21-
sdh_make -j1
19+
# LDFLAGS hack below needed by Semigroups package
20+
sdh_configure $SAGE_CONFIGURE_GMP LDFLAGS="-pthread" --prefix=$SAGE_LOCAL
21+
sdh_make
2222

2323
# GAP's "make install" is work in progress; we use bits and pieces of it
2424
# but we install many things manually.
25-
sdh_make install-headers install-libgap
26-
27-
# Install config.h, which is not currently handled by `make install-headers`
28-
sdh_install build/config.h "$SAGE_LOCAL/include/gap"
29-
30-
# Now install the gap executable as "gap-bin"; it will be called normally
31-
# through our wrapper script that sets the appropriate GAP_ROOT
32-
SAGE_BIN="$SAGE_LOCAL/bin"
33-
mkdir -p "$SAGE_DESTDIR$SAGE_BIN" || sdh_die "Failed to create the directory $SAGE_BIN"
34-
35-
./libtool --mode=install install gap "$SAGE_DESTDIR$SAGE_BIN/gap-bin" || \
36-
sdh_die "Failed to install gap-bin to $SAGE_BIN"
37-
38-
./libtool --mode=install install gac "$SAGE_DESTDIR$SAGE_BIN/gac" || \
39-
sdh_die "Failed to install gac to $SAGE_BIN"
40-
41-
# Now copy additional files GAP needs to run (and a few optional bits) into
42-
# GAP_ROOT; we don't need everything from the source tree
43-
sdh_install bin doc grp lib src tst sysinfo.gap "$GAP_ROOT"
44-
45-
# GAP's copy of libtool is also used by the toolchain for build GAP packages
46-
# (i.e. by gac)
47-
sdh_install libtool "$GAP_ROOT"
25+
sdh_make install
26+
# sdh_make install-headers install-libgap
4827

4928
# Install only the minimal packages GAP needs to run
5029
sdh_install pkg/gapdoc pkg/primgrp pkg/smallgrp pkg/transgrp "$GAP_ROOT"/pkg
@@ -77,34 +56,6 @@ sdh_install \
7756
pkg/utils \
7857
"$GAP_ROOT"/pkg
7958

80-
# Install the GAP startup script; ensure it is executable
81-
sdh_install -T ../gap "$SAGE_BIN/gap"
82-
chmod +x "$SAGE_DESTDIR$SAGE_BIN/gap"
83-
84-
# Create symlinks under $GAP_ROOT for these executables, as they are expected
85-
# (especially when building kernel packages) to exist
86-
ln -sf "../../bin/gap-bin" "$DESTDIR_GAP_ROOT/gap"
87-
ln -sf "../../bin/gac" "$DESTDIR_GAP_ROOT/gac"
88-
89-
# Fix the $GAP_ROOT/bin/<arch>/src symlink to be relative (otherwise it links
90-
# to the actual path of the sources GAP was compiled from)
91-
for srclink in "$DESTDIR_GAP_ROOT"/bin/*/src; do
92-
rm -f "$srclink"
93-
ln -s "../../src" "$srclink"
94-
done
95-
96-
# Additional fixups for some files after they have been copied into their
97-
# destination directory. gac and sysinfo.gap are generated files that contain
98-
# in them hard-coded references to the GAP build directory, which will soon
99-
# be going away. This breaks the build toolchain for some compiled GAP
100-
# packages. We need to replace these paths with the final GAP_ROOT path. The
101-
# below will work so long as neither of these paths contain '|', and if they do
102-
# then god help you. https://github.com/sagemath/sage/issues/27218
103-
sed -i -e "s|$GAP_BUILD_ROOT|$GAP_ROOT|g" \
104-
"$SAGE_DESTDIR$SAGE_BIN/gac" "$DESTDIR_GAP_ROOT/sysinfo.gap" \
105-
"$DESTDIR_GAP_ROOT/bin/gap.sh" "$DESTDIR_GAP_ROOT/doc/make_doc" || \
106-
sdh_die "Failed to fix up hard-coded paths in GAP build tools."
107-
10859
# TODO: This seems unnecessary--we are already installing all of doc/ to
10960
# GAP_ROOT, which is necessary for some functionality in GAP to work. Do
11061
# we need this? Maybe doc/gap could just be a symlink to gap/doc??

build/pkgs/gap_packages/spkg-install.in

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
GAP_ROOT="$SAGE_LOCAL/share/gap"
1+
GAP_ROOT="$SAGE_LOCAL/lib/gap"
22
PKG_DIR="$GAP_ROOT/pkg"
33

44
PKG_SRC_DIR="$(pwd)/src/pkg"
@@ -43,20 +43,16 @@ install_compiled_pkg()
4343
local pkg="$1"
4444
# Install the bin/ dir (where compiled modules should end up)
4545
# under <prefix>/lib/gap; we then symlink to it later
46-
sdh_install bin "$SAGE_LOCAL/lib/gap/pkg/$pkg"
46+
sdh_install * "$SAGE_LOCAL/lib/gap/pkg/$pkg"
4747

48+
# TODO:
4849
# Clean up any build artificts before installing the rest of the package
4950
# Also remove configure/Makefiles
5051
# Note: None, if any of the packages really have a proper install target
51-
make clean # Works for some packages but not all
52-
rm -rf bin/
53-
rm -rf configure configure.* config.* autogen.sh *.m4 Makefile* m4/
52+
#make clean # Works for some packages but not all
53+
#rm -rf bin/
54+
#rm -rf configure configure.* config.* autogen.sh *.m4 Makefile* m4/
5455

55-
# Create the bin/ symlink
56-
ln -s "$SAGE_LOCAL/lib/gap/pkg/$pkg/bin" bin
57-
58-
# Install the rest of the package files
59-
sdh_install * "$PKG_DIR/$pkg"
6056
}
6157

6258
# Build and install compiled packages:

0 commit comments

Comments
 (0)