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

Commit

Permalink
Merge tag '8.1.beta3' into t/21437/fix-mtx-matrices
Browse files Browse the repository at this point in the history
SageMath version 8.1.beta3
  • Loading branch information
jdemeyer committed Aug 31, 2017
2 parents 6cba43e + 037272c commit 656dc9c
Show file tree
Hide file tree
Showing 1,099 changed files with 27,637 additions and 12,689 deletions.
2 changes: 1 addition & 1 deletion VERSION.txt
@@ -1 +1 @@
SageMath version 8.0.rc1, Release Date: 2017-07-05
SageMath version 8.1.beta3, Release Date: 2017-08-21
10 changes: 10 additions & 0 deletions build/bin/sage-python23
Expand Up @@ -17,5 +17,15 @@ else
PYTHON="$SAGE_LOCAL/bin/python2"
fi

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

exec $PYTHON "$@"
113 changes: 93 additions & 20 deletions build/bin/sage-spkg
Expand Up @@ -21,6 +21,9 @@
# SAGE_ROOT -- root directory of sage install
# SAGE_LOCAL -- $SAGE_ROOT/local
# SAGE_DISTFILES -- directory that stores upstream tarballs
# PKG_BASE -- the base name of the package itself (e.g. 'patch')
# PKG_VER -- the version number of the package
# PKG_NAME -- $PKG_BASE-$PKG_VER
# LIBRARY_PATH, PYTHONPATH, LD_LIBRARY_PATH, DYLD_LIBRARY_PATH
# CC, CXX, CFLAGS, CXXFLAGS, LDFLAGS, MAKE
#
Expand Down Expand Up @@ -153,6 +156,7 @@ fi
# than exiting. Using dot suggested by W. Cheung.
. sage-env


if [ $? -ne 0 ]; then
error_msg "Error setting environment variables by sourcing sage-env"
exit 1
Expand Down Expand Up @@ -650,6 +654,93 @@ cd ..
# The package has been extracted, prepare for installation
##################################################################

# Rewrites the given bash pseudo-script with a boilerplate header that includes
# the shebang line and sourcing sage-env. Make sure the name of the script is
# passed in as an absolute path.
write_script_wrapper() {
local script="$1"
local pkgdir="$(dirname "$script")"

trap "echo >&2 Error: Unexpected error writing wrapper script for $script; exit \$_" ERR

if head -1 "$script" | grep '^#!.*$' >/dev/null; then
echo >&2 "Error: ${script##*/} should not contain a shebang line; it will be prepended automatically."
exit 1
fi

local tmpscript="$(dirname "$script")/.tmp-${script##*/}"

cat > "$tmpscript" <<__EOF__
#!/usr/bin/env bash
export SAGE_ROOT="$SAGE_ROOT"
export SAGE_SRC="$SAGE_SRC"
export SAGE_PKG_DIR="$pkgdir"
export PKG_NAME="$PKG_NAME"
export PKG_BASE="$PKG_BASE"
export PKG_VER="$PKG_VER"
for lib in env dist-helpers; do
lib="sage-\$lib"
source "\$SAGE_SRC/bin/\$lib"
if [ \$? -ne 0 ]; then
echo >&2 "Error: failed to source \$lib"
echo >&2 "Is \$SAGE_ROOT the correct SAGE_ROOT?"
exit 1
fi
done
sdh_guard
if [ \$? -ne 0 ]; then
echo >&2 "Error: sdh_guard not found; Sage environment was not set up properly"
exit 1
fi
cd "\$SAGE_PKG_DIR"
if [ \$? -ne 0 ]; then
echo >&2 "Error: could not cd to the package build directory \$SAGE_PKG_DIR"
exit 1
fi
__EOF__

cat "$script" >> "$tmpscript"
mv "$tmpscript" "$script"
chmod +x "$script"

trap - ERR
}


