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

Commit

Permalink
Merge branch 'develop' into t/18630/expression_is_positive_negative_i…
Browse files Browse the repository at this point in the history
…ncomplete
  • Loading branch information
rwst committed Nov 9, 2017
2 parents fe039e2 + b707ce9 commit a643c39
Show file tree
Hide file tree
Showing 2,181 changed files with 117,160 additions and 53,486 deletions.
2 changes: 1 addition & 1 deletion COPYING.txt
Expand Up @@ -54,6 +54,7 @@ extcode GPLv2+
fflas_ffpack LGPLv2.1+
flint GPLv2+
flintqs GPLv2+
fplll LGPLv2.1+
freetype FreeType License (similar to BSD; see below)
gap GPLv2+
gcc GPLv3+
Expand All @@ -72,7 +73,6 @@ jinja2 Modified BSD
jmol LGPLv2.1+
jsonschema MIT License
lcalc GPLv2+
libfplll LGPLv2.1+
libgap GPLv3+
libpng Custom, very similar to zlib
linbox LGPLv2.1+
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Expand Up @@ -59,7 +59,7 @@ misc-clean:
rm -rf logs
rm -rf dist
rm -rf tmp
rm -f aclocal.m4 config.log config.status confcache src/bin/sage-env-config
rm -f aclocal.m4 config.log config.status confcache
rm -rf autom4te.cache
rm -f build/make/Makefile build/make/Makefile-auto
rm -f .BUILDSTART
Expand All @@ -71,6 +71,7 @@ distclean: build-clean
$(MAKE) misc-clean
@echo "Deleting all remaining output from build system ..."
rm -rf local
rm -f src/bin/sage-env-config

# Delete all auto-generated files which are distributed as part of the
# source tarball
Expand Down
2 changes: 1 addition & 1 deletion VERSION.txt
@@ -1 +1 @@
SageMath version 8.0.beta9, Release Date: 2017-05-31
SageMath version 8.1.rc0, Release Date: 2017-11-08
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 "$@"
136 changes: 106 additions & 30 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 @@ -216,7 +220,7 @@ while true; do
-s)
export SAGE_KEEP_BUILT_SPKGS=yes;;
-c|--check)
SAGE_CHECK_PACKAGES=x # nonempty, so not set to '!python2' later
SAGE_CHECK_PACKAGES=x # nonempty, so not set to default later
export SAGE_CHECK=yes;;
-*)
echo >&2 "Error: unknown option '$1'"
Expand Down Expand Up @@ -611,7 +615,7 @@ fi
if [ "$USE_LOCAL_SCRIPTS" = yes ]; then
# New-style package
echo "Setting up build directory for $PKG_NAME"
cp -Rp "$PKG_SCRIPTS" "$PKG_NAME"
cp -RLp "$PKG_SCRIPTS" "$PKG_NAME"
cd "$PKG_NAME" || exit $?

sage-uncompress-spkg -d src "$PKG_SRC"
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 All @@ -687,7 +767,7 @@ fi
# Since Python's self-tests seem to fail on all platforms, we disable
# its test suite by default.
if [ -z "$SAGE_CHECK_PACKAGES" ]; then
SAGE_CHECK_PACKAGES='!python2'
SAGE_CHECK_PACKAGES='!python2,!python3'
fi
# Allow spaces, commas, or colons as separator (the documentation suggests commas).
if echo ",$SAGE_CHECK_PACKAGES," | grep -i "[ ,:]\!$PKG_BASE[ ,:]" > /dev/null ; then
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 All @@ -786,13 +859,16 @@ fi
# Mark that the new package has been installed (and tested, if
# applicable).
PKG_NAME_INSTALLED="$SAGE_SPKG_INST/$PKG_NAME"
echo "PACKAGE NAME: $PKG_NAME" > "$PKG_NAME_INSTALLED"
echo "INSTALL DATE: `date`" >> "$PKG_NAME_INSTALLED"
echo "UNAME: `uname -a`" >> "$PKG_NAME_INSTALLED"
if [ -n "$TEST_SUITE_RESULT" ]; then
echo "TEST SUITE: $TEST_SUITE_RESULT" >> "$PKG_NAME_INSTALLED"
fi
cat "$SAGE_ROOT/VERSION.txt" >> "$PKG_NAME_INSTALLED"
cat > "$PKG_NAME_INSTALLED" << __EOF__
{
"package_name": "$PKG_BASE",
"package_version": "$PKG_VER",
"install_date": "$(date)",
"system_uname": "$(uname -a)",
"sage_version": "$(cat "${SAGE_ROOT}/VERSION.txt")",
"test_result": "$TEST_SUITE_RESULT"
}
__EOF__


##################################################################
Expand Down
4 changes: 2 additions & 2 deletions build/make/deps
Expand Up @@ -102,7 +102,7 @@ $(STARTED): $(STANDARD_PACKAGES)
#
# This consists of packages which are required for the Sage build system.
###############################################################################
base: $(inst_bzip2) $(inst_patch) $(inst_pkgconf)
base: $(inst_patch) $(inst_pkgconf)

###############################################################################
# Building normal packages
Expand Down Expand Up @@ -206,7 +206,7 @@ DOC_DEPENDENCIES = sagelib $(inst_sphinx) $(inst_sagenb) \
| $(SAGERUNTIME) $(inst_maxima) $(inst_networkx) $(inst_scipy) \
$(inst_matplotlib) $(inst_pillow) $(inst_mathjax) $(inst_mpmath) \
$(inst_ipykernel) $(inst_jupyter_client) $(inst_conway_polynomials) \
$(inst_tachyon) $(inst_jmol) $(inst_thebe) $(inst_ipywidgets)
$(inst_tachyon) $(inst_jmol) $(inst_thebe) $(inst_ipywidgets) $(inst_typing)

doc: doc-html

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
4 changes: 1 addition & 3 deletions build/pkgs/alabaster/spkg-install 100755 → 100644
@@ -1,3 +1 @@
#!/usr/bin/env bash

cd src && $PIP_INSTALL .
cd src && sdh_pip_install .
4 changes: 1 addition & 3 deletions build/pkgs/appnope/spkg-install 100755 → 100644
@@ -1,10 +1,8 @@
#!/usr/bin/env bash

cd src

# Only install this package on OS X
if python -c 'from sys import *; exit(0 if platform == "darwin" else 1)'; then
$PIP_INSTALL . || exit $?
sdh_pip_install .
else
echo "Not OS X, skipping installation of package 'appnope'"
fi
6 changes: 3 additions & 3 deletions build/pkgs/arb/checksums.ini
@@ -1,4 +1,4 @@
tarball=arb-VERSION.tar.gz
sha1=fcca9134006e77cde5f2024f36150e823bf731ae
md5=b6b94a39b71293b6811a191cb9542096
cksum=248634837
sha1=2f06bfb433cdaecde0e824c5e638094fd666a0d1
md5=d63cdd1147104790826c93bc8651104f
cksum=2745482665
2 changes: 1 addition & 1 deletion build/pkgs/arb/package-version.txt
@@ -1 +1 @@
2.8.1.p1
2.11.1.p0

0 comments on commit a643c39

Please sign in to comment.