Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 944e05e

Browse files
committed
Merge branch 'develop' into t/23190/23190
2 parents e2c1e36 + e77531e commit 944e05e

File tree

489 files changed

+6037
-4478
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

489 files changed

+6037
-4478
lines changed

VERSION.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
SageMath version 8.1.beta0, Release Date: 2017-07-29
1+
SageMath version 8.1.beta1, Release Date: 2017-08-04

build/bin/sage-python23

+10
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,15 @@ else
1717
PYTHON="$SAGE_LOCAL/bin/python2"
1818
fi
1919

20+
# Check that Python is actually installed and issue an error message if not--in
21+
# particular if this was run from an spkg-install before Python is installed
22+
# this indicates that Python should be a dependency of that package.
23+
if [ ! -x "$PYTHON" ]; then
24+
echo >&2 "Error: Tried to use Sage's Python which was not yet installed."
25+
echo >&2 'If this was called from an spkg-install script for another '
26+
echo >&2 'package you should add $(PYTHON) as a dependency in '
27+
echo >&2 'build/pkgs/<pkg>/dependencies'
28+
exit 1
29+
fi
2030

2131
exec $PYTHON "$@"

build/bin/sage-spkg

+74-20
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,79 @@ cd ..
650650
# The package has been extracted, prepare for installation
651651
##################################################################
652652

653+
# Rewrites the given bash pseudo-script with a boilerplate header that includes
654+
# the shebang line and sourcing sage-env. Make sure the name of the script is
655+
# passed in as an absolute path.
656+
write_script_wrapper() {
657+
local script="$1"
658+
local pkgdir="$(dirname "$script")"
659+
660+
trap "echo >&2 Error: Unexpected error writing wrapper script for $script; exit \$_" ERR
661+
662+
if head -1 "$script" | grep '^#!.*$' >/dev/null; then
663+
echo >&2 "Error: ${script##*/} should not contain a shebang line; it will be prepended automatically."
664+
exit 1
665+
fi
666+
667+
local tmpscript="$(dirname "$script")/.tmp-${script##*/}"
668+
669+
cat > "$tmpscript" <<__EOF__
670+
#!/usr/bin/env bash
671+
672+
export SAGE_ROOT="$SAGE_ROOT"
673+
export SAGE_SRC="$SAGE_SRC"
674+
export SAGE_PKG_DIR="$pkgdir"
675+
676+
source "\$SAGE_SRC/bin/sage-env"
677+
if [ \$? -ne 0 ]; then
678+
echo >&2 "Error: failed to source sage-env; is \$SAGE_ROOT the correct SAGE_ROOT?"
679+
exit 1
680+
fi
681+
682+
cd "\$SAGE_PKG_DIR"
683+
if [ \$? -ne 0 ]; then
684+
echo >&2 "Error: could not cd to the package build directory \$SAGE_PKG_DIR"
685+
exit 1
686+
fi
687+
688+
__EOF__
689+
690+
cat "$script" >> "$tmpscript"
691+
mv "$tmpscript" "$script"
692+
chmod +x "$script"
693+
694+
trap - ERR
695+
}
696+
697+
698+
for script in build install check; do
699+
script="spkg-$script"
700+
if [ -f "$script" ]; then
701+
if [ "$USE_LOCAL_SCRIPTS" = "yes" ]; then
702+
if [ -x "$script" ]; then
703+
msg="$script should not be marked executable in the build/pkgs directory"
704+
if [ "$UNAME" = "CYGWIN" ]; then
705+
# On Cygwin we can't necessarily rely on file permissions
706+
# being sane, so just issue a warning; on other platforms
707+
# this should be enforced as an error
708+
echo >&2 "WARNING: $msg"
709+
else
710+
error_msg "$msg"
711+
exit 1
712+
fi
713+
fi
714+
715+
write_script_wrapper $(pwd)/"$script"
716+
else
717+
if [ ! -x "$script" ]; then
718+
echo >&2 "WARNING: $script is not executable, making it executable"
719+
chmod +x "$script"
720+
fi
721+
fi
722+
fi
723+
done
724+
725+
653726
# When there is no spkg-install, assume the "spkg" is a tarball not
654727
# specifically made for Sage. Since we want it to be as easy as
655728
# possible to install such a package, we "guess" spkg-install.
@@ -667,17 +740,6 @@ if [ ! -f spkg-install ]; then
667740
chmod +x spkg-install
668741
fi
669742

670-
# If spkg-install is a Python script (i.e. the first line of the file
671-
# contains "python"), verify that Python has already been installed.
672-
if head -1 spkg-install | grep python >/dev/null; then
673-
# If there is no Python installed in local/bin, exit with an error.
674-
if [ ! -x "$SAGE_LOCAL"/bin/python ]; then
675-
echo >&2 "Error: The spkg-install script is written in Python, but the Python"
676-
echo >&2 'package is not yet installed in Sage. You should add $(PYTHON)'
677-
echo >&2 "as dependency in build/pkgs/$PKG_BASE/dependencies"
678-
exit 1
679-
fi
680-
fi
681743

682744
# SAGE_CHECK_PACKAGES: if this contains "!pkg", skip tests for "pkg",
683745
# so set SAGE_CHECK=no. If this contains "pkg", run tests, so set
@@ -723,12 +785,8 @@ export rsync_proxy=$http_proxy
723785
##################################################################
724786
# Actually install
725787
##################################################################
726-
if [ ! -x spkg-install ]; then
727-
echo >&2 "WARNING: spkg-install is not executable, making it executable"
728-
chmod +x spkg-install
729-
fi
730788

731-
if [ -x spkg-build ]; then
789+
if [ -f spkg-build ]; then
732790
# Package has both spkg-build and spkg-install; execute the latter with SAGE_SUDO
733791
time ./spkg-build
734792
if [ $? -ne 0 ]; then
@@ -761,10 +819,6 @@ echo "Successfully installed $PKG_NAME"
761819
if [ "$SAGE_CHECK" = "yes" ]; then
762820
if [ -f spkg-check ]; then
763821
echo "Running the test suite for $PKG_NAME..."
764-
if [ ! -x spkg-check ]; then
765-
echo >&2 "WARNING: spkg-check is not executable, making it executable"
766-
chmod +x spkg-check
767-
fi
768822
time ./spkg-check
769823
if [ $? -ne 0 ]; then
770824
error_msg "Error testing package $PKG_NAME" "make check"

build/pkgs/4ti2/spkg-check

100755100644
-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env bash
2-
31
if [ -z "$SAGE_LOCAL" ]; then
42
echo >&2 "Error: SAGE_LOCAL undefined - exiting..."
53
echo >&2 "Maybe run 'sage -sh'?"

build/pkgs/4ti2/spkg-install

100755100644
-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env bash
2-
31
cd src/
42

53
if [ "$SAGE_LOCAL" = "" ]; then

build/pkgs/alabaster/spkg-install

100755100644
-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
#!/usr/bin/env bash
2-
31
cd src && $PIP_INSTALL .

build/pkgs/appnope/spkg-install

100755100644
-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env bash
2-
31
cd src
42

53
# Only install this package on OS X

build/pkgs/arb/spkg-check

100755100644
-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
#!/usr/bin/env bash
2-
31
cd src
42
$MAKE check

build/pkgs/arb/spkg-install

100755100644
-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env bash
2-
31
cd src
42

53
# The git head of arb now honors LDFLAGS; The following workaround can

build/pkgs/atlas/spkg-check

100755100644
-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env bash
2-
31
######################################################################
42
### Sanity check
53
######################################################################

0 commit comments

Comments
 (0)