for script in build install check; do
script="spkg-$script"
if [ -f "$script" ]; then
if [ "$USE_LOCAL_SCRIPTS" = "yes" ]; then
if [ -x "$script" ]; then
msg="$script should not be marked executable in the build/pkgs directory"
if [ "$UNAME" = "CYGWIN" ]; then
# On Cygwin we can't necessarily rely on file permissions
# being sane, so just issue a warning; on other platforms
# this should be enforced as an error
echo >&2 "WARNING: $msg"
else
error_msg "$msg"
exit 1
fi
fi

write_script_wrapper $(pwd)/"$script"
else
if [ ! -x "$script" ]; then
echo >&2 "WARNING: $script is not executable, making it executable"
chmod +x "$script"
fi
fi
fi
done


# When there is no spkg-install, assume the "spkg" is a tarball not
# specifically made for Sage. Since we want it to be as easy as
# possible to install such a package, we "guess" spkg-install.
Expand All @@ -667,17 +758,6 @@ if [ ! -f spkg-install ]; then
chmod +x spkg-install
fi

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

# SAGE_CHECK_PACKAGES: if this contains "!pkg", skip tests for "pkg",
# so set SAGE_CHECK=no. If this contains "pkg", run tests, so set
Expand Down Expand Up @@ -723,12 +803,9 @@ export rsync_proxy=$http_proxy
##################################################################
# Actually install
##################################################################
if [ ! -x spkg-install ]; then
echo >&2 "WARNING: spkg-install is not executable, making it executable"
chmod +x spkg-install
fi

if [ -x spkg-build ]; then

if [ -f spkg-build ]; then
# Package has both spkg-build and spkg-install; execute the latter with SAGE_SUDO
time ./spkg-build
if [ $? -ne 0 ]; then
Expand Down Expand Up @@ -761,10 +838,6 @@ echo "Successfully installed $PKG_NAME"
if [ "$SAGE_CHECK" = "yes" ]; then
if [ -f spkg-check ]; then
echo "Running the test suite for $PKG_NAME..."
if [ ! -x spkg-check ]; then
echo >&2 "WARNING: spkg-check is not executable, making it executable"
chmod +x spkg-check
fi
time ./spkg-check
if [ $? -ne 0 ]; then
error_msg "Error testing package $PKG_NAME" "make check"
Expand Down
2 changes: 0 additions & 2 deletions build/pkgs/4ti2/spkg-check 100755 → 100644
@@ -1,5 +1,3 @@
#!/usr/bin/env bash

if [ -z "$SAGE_LOCAL" ]; then
echo >&2 "Error: SAGE_LOCAL undefined - exiting..."
echo >&2 "Maybe run 'sage -sh'?"
Expand Down
2 changes: 0 additions & 2 deletions build/pkgs/4ti2/spkg-install 100755 → 100644
@@ -1,5 +1,3 @@
#!/usr/bin/env bash

cd src/

if [ "$SAGE_LOCAL" = "" ]; then
Expand Down
2 changes: 0 additions & 2 deletions build/pkgs/alabaster/spkg-install 100755 → 100644
@@ -1,3 +1 @@
#!/usr/bin/env bash

cd src && $PIP_INSTALL .
2 changes: 0 additions & 2 deletions build/pkgs/appnope/spkg-install 100755 → 100644
@@ -1,5 +1,3 @@
#!/usr/bin/env bash

cd src

# Only install this package on OS X
Expand Down
2 changes: 0 additions & 2 deletions build/pkgs/arb/spkg-check 100755 → 100644
@@ -1,4 +1,2 @@
#!/usr/bin/env bash

cd src
$MAKE check
2 changes: 0 additions & 2 deletions build/pkgs/arb/spkg-install 100755 → 100644
@@ -1,5 +1,3 @@
#!/usr/bin/env bash

cd src

# The git head of arb now honors LDFLAGS; The following workaround can
Expand Down
2 changes: 0 additions & 2 deletions build/pkgs/atlas/spkg-check 100755 → 100644
@@ -1,5 +1,3 @@
#!/usr/bin/env bash

######################################################################
### Sanity check
######################################################################
Expand Down

0 comments on commit 656dc9c

Please sign in to comment.