diff --git a/Makefile b/Makefile index a7df7e96cb9..fb8aa9887b5 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ build: all-build # If configure was run before, rerun it with the old arguments. # Otherwise, run configure with argument $PREREQ_OPTIONS. -build/make/Makefile: configure +build/make/Makefile: configure build/pkgs/*/* rm -f config.log mkdir -p logs/pkgs ln -s logs/pkgs/config.log config.log @@ -119,8 +119,7 @@ ptestoptional: ptestall # just an alias ptestoptionallong: ptestalllong # just an alias -configure: configure.ac src/bin/sage-version.sh \ - m4/ax_c_check_flag.m4 m4/ax_gcc_option.m4 m4/ax_gcc_version.m4 m4/ax_gxx_option.m4 m4/ax_gxx_version.m4 m4/ax_prog_perl_version.m4 +configure: configure.ac src/bin/sage-version.sh m4/*.m4 ./bootstrap -d install: diff --git a/README.txt b/README.txt index 116ae89d089..d6ca4807335 100644 --- a/README.txt +++ b/README.txt @@ -72,7 +72,6 @@ Installation Guide: 1. Make sure you have the dependencies and 5 GB of free disk space. All Linux versions: gcc, make, m4, perl, ranlib, and tar. - Debian or Ubuntu systems: the dpkg-dev package. Fedora or RedHat systems: the perl-ExtUtils-MakeMaker package. (install these using your package manager) diff --git a/VERSION.txt b/VERSION.txt index feb64723094..dca9f86c336 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -Sage version 6.10.beta2, released 2015-10-28 +Sage version 6.10.beta6, released 2015-11-27 diff --git a/build/bin/sage-spkg b/build/bin/sage-spkg index f734d49bee5..a3571a0271d 100755 --- a/build/bin/sage-spkg +++ b/build/bin/sage-spkg @@ -637,8 +637,8 @@ if [ ! -x spkg-install ]; then echo >&2 "WARNING: spkg-install is not executable, making it executable" chmod +x spkg-install fi -time ./spkg-install +time ./spkg-install if [ $? -ne 0 ]; then error_msg "Error installing package $PKG_NAME" "make" exit 1 @@ -665,6 +665,12 @@ if [ "$SAGE_CHECK" = "yes" ]; then fi fi +rm -f "$SAGE_LOCAL"/lib/*.la +if [ $? -ne 0 ]; then + error_msg "Error deleting unnecessary libtool archive files" + exit 1 +fi + # Mark that the new package has been installed (and tested, if # applicable). PKG_NAME_INSTALLED="$SAGE_SPKG_INST/$PKG_NAME" diff --git a/build/pkgs/boost_cropped/SPKG.txt b/build/pkgs/boost_cropped/SPKG.txt index 7f43e2945f0..7493e9997d2 100644 --- a/build/pkgs/boost_cropped/SPKG.txt +++ b/build/pkgs/boost_cropped/SPKG.txt @@ -24,6 +24,10 @@ None == Releases == +=== boost_cropped-1.58.0 (Emmanuel Charpentier, November 13th, 2015) === + * Updated to boost_1_58_0/boost + * Created spkg-src + === boost_cropped-1.52.0 (Timo Kluck, February 26th, 2013) === * Drop sage patches; take all upstream headers diff --git a/build/pkgs/boost_cropped/checksums.ini b/build/pkgs/boost_cropped/checksums.ini index 647e05322de..c9eae471c4e 100644 --- a/build/pkgs/boost_cropped/checksums.ini +++ b/build/pkgs/boost_cropped/checksums.ini @@ -1,4 +1,4 @@ tarball=boost_cropped-VERSION.tar.bz2 -sha1=25daefce8a55f14bb56b72fffd573972cd2379d2 -md5=764a6c0aa03e39b70053135dc6edaa30 -cksum=111720154 +sha1=b49df7c91f384c991d73d9536d5a22805c2b2ad3 +md5=b7f01ecfcb43f088978479d8b71668f7 +cksum=3931350148 diff --git a/build/pkgs/boost_cropped/package-version.txt b/build/pkgs/boost_cropped/package-version.txt index a63cb35e6f0..79f82f6b8e0 100644 --- a/build/pkgs/boost_cropped/package-version.txt +++ b/build/pkgs/boost_cropped/package-version.txt @@ -1 +1 @@ -1.52.0 +1.58.0 diff --git a/build/pkgs/boost_cropped/spkg-src b/build/pkgs/boost_cropped/spkg-src new file mode 100755 index 00000000000..6e309ec8fe5 --- /dev/null +++ b/build/pkgs/boost_cropped/spkg-src @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +set -e + +VERSION=$(cat package-version.txt) +SOURCE_VERSION=$(echo $VERSION | tr . _) +SOURCE_DIR=boost_$SOURCE_VERSION +SOURCE_TARBALL=$SOURCE_DIR.tar.bz2 + +DEST_DIR=boost_cropped-$VERSION +DEST_TARBALL=$DEST_DIR.tar.bz2 + +CURDIR=$(pwd) +TMPDIR=$(mktemp -d) + +cp $SOURCE_TARBALL $TMPDIR +cd $TMPDIR + +tar xjf $SOURCE_TARBALL +mkdir $DEST_DIR +mv $SOURCE_DIR/boost $DEST_DIR +tar cjf $DEST_TARBALL $DEST_DIR + +mv $DEST_TARBALL $CURDIR +cd $CURDIR + +rm -Rf $TMPDIR diff --git a/build/pkgs/configure/checksums.ini b/build/pkgs/configure/checksums.ini index c6a3fac1146..785a50b1143 100644 --- a/build/pkgs/configure/checksums.ini +++ b/build/pkgs/configure/checksums.ini @@ -1,4 +1,4 @@ tarball=configure-VERSION.tar.gz -sha1=d7f2ecde69b59bec3887fd0ba1f4e2784394fd6b -md5=fa6127892f72b56b96a592fcec729f25 -cksum=1455899060 +sha1=8d5005d113eab69e9c43e9c0b7c506ced309e392 +md5=599302157657d7a00ea2936393b061c5 +cksum=2156332361 diff --git a/build/pkgs/configure/package-version.txt b/build/pkgs/configure/package-version.txt index 9f54fe3133b..0a3e7b04225 100644 --- a/build/pkgs/configure/package-version.txt +++ b/build/pkgs/configure/package-version.txt @@ -1 +1 @@ -122 +126 diff --git a/build/pkgs/cycler/SPKG.txt b/build/pkgs/cycler/SPKG.txt new file mode 100644 index 00000000000..2b8a4665363 --- /dev/null +++ b/build/pkgs/cycler/SPKG.txt @@ -0,0 +1,24 @@ += cycler = + +== Description == + +Cycler is a small break of of matplotlib to +deal with "composable cycles". +It is a required dependency of matplotlib 1.5.0. + +== License == +BSD + +== Upstream Contact == + +cycler is developed on github: https://github.com/matplotlib/cycler + +A more informative webpage about cycler, its motivation and usage +is at http://tacaswell.github.io/cycler/ + +== Dependencies == + + * python + * setuptools + * six + diff --git a/build/pkgs/cycler/checksums.ini b/build/pkgs/cycler/checksums.ini new file mode 100644 index 00000000000..017d8a15b95 --- /dev/null +++ b/build/pkgs/cycler/checksums.ini @@ -0,0 +1,4 @@ +tarball=cycler-VERSION.tar.gz +sha1=cb50081b6f6d55796ab2ae2f5dfc6d4d59b94506 +md5=0b418dbaded3aba6021af03246e2f7d0 +cksum=229891196 diff --git a/build/pkgs/cycler/dependencies b/build/pkgs/cycler/dependencies new file mode 100644 index 00000000000..89d12d33c35 --- /dev/null +++ b/build/pkgs/cycler/dependencies @@ -0,0 +1,5 @@ +$(INST)/$(PYTHON) $(INST)/$(SETUPTOOLS) $(INST)/$(SIX) +---------- +All lines of this file are ignored except the first. +It is copied by SAGE_ROOT/build/make/install into SAGE_ROOT/build/make/Makefile. + diff --git a/build/pkgs/cycler/package-version.txt b/build/pkgs/cycler/package-version.txt new file mode 100644 index 00000000000..ac39a106c48 --- /dev/null +++ b/build/pkgs/cycler/package-version.txt @@ -0,0 +1 @@ +0.9.0 diff --git a/build/pkgs/cycler/spkg-install b/build/pkgs/cycler/spkg-install new file mode 100644 index 00000000000..a536f3232ac --- /dev/null +++ b/build/pkgs/cycler/spkg-install @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +if [ "$SAGE_LOCAL" = "" ]; then + echo "SAGE_LOCAL undefined ... exiting"; + echo "Maybe run 'sage -sh'?" + exit 1 +fi + +cd src + +python setup.py install +if [ $? -ne 0 ]; then + echo "Error installing cycler ... exiting" + exit 1 +fi + diff --git a/build/pkgs/cycler/type b/build/pkgs/cycler/type new file mode 100644 index 00000000000..a6a7b9cd726 --- /dev/null +++ b/build/pkgs/cycler/type @@ -0,0 +1 @@ +standard diff --git a/build/pkgs/ipykernel/checksums.ini b/build/pkgs/ipykernel/checksums.ini index 7c68b0f4ba3..d0e31288fed 100644 --- a/build/pkgs/ipykernel/checksums.ini +++ b/build/pkgs/ipykernel/checksums.ini @@ -1,4 +1,4 @@ tarball=ipykernel-VERSION.tar.gz -sha1=53dc62e7cfd7582df4dc0a7d0da2463fcf294329 -md5=86b6a392e5ca727284220ea0034ec4d5 -cksum=55668233 +sha1=779512583ddd1ad257ce93ea4d326a55b5da91a0 +md5=6093813ebd95b790c7eb4c9841bd07ce +cksum=3904063097 diff --git a/build/pkgs/ipykernel/package-version.txt b/build/pkgs/ipykernel/package-version.txt index 8539bce652f..627a3f43a64 100644 --- a/build/pkgs/ipykernel/package-version.txt +++ b/build/pkgs/ipykernel/package-version.txt @@ -1 +1 @@ -4.0.3.p0 +4.1.1 diff --git a/build/pkgs/ipykernel/patches/sigint.patch b/build/pkgs/ipykernel/patches/sigint.patch deleted file mode 100644 index 6b6b670d753..00000000000 --- a/build/pkgs/ipykernel/patches/sigint.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 443f56f982fb678041c0a9dfb85348e6d646053b Mon Sep 17 00:00:00 2001 -From: Jeroen Demeyer -Date: Fri, 4 Sep 2015 16:24:28 +0200 -Subject: [PATCH] Abstract signal handler changes in hooks - ---- - ipykernel/kernelbase.py | 14 +++++++++++--- - 1 file changed, 11 insertions(+), 3 deletions(-) - -diff --git a/ipykernel/kernelbase.py b/ipykernel/kernelbase.py -index a7869f4..07546e6 100644 ---- a/ipykernel/kernelbase.py -+++ b/ipykernel/kernelbase.py -@@ -206,20 +206,28 @@ def dispatch_shell(self, stream, msg): - if handler is None: - self.log.error("UNKNOWN MESSAGE TYPE: %r", msg_type) - else: -- # ensure default_int_handler during handler call -- sig = signal(SIGINT, default_int_handler) - self.log.debug("%s: %s", msg_type, msg) -+ self.pre_handler_hook() - try: - handler(stream, idents, msg) - except Exception: - self.log.error("Exception in message handler:", exc_info=True) - finally: -- signal(SIGINT, sig) -+ self.post_handler_hook() - - sys.stdout.flush() - sys.stderr.flush() - self._publish_status(u'idle') - -+ def pre_handler_hook(self): -+ """Hook to execute before calling message handler""" -+ # ensure default_int_handler during handler call -+ self.saved_sigint_handler = signal(SIGINT, default_int_handler) -+ -+ def post_handler_hook(self): -+ """Hook to execute after calling message handler""" -+ signal(SIGINT, self.saved_sigint_handler) -+ - def enter_eventloop(self): - """enter eventloop""" - self.log.info("entering eventloop %s", self.eventloop) diff --git a/build/pkgs/matplotlib/checksums.ini b/build/pkgs/matplotlib/checksums.ini index a46d6cedbd0..a95aa48a671 100644 --- a/build/pkgs/matplotlib/checksums.ini +++ b/build/pkgs/matplotlib/checksums.ini @@ -1,4 +1,4 @@ tarball=matplotlib-VERSION.tar.bz2 -sha1=09e2defc435f78b21e987bfe12cf458091d14880 -md5=fb66ed0a8b3494e0d9666eec04b6edc4 -cksum=3473042829 +sha1=bb9769b4433bd8b6625ef9050e697a3c27a0f0af +md5=74a96a13fa77ec44fd6a2fd57302693a +cksum=2922132423 diff --git a/build/pkgs/matplotlib/dependencies b/build/pkgs/matplotlib/dependencies index 158406ed84b..2c3be2ce1a1 100644 --- a/build/pkgs/matplotlib/dependencies +++ b/build/pkgs/matplotlib/dependencies @@ -1,4 +1,4 @@ -$(INST)/$(PYTHON) $(INST)/$(NUMPY) $(INST)/$(FREETYPE) $(INST)/$(LIBPNG) $(INST)/$(DATEUTIL) $(INST)/$(PYPARSING) $(INST)/$(SETUPTOOLS) $(INST)/$(TORNADO) $(INST)/$(SIX) +$(INST)/$(PYTHON) $(INST)/$(NUMPY) $(INST)/$(FREETYPE) $(INST)/$(LIBPNG) $(INST)/$(DATEUTIL) $(INST)/$(PYPARSING) $(INST)/$(SETUPTOOLS) $(INST)/$(TORNADO) $(INST)/$(SIX) $(INST)/$(CYCLER) ---------- All lines of this file are ignored except the first. diff --git a/build/pkgs/matplotlib/package-version.txt b/build/pkgs/matplotlib/package-version.txt index 428b770e3e2..bc80560fad6 100644 --- a/build/pkgs/matplotlib/package-version.txt +++ b/build/pkgs/matplotlib/package-version.txt @@ -1 +1 @@ -1.4.3 +1.5.0 diff --git a/build/pkgs/matplotlib/spkg-src b/build/pkgs/matplotlib/spkg-src index f2998bc20ba..c1b11dc682a 100755 --- a/build/pkgs/matplotlib/spkg-src +++ b/build/pkgs/matplotlib/spkg-src @@ -6,26 +6,24 @@ set -e [ -n "${SAGE_ROOT}" ] || SAGE_ROOT="$(readlink -f $(dirname ${0})/../../../)" -# determine the latest version and its download URL. -DOWNLOAD_URL=$(curl "https://pypi.python.org/pypi?:action=doap&name=matplotlib" \ - | grep download-page | sed 's/.*http/http/g' | sed s/.gz.*/.gz/g) -LATEST_VERSION=$(echo ${DOWNLOAD_URL} | sed 's/.*matplotlib-//g' | sed 's/.tar.gz//g') - +# Set the version and its download URL. +VERSION=1.5.0 +DOWNLOAD_URL="https://pypi.python.org/packages/source/m/matplotlib/matplotlib-${VERSION}.tar.gz" # fetch and unpack latest version tar xzf <( curl -L ${DOWNLOAD_URL} ) # remove test images -rm -rf matplotlib-${LATEST_VERSION}/lib/matplotlib/tests/baseline_images/* +rm -rf matplotlib-${VERSION}/lib/matplotlib/tests/baseline_images/* # repack and cleanup temporary directory -tar cjf "$SAGE_ROOT/upstream/matplotlib-${LATEST_VERSION}.tar.bz2" matplotlib-${LATEST_VERSION} -rm -rf matplotlib-${LATEST_VERSION} +tar cjf "$SAGE_ROOT/upstream/matplotlib-${VERSION}.tar.bz2" matplotlib-${VERSION} +rm -rf matplotlib-${VERSION} # update package info -echo "${LATEST_VERSION}" > "${SAGE_ROOT}/build/pkgs/matplotlib/package-version.txt" +echo "${VERSION}" > "${SAGE_ROOT}/build/pkgs/matplotlib/package-version.txt" "$SAGE_ROOT"/sage -sh 'sage-fix-pkg-checksums' diff --git a/build/pkgs/mpir/checksums.ini b/build/pkgs/mpir/checksums.ini index 081ace81898..c01defa75d2 100644 --- a/build/pkgs/mpir/checksums.ini +++ b/build/pkgs/mpir/checksums.ini @@ -1,4 +1,4 @@ tarball=mpir-VERSION.tar.bz2 -sha1=860f8de360feaca700b8fe5c0df8471709ddf4a3 -md5=4aec04108dd24c49d45beb959d837b40 -cksum=2007318477 +sha1=a285352d4299eb18d4f02a97e3232efab225e174 +md5=b31aa1ebc01b5fedf4ac43277c03feec +cksum=3412099598 diff --git a/build/pkgs/mpir/package-version.txt b/build/pkgs/mpir/package-version.txt index 9c8d6791e82..37c2961c243 100644 --- a/build/pkgs/mpir/package-version.txt +++ b/build/pkgs/mpir/package-version.txt @@ -1 +1 @@ -2.7.0.p1 +2.7.2 diff --git a/build/pkgs/mpir/patches/fix-19280.patch b/build/pkgs/mpir/patches/fix-19280.patch deleted file mode 100644 index ced078c66ee..00000000000 --- a/build/pkgs/mpir/patches/fix-19280.patch +++ /dev/null @@ -1,22 +0,0 @@ -Apply the fix proposed in http://trac.sagemath.org/ticket/18546#comment:23 -to the bug reported in http://trac.sagemath.org/ticket/19280 . - -diff -ru mpir-2.7.0/gmp-impl.h mpir-2.7.0-fixed/gmp-impl.h -Index: gmp-impl.h -=================================================================== ---- mpir-2.7.0/gmp-impl.h 2015-06-10 23:02:35.000000000 +0200 -+++ mpir-2.7.0-fixed/gmp-impl.h 2015-09-29 17:04:17.746919331 +0200 -@@ -2040,11 +2040,11 @@ - #endif - - #ifndef SB_DIVAPPR_Q_SMALL_THRESHOLD --#define SB_DIVAPPR_Q_SMALL_THRESHOLD 11 -+#define SB_DIVAPPR_Q_SMALL_THRESHOLD 0 - #endif - - #ifndef SB_DIV_QR_SMALL_THRESHOLD --#define SB_DIV_QR_SMALL_THRESHOLD 11 -+#define SB_DIV_QR_SMALL_THRESHOLD 0 - #endif - - #ifndef DC_DIVAPPR_Q_THRESHOLD diff --git a/build/pkgs/mpir/patches/test-19280.patch b/build/pkgs/mpir/patches/test-19280.patch deleted file mode 100644 index cef193c8bbf..00000000000 --- a/build/pkgs/mpir/patches/test-19280.patch +++ /dev/null @@ -1,161 +0,0 @@ -Include a test for the bug reported in http://trac.sagemath.org/ticket/19280 . -diff -ruN mpir-2.7.0/tests/mpz/Makefile.am mpir-2.7.0-patched/tests/mpz/Makefile.am ---- mpir-2.7.0/tests/mpz/Makefile.am 2015-06-09 19:18:27.000000000 +0200 -+++ mpir-2.7.0-patched/tests/mpz/Makefile.am 2015-09-24 18:39:33.093974089 +0200 -@@ -26,7 +26,7 @@ - AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/tests - LDADD = $(top_builddir)/tests/libtests.la $(top_builddir)/libmpir.la - --check_PROGRAMS = bit convert dive dive_ui io logic reuse t-addsub t-aorsmul t-bin t-cdiv_ui t-cmp t-cmp_d t-cmp_si t-cong t-cong_2exp t-div_2exp t-divis t-divis_2exp t-export t-fac_ui t-fdiv t-fdiv_ui t-fib_ui t-fits t-gcd t-gcd_ui t-get_d t-get_d_2exp t-get_si t-get_sx t-get_ux t-hamdist t-import t-inp_str t-io_raw t-jac t-lcm t-likely_prime_p t-lucnum_ui t-mfac_uiui t-mul t-mul_i t-next_prime_candidate t-oddeven t-perfpow t-perfsqr t-popcount t-pow t-powm t-powm_ui t-pprime_p t-primorial_ui t-root t-scan t-set_d t-set_f t-set_si t-set_str t-set_sx t-set_ux t-sizeinbase t-sqrtrem t-tdiv t-tdiv_ui t-trial_division -+check_PROGRAMS = bit convert dive dive_ui io logic reuse t-addsub t-aorsmul t-bin t-cdiv_ui t-cmp t-cmp_d t-cmp_si t-cong t-cong_2exp t-div_2exp t-divis t-divis_2exp t-export t-fac_ui t-fdiv t-fdiv_ui t-fib_ui t-fits t-gcd t-gcd_ui t-get_d t-get_d_2exp t-get_si t-get_sx t-get_ux t-hamdist t-import t-inp_str t-io_raw t-jac t-lcm t-likely_prime_p t-lucnum_ui t-mfac_uiui t-mul t-mul_i t-next_prime_candidate t-oddeven t-perfpow t-perfsqr t-popcount t-pow t-powm t-powm_ui t-pprime_p t-primorial_ui t-root t-scan t-set_d t-set_f t-set_si t-set_str t-set_sx t-set_ux t-sizeinbase t-sqrtrem t-tdiv t-tdiv_ui t-trial_division t-19280 - - if ENABLE_STATIC - if ENABLE_SHARED -diff -ruN mpir-2.7.0/tests/mpz/Makefile.in mpir-2.7.0-patched/tests/mpz/Makefile.in ---- mpir-2.7.0/tests/mpz/Makefile.in 2015-06-16 12:40:00.000000000 +0200 -+++ mpir-2.7.0-patched/tests/mpz/Makefile.in 2015-09-24 18:42:37.485967609 +0200 -@@ -121,7 +121,7 @@ - t-set_si$(EXEEXT) t-set_str$(EXEEXT) t-set_sx$(EXEEXT) \ - t-set_ux$(EXEEXT) t-sizeinbase$(EXEEXT) t-sqrtrem$(EXEEXT) \ - t-tdiv$(EXEEXT) t-tdiv_ui$(EXEEXT) t-trial_division$(EXEEXT) \ -- $(am__EXEEXT_1) -+ t-19280$(EXEEXT) $(am__EXEEXT_1) - @ENABLE_SHARED_TRUE@@ENABLE_STATIC_TRUE@am__append_1 = st_hamdist st_popcount - subdir = tests/mpz - DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ -@@ -197,6 +197,11 @@ - st_popcount_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(st_popcount_LDFLAGS) $(LDFLAGS) -o $@ -+t_19280_SOURCES = t-19280.c -+t_19280_OBJECTS = t-19280.$(OBJEXT) -+t_19280_LDADD = $(LDADD) -+t_19280_DEPENDENCIES = $(top_builddir)/tests/libtests.la \ -+ $(top_builddir)/libmpir.la - t_addsub_SOURCES = t-addsub.c - t_addsub_OBJECTS = t-addsub.$(OBJEXT) - t_addsub_LDADD = $(LDADD) -@@ -526,21 +531,7 @@ - am__v_CCLD_0 = @echo " CCLD " $@; - am__v_CCLD_1 = - SOURCES = bit.c convert.c dive.c dive_ui.c io.c logic.c reuse.c \ -- $(st_hamdist_SOURCES) $(st_popcount_SOURCES) t-addsub.c \ -- t-aorsmul.c t-bin.c t-cdiv_ui.c t-cmp.c t-cmp_d.c t-cmp_si.c \ -- t-cong.c t-cong_2exp.c t-div_2exp.c t-divis.c t-divis_2exp.c \ -- t-export.c t-fac_ui.c t-fdiv.c t-fdiv_ui.c t-fib_ui.c t-fits.c \ -- t-gcd.c t-gcd_ui.c t-get_d.c t-get_d_2exp.c t-get_si.c \ -- t-get_sx.c t-get_ux.c t-hamdist.c t-import.c t-inp_str.c \ -- t-io_raw.c t-jac.c t-lcm.c t-likely_prime_p.c t-lucnum_ui.c \ -- t-mfac_uiui.c t-mul.c t-mul_i.c t-next_prime_candidate.c \ -- t-oddeven.c t-perfpow.c t-perfsqr.c t-popcount.c t-pow.c \ -- t-powm.c t-powm_ui.c t-pprime_p.c t-primorial_ui.c t-root.c \ -- t-scan.c t-set_d.c t-set_f.c t-set_si.c t-set_str.c t-set_sx.c \ -- t-set_ux.c t-sizeinbase.c t-sqrtrem.c t-tdiv.c t-tdiv_ui.c \ -- t-trial_division.c --DIST_SOURCES = bit.c convert.c dive.c dive_ui.c io.c logic.c reuse.c \ -- $(am__st_hamdist_SOURCES_DIST) $(am__st_popcount_SOURCES_DIST) \ -+ $(st_hamdist_SOURCES) $(st_popcount_SOURCES) t-19280.c \ - t-addsub.c t-aorsmul.c t-bin.c t-cdiv_ui.c t-cmp.c t-cmp_d.c \ - t-cmp_si.c t-cong.c t-cong_2exp.c t-div_2exp.c t-divis.c \ - t-divis_2exp.c t-export.c t-fac_ui.c t-fdiv.c t-fdiv_ui.c \ -@@ -554,6 +545,21 @@ - t-set_f.c t-set_si.c t-set_str.c t-set_sx.c t-set_ux.c \ - t-sizeinbase.c t-sqrtrem.c t-tdiv.c t-tdiv_ui.c \ - t-trial_division.c -+DIST_SOURCES = bit.c convert.c dive.c dive_ui.c io.c logic.c reuse.c \ -+ $(am__st_hamdist_SOURCES_DIST) $(am__st_popcount_SOURCES_DIST) \ -+ t-19280.c t-addsub.c t-aorsmul.c t-bin.c t-cdiv_ui.c t-cmp.c \ -+ t-cmp_d.c t-cmp_si.c t-cong.c t-cong_2exp.c t-div_2exp.c \ -+ t-divis.c t-divis_2exp.c t-export.c t-fac_ui.c t-fdiv.c \ -+ t-fdiv_ui.c t-fib_ui.c t-fits.c t-gcd.c t-gcd_ui.c t-get_d.c \ -+ t-get_d_2exp.c t-get_si.c t-get_sx.c t-get_ux.c t-hamdist.c \ -+ t-import.c t-inp_str.c t-io_raw.c t-jac.c t-lcm.c \ -+ t-likely_prime_p.c t-lucnum_ui.c t-mfac_uiui.c t-mul.c \ -+ t-mul_i.c t-next_prime_candidate.c t-oddeven.c t-perfpow.c \ -+ t-perfsqr.c t-popcount.c t-pow.c t-powm.c t-powm_ui.c \ -+ t-pprime_p.c t-primorial_ui.c t-root.c t-scan.c t-set_d.c \ -+ t-set_f.c t-set_si.c t-set_str.c t-set_sx.c t-set_ux.c \ -+ t-sizeinbase.c t-sqrtrem.c t-tdiv.c t-tdiv_ui.c \ -+ t-trial_division.c - am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ -@@ -1020,6 +1026,10 @@ - @rm -f st_popcount$(EXEEXT) - $(AM_V_CCLD)$(st_popcount_LINK) $(st_popcount_OBJECTS) $(st_popcount_LDADD) $(LIBS) - -+t-19280$(EXEEXT): $(t_19280_OBJECTS) $(t_19280_DEPENDENCIES) $(EXTRA_t_19280_DEPENDENCIES) -+ @rm -f t-19280$(EXEEXT) -+ $(AM_V_CCLD)$(LINK) $(t_19280_OBJECTS) $(t_19280_LDADD) $(LIBS) -+ - t-addsub$(EXEEXT): $(t_addsub_OBJECTS) $(t_addsub_DEPENDENCIES) $(EXTRA_t_addsub_DEPENDENCIES) - @rm -f t-addsub$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(t_addsub_OBJECTS) $(t_addsub_LDADD) $(LIBS) -@@ -1931,6 +1941,13 @@ - $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ - --log-file $$b.log --trs-file $$b.trs \ - $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ -+ "$$tst" $(AM_TESTS_FD_REDIRECT) -+t-19280.log: t-19280$(EXEEXT) -+ @p='t-19280$(EXEEXT)'; \ -+ b='t-19280'; \ -+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ -+ --log-file $$b.log --trs-file $$b.trs \ -+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ - "$$tst" $(AM_TESTS_FD_REDIRECT) - st_hamdist.log: st_hamdist$(EXEEXT) - @p='st_hamdist$(EXEEXT)'; \ -diff -ruN mpir-2.7.0/tests/mpz/t-19280.c mpir-2.7.0-patched/tests/mpz/t-19280.c ---- mpir-2.7.0/tests/mpz/t-19280.c 1970-01-01 01:00:00.000000000 +0100 -+++ mpir-2.7.0-patched/tests/mpz/t-19280.c 2015-09-24 18:57:03.005937190 +0200 -@@ -0,0 +1,50 @@ -+/* Test t-19280. -+ -+*/ -+ -+#include -+#include -+ -+#include "mpir.h" -+#include "gmp-impl.h" -+#include "tests.h" -+ -+#define printf gmp_printf -+ -+/* Check mpz_tdif_q gives a correct answer on 32-bit, -+ see http://trac.sagemath.org/ticket/19280. -+ This was wrong in sage 6.9.beta7. */ -+static void -+check_19280 (void) -+{ -+ -+ mpz_t one, x, w, correct; -+ mpz_init(one); -+ mpz_init(x); -+ mpz_init(w); -+ mpz_init(correct); -+ mpz_set_str(one, "62165404551223330269422781018352605012557018849668464680057997111644937126566671941632", 10); -+ mpz_set_str(x, "39623752663112484341451587580", 10); -+ mpz_set_str(correct, "1568892403497558507879962225846103176600476845510570267609", 10); -+ -+ mpz_tdiv_q(w, one, x); -+ if (mpz_cmp(w, correct)!=0) { -+ printf("mpz_tdiv_q returned %Zd instead of %Zd.\n", w, correct); -+ abort(); -+ } -+ mpz_clear(one); -+ mpz_clear(x); -+ mpz_clear(w); -+ mpz_clear(correct); -+} -+ -+int -+main (void) -+{ -+ tests_start (); -+ -+ check_19280 (); -+ -+ tests_end (); -+ exit (0); -+} diff --git a/build/pkgs/mpir/spkg-install b/build/pkgs/mpir/spkg-install index 8e8423b60dc..8711de2db6a 100755 --- a/build/pkgs/mpir/spkg-install +++ b/build/pkgs/mpir/spkg-install @@ -8,7 +8,6 @@ fi CUR=`pwd` -mv mpir-2.7.0 src cd src ############################################################################### @@ -30,10 +29,33 @@ done # before installing the new one. (Done below.) ############################################################################### +############################################################################### +# Find out the machine type +############################################################################### + +MACHINE_TYPE_MPIR=$(bash ./config.guess) +if [ $? -ne 0 ]; then + echo >&2 "Error: failed to determine the machine type (mpir-extended)" + exit 1 +fi + +# This is the vanilla config.guess (renamed to configfsf.guess in +# MPIR) file instead of MPIR's version. It is used when +# SAGE_FAT_BINARY is set. +MACHINE_TYPE_DEFAULT=$(bash ./configfsf.guess) +if [ $? -ne 0 ]; then + echo >&2 "Error: failed to determine the machine type (default)" + exit 1 +fi + +echo "Machine type (default): $MACHINE_TYPE_DEFAULT" +echo "Machine type (mpir): $MACHINE_TYPE_MPIR" + ############################################################################### # Set up environment variables: ############################################################################### + # The Yasm build uses PYTHON from the environment to find the Python interpreter, # so unset it in case it apparently contains nothing useful (like it did in Sage # versions prior to 5.0.beta10; cf. #10492), to not break Yasm's 'configure': @@ -218,9 +240,8 @@ fi # If SAGE_FAT_BINARY is enabled, then add --enable-fat to configure # options on Linux x86 systems. On other systems, fat binaries are not -# supported. Then we specify a build architecture which doesn't -# have a CPU name in it. This means which use the vanilla config.guess -# (renamed to configfsf.guess in MPIR) file instead of MPIR's version. +# supported. There, we specify a build architecture which doesn't +# have a CPU name in it. if [ "$SAGE_FAT_BINARY" = "yes" ]; then case "$UNAME-`uname -m`" in Linux-i[3456]86) @@ -233,7 +254,7 @@ if [ "$SAGE_FAT_BINARY" = "yes" ]; then ;; *) # Anything else echo "** Building a generic binary (not assuming any specific CPU) **" - MPIR_CONFIGURE="--build=`./configfsf.guess` $MPIR_CONFIGURE" + MPIR_CONFIGURE="--build=$MACHINE_TYPE_DEFAULT $MPIR_CONFIGURE" ;; esac fi diff --git a/build/pkgs/notebook/package-version.txt b/build/pkgs/notebook/package-version.txt index 61d8a2af785..f0cd2d909bb 100644 --- a/build/pkgs/notebook/package-version.txt +++ b/build/pkgs/notebook/package-version.txt @@ -1 +1 @@ -4.0.4.p1 +4.0.4.p2 diff --git a/build/pkgs/notebook/patches/jupyter_notebook_config.py b/build/pkgs/notebook/patches/jupyter_notebook_config.py index 3bf63a1649a..99c7801b76c 100644 --- a/build/pkgs/notebook/patches/jupyter_notebook_config.py +++ b/build/pkgs/notebook/patches/jupyter_notebook_config.py @@ -4,4 +4,4 @@ # needs to have the mathjax_url set to wherever your distribution # installs mathjax. -c.NotebookApp.mathjax_url = '../nbextensions/mathjax/MathJax.js' +c.NotebookApp.mathjax_url = 'nbextensions/mathjax/MathJax.js' diff --git a/build/pkgs/notebook/patches/mathjax.patch b/build/pkgs/notebook/patches/mathjax.patch new file mode 100644 index 00000000000..1237afef049 --- /dev/null +++ b/build/pkgs/notebook/patches/mathjax.patch @@ -0,0 +1,73 @@ +commit 17b364389182e667d64db93db2dcecc84dada8f9 +Author: Jeroen Demeyer +Date: Mon Oct 26 18:29:42 2015 +0100 + + Interpret mathjax_url relative to base_url + +diff --git a/notebook/base/handlers.py b/notebook/base/handlers.py +index 30b1223..127a6ba 100644 +--- a/notebook/base/handlers.py ++++ b/notebook/base/handlers.py +@@ -32,7 +32,7 @@ from ipython_genutils.path import filefind + from ipython_genutils.py3compat import string_types + + import notebook +-from notebook.utils import is_hidden, url_path_join, url_escape ++from notebook.utils import is_hidden, url_path_join, url_is_absolute, url_escape + from notebook.services.security import csp_report_uri + + #----------------------------------------------------------------------------- +@@ -155,7 +155,10 @@ class IPythonHandler(AuthenticatedHandler): + + @property + def mathjax_url(self): +- return self.settings.get('mathjax_url', '') ++ url = self.settings.get('mathjax_url', '') ++ if not url or url_is_absolute(url): ++ return url ++ return url_path_join(self.base_url, url) + + @property + def base_url(self): +diff --git a/notebook/notebookapp.py b/notebook/notebookapp.py +index bfbe467..c74e4eb 100644 +--- a/notebook/notebookapp.py ++++ b/notebook/notebookapp.py +@@ -658,9 +658,7 @@ class NotebookApp(JupyterApp): + def _mathjax_url_default(self): + if not self.enable_mathjax: + return u'' +- static_url_prefix = self.tornado_settings.get("static_url_prefix", +- url_path_join(self.base_url, "static") +- ) ++ static_url_prefix = self.tornado_settings.get("static_url_prefix", "static") + return url_path_join(static_url_prefix, 'components', 'MathJax', 'MathJax.js') + + def _mathjax_url_changed(self, name, old, new): +diff --git a/notebook/utils.py b/notebook/utils.py +index 9ba424c..ee9c6ac 100644 +--- a/notebook/utils.py ++++ b/notebook/utils.py +@@ -13,9 +13,10 @@ import sys + from distutils.version import LooseVersion + + try: +- from urllib.parse import quote, unquote ++ from urllib.parse import quote, unquote, urlparse + except ImportError: + from urllib import quote, unquote ++ from urlparse import urlparse + + from ipython_genutils import py3compat + +@@ -39,6 +40,10 @@ def url_path_join(*pieces): + if result == '//': result = '/' + return result + ++def url_is_absolute(url): ++ """Determine whether a given URL is absolute""" ++ return urlparse(url).path.startswith("/") ++ + def path2url(path): + """Convert a local file path to a URL""" + pieces = [ quote(p) for p in path.split(os.sep) ] diff --git a/build/pkgs/notebook/spkg-install b/build/pkgs/notebook/spkg-install index 10759a4d973..a42c3ed659d 100755 --- a/build/pkgs/notebook/spkg-install +++ b/build/pkgs/notebook/spkg-install @@ -1,6 +1,18 @@ #!/usr/bin/env bash -cd src && python setup.py install +cd src + +for patch in ../patches/*.patch; do + [ -r "$patch" ] || continue # Skip non-existing or non-readable patches + patch -p1 <"$patch" + if [ $? -ne 0 ]; then + echo >&2 "Error applying '$patch'" + exit 1 + fi +done + + +python setup.py install # Install the Jupyter notebook configuration ETC_JUPYTER="$SAGE_ETC"/jupyter diff --git a/build/pkgs/numpy/checksums.ini b/build/pkgs/numpy/checksums.ini index 58f0c00cfc5..4f7ed88365b 100644 --- a/build/pkgs/numpy/checksums.ini +++ b/build/pkgs/numpy/checksums.ini @@ -1,4 +1,4 @@ tarball=numpy-VERSION.tar.gz -sha1=8fe1d5f36bab3f1669520b4c7d8ab59a21a984da -md5=be95babe263bfa3428363d6db5b64678 -cksum=2639977194 +sha1=589dac943b51edaffc7d09c80eab92d5f52ab3cd +md5=3fed2b50906bc19018cec5fa26168aa5 +cksum=3353851441 diff --git a/build/pkgs/numpy/package-version.txt b/build/pkgs/numpy/package-version.txt index bce2105d83f..4dae2985b58 100644 --- a/build/pkgs/numpy/package-version.txt +++ b/build/pkgs/numpy/package-version.txt @@ -1 +1 @@ -1.8.1.p0 +1.10.1 diff --git a/build/pkgs/numpy/patches/numpy-1.10.1-asarray_conversion.patch b/build/pkgs/numpy/patches/numpy-1.10.1-asarray_conversion.patch new file mode 100644 index 00000000000..7a65280efe7 --- /dev/null +++ b/build/pkgs/numpy/patches/numpy-1.10.1-asarray_conversion.patch @@ -0,0 +1,23 @@ +diff -Naur numpy-1.10.1.orig/numpy/core/function_base.py numpy-1.10.1/numpy/core/function_base.py +--- numpy-1.10.1.orig/numpy/core/function_base.py 2015-11-11 10:12:45.583322683 +1300 ++++ numpy-1.10.1/numpy/core/function_base.py 2015-11-11 10:14:05.813343880 +1300 +@@ -3,7 +3,7 @@ + __all__ = ['logspace', 'linspace'] + + from . import numeric as _nx +-from .numeric import result_type, NaN ++from .numeric import result_type, NaN, asanyarray + + + def linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None): +@@ -87,8 +87,8 @@ + div = (num - 1) if endpoint else num + + # Convert float/complex array scalars to float, gh-3504 +- start = start * 1. +- stop = stop * 1. ++ start = asanyarray(start) * 1. ++ stop = asanyarray(stop) * 1. + + dt = result_type(start, stop, float(num)) + if dtype is None: diff --git a/build/pkgs/numpy/patches/numpy-1.10.1-backport-1.patch b/build/pkgs/numpy/patches/numpy-1.10.1-backport-1.patch new file mode 100644 index 00000000000..77a3c010371 --- /dev/null +++ b/build/pkgs/numpy/patches/numpy-1.10.1-backport-1.patch @@ -0,0 +1,127 @@ +From 3a816a4db9b498eb64eb837fdcca0fa8ddbe063e Mon Sep 17 00:00:00 2001 +From: Allan Haldane +Date: Sat, 17 Oct 2015 14:00:36 -0400 +Subject: [PATCH] BUG: recarrays viewed as subarrays don't convert to np.record + type + +Record array views were updated in #5943 to return np.record dtype +where possible, but forgot about the case of sub-arrays. + +That's fixed here, so accessing subarray fields by attribute or index +works sensibly, as well as viewing a record array as a subarray dtype, +and printing subarrays. + +This also happens to fix #6459, since it affects the same lines. + +Fixes #6497 #6459 +--- + numpy/core/records.py | 30 +++++++++++++++++++----------- + numpy/core/tests/test_records.py | 23 +++++++++++++++++++++++ + 2 files changed, 42 insertions(+), 11 deletions(-) + +diff --git a/numpy/core/records.py b/numpy/core/records.py +index 4a99553..4ce3fe9 100644 +--- a/numpy/core/records.py ++++ b/numpy/core/records.py +@@ -448,12 +448,14 @@ def __getattribute__(self, attr): + + # At this point obj will always be a recarray, since (see + # PyArray_GetField) the type of obj is inherited. Next, if obj.dtype is +- # non-structured, convert it to an ndarray. If obj is structured leave +- # it as a recarray, but make sure to convert to the same dtype.type (eg +- # to preserve numpy.record type if present), since nested structured +- # fields do not inherit type. ++ # non-structured, convert it to an ndarray. Then if obj is structured ++ # with void type convert it to the same dtype.type (eg to preserve ++ # numpy.record type if present), since nested structured fields do not ++ # inherit type. Don't do this for non-void structures though. + if obj.dtype.fields: +- return obj.view(dtype=(self.dtype.type, obj.dtype.fields)) ++ if issubclass(obj.dtype.type, nt.void): ++ return obj.view(dtype=(self.dtype.type, obj.dtype)) ++ return obj + else: + return obj.view(ndarray) + +@@ -463,8 +465,9 @@ def __getattribute__(self, attr): + # Thus, you can't create attributes on-the-fly that are field names. + def __setattr__(self, attr, val): + +- # Automatically convert (void) dtypes to records. +- if attr == 'dtype' and issubclass(val.type, nt.void): ++ # Automatically convert (void) structured types to records ++ # (but not non-void structures, subarrays, or non-structured voids) ++ if attr == 'dtype' and issubclass(val.type, nt.void) and val.fields: + val = sb.dtype((record, val)) + + newattr = attr not in self.__dict__ +@@ -499,7 +502,9 @@ def __getitem__(self, indx): + # we might also be returning a single element + if isinstance(obj, ndarray): + if obj.dtype.fields: +- return obj.view(dtype=(self.dtype.type, obj.dtype.fields)) ++ if issubclass(obj.dtype.type, nt.void): ++ return obj.view(dtype=(self.dtype.type, obj.dtype)) ++ return obj + else: + return obj.view(type=ndarray) + else: +@@ -519,11 +524,14 @@ def __repr__(self): + # If this is a full record array (has numpy.record dtype), + # or if it has a scalar (non-void) dtype with no records, + # represent it using the rec.array function. Since rec.array +- # converts dtype to a numpy.record for us, use only dtype.descr, +- # not repr(dtype). ++ # converts dtype to a numpy.record for us, convert back ++ # to non-record before printing ++ plain_dtype = self.dtype ++ if plain_dtype.type is record: ++ plain_dtype = sb.dtype((nt.void, plain_dtype)) + lf = '\n'+' '*len("rec.array(") + return ('rec.array(%s, %sdtype=%s)' % +- (lst, lf, repr(self.dtype.descr))) ++ (lst, lf, plain_dtype)) + else: + # otherwise represent it using np.array plus a view + # This should only happen if the user is playing +diff --git a/numpy/core/tests/test_records.py b/numpy/core/tests/test_records.py +index 7a18f29..290bc4f 100644 +--- a/numpy/core/tests/test_records.py ++++ b/numpy/core/tests/test_records.py +@@ -121,6 +121,23 @@ def test_recarray_views(self): + assert_equal(type(rv), np.recarray) + assert_equal(rv.dtype.type, np.record) + ++ # check that accessing nested structures keep record type, but ++ # not for subarrays, non-void structures, non-structured voids ++ test_dtype = [('a', 'f4,f4'), ('b', 'V8'), ('c', ('f4',2)), ++ ('d', ('i8', 'i4,i4'))] ++ r = np.rec.array([((1,1), b'11111111', [1,1], 1), ++ ((1,1), b'11111111', [1,1], 1)], dtype=test_dtype) ++ assert_equal(r.a.dtype.type, np.record) ++ assert_equal(r.b.dtype.type, np.void) ++ assert_equal(r.c.dtype.type, np.float32) ++ assert_equal(r.d.dtype.type, np.int64) ++ # check the same, but for views ++ r = np.rec.array(np.ones(4, dtype='i4,i4')) ++ assert_equal(r.view('f4,f4').dtype.type, np.record) ++ assert_equal(r.view(('i4',2)).dtype.type, np.int32) ++ assert_equal(r.view('V8').dtype.type, np.void) ++ assert_equal(r.view(('i8', 'i4,i4')).dtype.type, np.int64) ++ + #check that we can undo the view + arrs = [np.ones(4, dtype='f4,i4'), np.ones(4, dtype='f8')] + for arr in arrs: +@@ -135,6 +152,12 @@ def test_recarray_repr(self): + a = np.array(np.ones(4, dtype='f8')) + assert_(repr(np.rec.array(a)).startswith('rec.array')) + ++ # check that the 'np.record' part of the dtype isn't shown ++ a = np.rec.array(np.ones(3, dtype='i4,i4')) ++ assert_equal(repr(a).find('numpy.record'), -1) ++ a = np.rec.array(np.ones(3, dtype='i4')) ++ assert_(repr(a).find('dtype=int32') != -1) ++ + def test_recarray_from_names(self): + ra = np.rec.array([ + (1, 'abc', 3.7000002861022949, 0), diff --git a/build/pkgs/numpy/patches/numpy-1.10.1-backport-2.patch b/build/pkgs/numpy/patches/numpy-1.10.1-backport-2.patch new file mode 100644 index 00000000000..9c33704f8e2 --- /dev/null +++ b/build/pkgs/numpy/patches/numpy-1.10.1-backport-2.patch @@ -0,0 +1,73 @@ +From 0d25dc4175e00cdaf9545e8b1b1a5b879cf67248 Mon Sep 17 00:00:00 2001 +From: Ethan Kruse +Date: Mon, 19 Oct 2015 13:29:01 -0700 +Subject: [PATCH 1/2] Potential fix for #6462 + +--- + numpy/lib/function_base.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py +index 555d083..fef69df 100644 +--- a/numpy/lib/function_base.py ++++ b/numpy/lib/function_base.py +@@ -3339,7 +3339,7 @@ def _median(a, axis=None, out=None, overwrite_input=False): + indexer[axis] = slice(index-1, index+1) + + # Check if the array contains any nan's +- if np.issubdtype(a.dtype, np.inexact): ++ if np.issubdtype(a.dtype, np.inexact) and sz > 0: + # warn and return nans like mean would + rout = mean(part[indexer], axis=axis, out=out) + part = np.rollaxis(part, axis, part.ndim) + +From 59d859fb2160950ac93267d7461ad952145c8724 Mon Sep 17 00:00:00 2001 +From: Ethan Kruse +Date: Tue, 20 Oct 2015 11:40:49 -0700 +Subject: [PATCH 2/2] Added tests for median of empty arrays + +--- + numpy/lib/tests/test_function_base.py | 30 ++++++++++++++++++++++++++++++ + 1 file changed, 30 insertions(+) + +diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py +index 4516c92..aa41c1f 100644 +--- a/numpy/lib/tests/test_function_base.py ++++ b/numpy/lib/tests/test_function_base.py +@@ -2597,6 +2597,36 @@ def test_nan_behavior(self): + assert_equal(np.median(a, (0, 2)), b) + assert_equal(len(w), 1) + ++ def test_empty(self): ++ # empty arrays ++ a = np.array([], dtype=float) ++ with warnings.catch_warnings(record=True) as w: ++ warnings.filterwarnings('always', '', RuntimeWarning) ++ assert_equal(np.median(a), np.nan) ++ assert_(w[0].category is RuntimeWarning) ++ ++ # multiple dimensions ++ a = np.array([], dtype=float, ndmin=3) ++ # no axis ++ with warnings.catch_warnings(record=True) as w: ++ warnings.filterwarnings('always', '', RuntimeWarning) ++ assert_equal(np.median(a), np.nan) ++ assert_(w[0].category is RuntimeWarning) ++ ++ # axis 0 and 1 ++ b = np.array([], dtype=float, ndmin=2) ++ with warnings.catch_warnings(record=True) as w: ++ warnings.filterwarnings('always', '', RuntimeWarning) ++ assert_equal(np.median(a, axis=0), b) ++ assert_equal(np.median(a, axis=1), b) ++ ++ # axis 2 ++ b = np.array(np.nan, dtype=float, ndmin=2) ++ with warnings.catch_warnings(record=True) as w: ++ warnings.filterwarnings('always', '', RuntimeWarning) ++ assert_equal(np.median(a, axis=2), b) ++ assert_(w[0].category is RuntimeWarning) ++ + def test_object(self): + o = np.arange(7.) + assert_(type(np.median(o.astype(object))), float) diff --git a/build/pkgs/numpy/patches/numpy-1.10.1-revert-mingwinpy.patch b/build/pkgs/numpy/patches/numpy-1.10.1-revert-mingwinpy.patch new file mode 100644 index 00000000000..9d3256e7a99 --- /dev/null +++ b/build/pkgs/numpy/patches/numpy-1.10.1-revert-mingwinpy.patch @@ -0,0 +1,305 @@ +Francois Bissey: this causes build failures on arm + +From a08437e12d6b6796f4b0beda49bce9adc37db63d Mon Sep 17 00:00:00 2001 +From: Charles Harris +Date: Tue, 20 Oct 2015 08:59:26 -0600 +Subject: [PATCH] Revert "Merge pull request #5614 from + charris/cleanup-gh-5587" + +Revert mingwpy modifications to distutils. They are causing problems +for non-windows builds and it is better to wait until mingypy is +further along. + +This reverts commit 96abd32de241864ee97f30357234cbc9a96c43ae, reversing +changes made to 06af9918f6bf03b8d818ec834f9fb48db57d1489. +--- + INSTALL.txt | 32 ------------- + numpy/core/src/multiarray/multiarraymodule.c | 9 ++++ + numpy/distutils/fcompiler/gnu.py | 32 +++++-------- + numpy/distutils/mingw32ccompiler.py | 67 +++++++++------------------- + numpy/distutils/system_info.py | 18 -------- + numpy/lib/tests/test_function_base.py | 2 +- + setup.py | 1 - + 7 files changed, 42 insertions(+), 119 deletions(-) + +diff --git a/INSTALL.txt b/INSTALL.txt +index 12fb47d..6339cbb 100644 +--- a/INSTALL.txt ++++ b/INSTALL.txt +@@ -152,38 +152,6 @@ is broken). gcc 4.4 will hopefully be able to run natively. + This is the only tested way to get a numpy with a FULL blas/lapack (scipy + does not work because of C++). + +-Carl Kleffner's mingw-w64 toolchain +-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +- +-Carl Kleffner has been working on mingw-w64 / OpenBLAS support and has put +-together toolchains for that option. The toolchains are available at +-https://bitbucket.org/carlkl/mingw-w64-for-python/downloads. The site.cfg +-should be configured like so: +- +- [openblas] +- libraries = openblaspy +- library_dirs = /lib +- include_dirs = /include +- +-The libopenblaspy.dll from /bin must be copied to numpy/core +-before the build. For this mingw-w64 toolchain manual creation of the python +-import libs is necessary, i.e.: +- +- gendef python2.7.dll +- dlltool -D python27.dll -d python27.def -l libpython27.dll.a +- move libpython27.dll.a libs\libpython27.dll.a +- +-For python-2.6 up to python 3.2 use +-https://bitbucket.org/carlkl/mingw-w64-for-python/downloads/mingwpy_win32_vc90.tar.xz +-or +-https://bitbucket.org/carlkl/mingw-w64-for-python/downloads/mingwpy_amd64_vc90.tar.xz +- +-For python-3.3 and python-3.4 use +-https://bitbucket.org/carlkl/mingw-w64-for-python/downloads/mingwpy_win32_vc100.tar.xz +-or +-https://bitbucket.org/carlkl/mingw-w64-for-python/downloads/mingwpy_amd64_vc100.tar.xz +- +- + MS compilers + ------------ + +diff --git a/numpy/core/src/multiarray/multiarraymodule.c b/numpy/core/src/multiarray/multiarraymodule.c +index 2c694f9..10c22ae 100644 +--- a/numpy/core/src/multiarray/multiarraymodule.c ++++ b/numpy/core/src/multiarray/multiarraymodule.c +@@ -4524,6 +4524,15 @@ PyMODINIT_FUNC initmultiarray(void) { + goto err; + } + ++#if defined(MS_WIN64) && defined(__GNUC__) ++ PyErr_WarnEx(PyExc_Warning, ++ "Numpy built with MINGW-W64 on Windows 64 bits is experimental, " \ ++ "and only available for \n" \ ++ "testing. You are advised not to use it for production. \n\n" \ ++ "CRASHES ARE TO BE EXPECTED - PLEASE REPORT THEM TO NUMPY DEVELOPERS", ++ 1); ++#endif ++ + /* Initialize access to the PyDateTime API */ + numpy_pydatetime_import(); + +diff --git a/numpy/distutils/fcompiler/gnu.py b/numpy/distutils/fcompiler/gnu.py +index a7fd3a7..37be080 100644 +--- a/numpy/distutils/fcompiler/gnu.py ++++ b/numpy/distutils/fcompiler/gnu.py +@@ -20,8 +20,6 @@ + # XXX: handle cross compilation + def is_win64(): + return sys.platform == "win32" and platform.architecture()[0] == "64bit" +-def is_win32(): +- return sys.platform == "win32" and platform.architecture()[0] == "32bit" + + if is_win64(): + #_EXTRAFLAGS = ["-fno-leading-underscore"] +@@ -138,7 +136,7 @@ def get_flags_linker_so(self): + + opt.extend(['-undefined', 'dynamic_lookup', '-bundle']) + else: +- opt.append("-shared -Wl,-gc-sections -Wl,-s") ++ opt.append("-shared") + if sys.platform.startswith('sunos'): + # SunOS often has dynamically loaded symbols defined in the + # static library libg2c.a The linker doesn't like this. To +@@ -210,18 +208,9 @@ def get_flags_opt(self): + # With this compiler version building Fortran BLAS/LAPACK + # with -O3 caused failures in lib.lapack heevr,syevr tests. + opt = ['-O2'] +- elif v and v >= '4.6.0': +- if is_win32(): +- # use -mincoming-stack-boundary=2 +- # due to the change to 16 byte stack alignment since GCC 4.6 +- # but 32 bit Windows ABI defines 4 bytes stack alignment +- opt = ['-O2 -march=core2 -mtune=generic -mfpmath=sse -msse2 ' +- '-mincoming-stack-boundary=2'] +- else: +- opt = ['-O2 -march=x86-64 -DMS_WIN64 -mtune=generic -msse2'] + else: +- opt = ['-O2'] +- ++ opt = ['-O3'] ++ opt.append('-funroll-loops') + return opt + + def _c_arch_flags(self): +@@ -361,7 +350,10 @@ def get_target(self): + return "" + + def get_flags_opt(self): +- return GnuFCompiler.get_flags_opt(self) ++ if is_win64(): ++ return ['-O0'] ++ else: ++ return GnuFCompiler.get_flags_opt(self) + + def _can_target(cmd, arch): + """Return true if the architecture supports the -arch flag""" +@@ -386,13 +378,9 @@ def _can_target(cmd, arch): + from distutils import log + log.set_verbosity(2) + +- try: +- compiler = GnuFCompiler() +- compiler.customize() +- print(compiler.get_version()) +- except Exception: +- msg = get_exception() +- print(msg) ++ compiler = GnuFCompiler() ++ compiler.customize() ++ print(compiler.get_version()) + + try: + compiler = Gnu95FCompiler() +diff --git a/numpy/distutils/mingw32ccompiler.py b/numpy/distutils/mingw32ccompiler.py +index f72c3bb..d22a281 100644 +--- a/numpy/distutils/mingw32ccompiler.py ++++ b/numpy/distutils/mingw32ccompiler.py +@@ -87,30 +87,17 @@ def __init__ (self, + elif self.linker_dll == 'gcc': + self.linker = 'g++' + +- p = subprocess.Popen(['gcc', '--version'], shell=True, +- stdout=subprocess.PIPE) +- out_string = p.stdout.read() +- p.stdout.close() +- +- # Before build with MinGW-W64 generate the python import library +- # with gendef and dlltool according to the MingW-W64 FAQ. +- # Use the MinGW-W64 provided msvc runtime import libraries. +- # Don't call build_import_library() and build_msvcr_library. +- +- if 'MinGW-W64' not in str(out_string): +- +- # **changes: eric jones 4/11/01 +- # 1. Check for import library on Windows. Build if it doesn't +- # exist. +- build_import_library() +- +- # Check for custom msvc runtime library on Windows. Build if it +- # doesn't exist. +- msvcr_success = build_msvcr_library() +- msvcr_dbg_success = build_msvcr_library(debug=True) +- if msvcr_success or msvcr_dbg_success: +- # add preprocessor statement for using customized msvcr lib +- self.define_macro('NPY_MINGW_USE_CUSTOM_MSVCR') ++ # **changes: eric jones 4/11/01 ++ # 1. Check for import library on Windows. Build if it doesn't exist. ++ ++ build_import_library() ++ ++ # Check for custom msvc runtime library on Windows. Build if it doesn't exist. ++ msvcr_success = build_msvcr_library() ++ msvcr_dbg_success = build_msvcr_library(debug=True) ++ if msvcr_success or msvcr_dbg_success: ++ # add preprocessor statement for using customized msvcr lib ++ self.define_macro('NPY_MINGW_USE_CUSTOM_MSVCR') + + # Define the MSVC version as hint for MinGW + msvcr_version = '0x%03i0' % int(msvc_runtime_library().lstrip('msvcr')) +@@ -131,12 +118,10 @@ def __init__ (self, + else: + # gcc-4 series releases do not support -mno-cygwin option + self.set_executables( +- compiler='gcc -march=x86-64 -mtune=generic -DMS_WIN64' +- ' -O2 -msse2 -Wall', +- compiler_so='gcc -march=x86-64 -mtune=generic -DMS_WIN64' +- ' -O2 -msse2 -Wall -Wstrict-prototypes', +- linker_exe='gcc', +- linker_so='gcc -shared -Wl,-gc-sections -Wl,-s') ++ compiler='gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall', ++ compiler_so='gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes', ++ linker_exe='gcc -g', ++ linker_so='gcc -g -shared') + else: + if self.gcc_version <= "3.0.0": + self.set_executables( +@@ -154,21 +139,13 @@ def __init__ (self, + linker_exe='g++ -mno-cygwin', + linker_so='g++ -mno-cygwin -shared') + else: +- # gcc-4 series releases do not support -mno-cygwin option i686 +- # build needs '-mincoming-stack-boundary=2' due to ABI +- # incompatibility to Win32 ABI +- self.set_executables( +- compiler='gcc -O2 -march=core2 -mtune=generic' +- ' -mfpmath=sse -msse2' +- ' -mincoming-stack-boundary=2 -Wall', +- compiler_so='gcc -O2 -march=core2 -mtune=generic' +- ' -mfpmath=sse -msse2' +- ' -mincoming-stack-boundary=2 -Wall' +- ' -Wstrict-prototypes', +- linker_exe='g++ ', +- linker_so='g++ -shared -Wl,-gc-sections -Wl,-s') +- # added for python2.3 support we can't pass it through set_executables +- # because pre 2.2 would fail ++ # gcc-4 series releases do not support -mno-cygwin option ++ self.set_executables(compiler='gcc -O2 -Wall', ++ compiler_so='gcc -O2 -Wall -Wstrict-prototypes', ++ linker_exe='g++ ', ++ linker_so='g++ -shared') ++ # added for python2.3 support ++ # we can't pass it through set_executables because pre 2.2 would fail + self.compiler_cxx = ['g++'] + + # Maybe we should also append -mthreads, but then the finished dlls +diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py +index 9dd48e2..0da13a7 100644 +--- a/numpy/distutils/system_info.py ++++ b/numpy/distutils/system_info.py +@@ -1751,24 +1751,6 @@ def check_embedded_lapack(self, info): + res = False + finally: + shutil.rmtree(tmpdir) +- if sys.platform == 'win32' and not res: +- c = distutils.ccompiler.new_compiler(compiler='mingw32') +- tmpdir = tempfile.mkdtemp() +- src = os.path.join(tmpdir, 'source.c') +- out = os.path.join(tmpdir, 'a.out') +- try: +- with open(src, 'wt') as f: +- f.write(s) +- obj = c.compile([src], output_dir=tmpdir) +- try: +- c.link_executable(obj, out, libraries=info['libraries'], +- library_dirs=info['library_dirs'], +- extra_postargs=extra_args) +- res = True +- except distutils.ccompiler.LinkError: +- res = False +- finally: +- shutil.rmtree(tmpdir) + return res + + +diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py +index 4516c92..3a4ffd7 100644 +--- a/numpy/lib/tests/test_function_base.py ++++ b/numpy/lib/tests/test_function_base.py +@@ -732,7 +732,7 @@ def test_ufunc(self): + args = np.array([0, 0.5 * np.pi, np.pi, 1.5 * np.pi, 2 * np.pi]) + r1 = f(args) + r2 = np.cos(args) +- assert_array_almost_equal(r1, r2) ++ assert_array_equal(r1, r2) + + def test_keywords(self): + +diff --git a/setup.py b/setup.py +index 8e5c3d0..8f4a989 100755 +--- a/setup.py ++++ b/setup.py +@@ -221,7 +221,6 @@ def setup_package(): + platforms = ["Windows", "Linux", "Solaris", "Mac OS-X", "Unix"], + test_suite='nose.collector', + cmdclass={"sdist": sdist_checked}, +- package_data={'numpy.core': ['libopenblaspy.dll']}, + ) + + # Run build diff --git a/build/pkgs/numpy/spkg-install b/build/pkgs/numpy/spkg-install index 59d5b6175f0..b61cf6cb2f1 100755 --- a/build/pkgs/numpy/spkg-install +++ b/build/pkgs/numpy/spkg-install @@ -24,12 +24,13 @@ fi cd src # Apply patches. -patches="" +patches="../patches/*.patch" if [ $UNAME = "CYGWIN" ]; then echo "CYGWIN: Patching numpy/linalg/setup.py" patches="$patches ../patches/cygwin-lapack_lite-setup.py.diff" fi for patch in $patches; do + [ -r "$patch" ] || continue # Skip non-existing or non-readable patches patch -p1 <"$patch" if [ $? -ne 0 ]; then echo >&2 "Error applying '$patch'" diff --git a/build/pkgs/python2/checksums.ini b/build/pkgs/python2/checksums.ini index 2dc7e5a18f0..e3ac170d782 100644 --- a/build/pkgs/python2/checksums.ini +++ b/build/pkgs/python2/checksums.ini @@ -1,4 +1,4 @@ tarball=python-VERSION.tar.gz -sha1=7a191bcccb598ccbf2fa6a0edce24a97df3fc0ad -md5=5eebcaa0030dc4061156d3429657fb83 -cksum=68145953 +sha1=49089f1f6ab445dc8ace97beeb276095c4c8039b +md5=d7547558fd673bd9d38e2108c6b42521 +cksum=415018982 diff --git a/build/pkgs/python2/package-version.txt b/build/pkgs/python2/package-version.txt index 3e651609d62..7dceab0f186 100644 --- a/build/pkgs/python2/package-version.txt +++ b/build/pkgs/python2/package-version.txt @@ -1 +1 @@ -2.7.9 +2.7.10 diff --git a/build/pkgs/python2/spkg-install b/build/pkgs/python2/spkg-install index 1d3cae79f15..94d53ac3161 100755 --- a/build/pkgs/python2/spkg-install +++ b/build/pkgs/python2/spkg-install @@ -48,6 +48,11 @@ fi if [ `uname` = "Darwin" ]; then PYTHON_CONFIGURE="--disable-toolbox-glue $PYTHON_CONFIGURE" + # Workaround for El Capitan, Trac #19626 + xcode=$(xcode-select --print-path) + mkdir "$CUR"/include + cp -rp "${xcode}"/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-migrator/sdk/MacOSX.sdk/usr/include/openssl "$CUR"/include + export CFLAGS="$CFLAGS -I$CUR/include" fi if [ "$SAGE64" = yes ]; then @@ -152,14 +157,6 @@ done if $import_errors; then echo >&2 "Error: One or more modules failed to import." - # Check if we are on Debian or one of its derivatives: - if { command -v dpkg && ! command -v dpkg-architecture; } >/dev/null; then - echo >&2 "You may have to install 'dpkg-architecture'" - echo >&2 "which is part of the Debian package 'dpkg-dev'." - echo >&2 "Try installing it by typing" - echo >&2 " sudo apt-get install dpkg-dev" - echo >&2 "and rerun 'make'." - fi exit 1 fi diff --git a/build/pkgs/python3/spkg-install b/build/pkgs/python3/spkg-install index 32224411b16..49ec70dde1c 100755 --- a/build/pkgs/python3/spkg-install +++ b/build/pkgs/python3/spkg-install @@ -140,14 +140,6 @@ done if $import_errors; then echo >&2 "Error: One or more modules failed to import." - # Check if we are on Debian or one of its derivatives: - if { command -v dpkg && ! command -v dpkg-architecture; } >/dev/null; then - echo >&2 "You may have to install 'dpkg-architecture'" - echo >&2 "which is part of the Debian package 'dpkg-dev'." - echo >&2 "Try installing it by typing" - echo >&2 " sudo apt-get install dpkg-dev" - echo >&2 "and rerun 'make'." - fi exit 1 fi diff --git a/build/pkgs/qepcad/package-version.txt b/build/pkgs/qepcad/package-version.txt index fa0ca92c91f..4f1fde94e53 100644 --- a/build/pkgs/qepcad/package-version.txt +++ b/build/pkgs/qepcad/package-version.txt @@ -1 +1 @@ -B.1.69 +B.1.69.p0 diff --git a/build/pkgs/qepcad/spkg-install b/build/pkgs/qepcad/spkg-install index 6da4a409be9..b63aae757d6 100755 --- a/build/pkgs/qepcad/spkg-install +++ b/build/pkgs/qepcad/spkg-install @@ -9,14 +9,6 @@ fi cd qesource - -# Test if saclib is installed -if [ ! -d "$SAGE_LOCAL/lib/saclib" ] ; then - echo >&2 'You should install saclib first.' - exit 1 -fi - - # Apply patches. echo 'Patching qepcad' for patch in ../patches/*.patch; do @@ -42,8 +34,8 @@ fi # install binaries to the Sage tree -find . -name *.a -exec cp {} $SAGE_LOCAL/lib/ \; -cp source/qepcad $SAGE_LOCAL/bin/ -cp bin/qepcad.help $SAGE_LOCAL/bin/ -cp ../sage-qepcad $SAGE_LOCAL/bin/ - +find . -name *.a -exec cp {} "$SAGE_LOCAL/lib/" \; +cp source/qepcad "$SAGE_LOCAL/bin/" +cp bin/qepcad.help "$SAGE_LOCAL/bin/" +chmod 0644 "$SAGE_LOCAL/bin/qepcad.help" +cp ../sage-qepcad "$SAGE_LOCAL/bin/" diff --git a/build/pkgs/scipy/checksums.ini b/build/pkgs/scipy/checksums.ini index f85654e1dda..cd0c4354db5 100644 --- a/build/pkgs/scipy/checksums.ini +++ b/build/pkgs/scipy/checksums.ini @@ -1,4 +1,4 @@ tarball=scipy-VERSION.tar.gz -sha1=faf16ddf307eb45ead62a92ffadc5288a710feb8 -md5=d7c7f4ccf8b07b08d6fe49d5cd51f85d -cksum=585799051 +sha1=562aa8c6658b5face5e7832deff3c6f2bee55426 +md5=967cdb8588a4249f820344d8264a2143 +cksum=2565278984 diff --git a/build/pkgs/scipy/package-version.txt b/build/pkgs/scipy/package-version.txt index a803cc227fe..2a0970ca757 100644 --- a/build/pkgs/scipy/package-version.txt +++ b/build/pkgs/scipy/package-version.txt @@ -1 +1 @@ -0.14.0 +0.16.1 diff --git a/build/pkgs/tdlib/SPKG.txt b/build/pkgs/tdlib/SPKG.txt new file mode 100644 index 00000000000..a4567c1b9c4 --- /dev/null +++ b/build/pkgs/tdlib/SPKG.txt @@ -0,0 +1,20 @@ += TdLib = + +== Description == +Providing algorithms concerning treedecompositions + +website: http://www.tdi.informatik.uni-frankfurt.de/~lukas/tdlib.html + +== License == +GNU General Public License v2 + +== SPKG Maintainers == +Lukas Larisch (larisch@informatik.uni-frankfurt.de) + +== Upstream Contact == +Lukas Larisch (larisch@informatik.uni-frankfurt.de) +git-repo: git://pholia.tdi.cs.uni-frankfurt.de/git/tdlib + +== Dependencies == + * None + diff --git a/build/pkgs/tdlib/checksums.ini b/build/pkgs/tdlib/checksums.ini new file mode 100644 index 00000000000..7f557c54f86 --- /dev/null +++ b/build/pkgs/tdlib/checksums.ini @@ -0,0 +1,4 @@ +tarball=tdlib-VERSION.tar.gz +sha1=8e200d0e3ac009030f3ada6658d20717e433220f +md5=6bd9e7d9dae616079d511658f70eff73 +cksum=2382384273 diff --git a/build/pkgs/tdlib/package-version.txt b/build/pkgs/tdlib/package-version.txt new file mode 100644 index 00000000000..9e11b32fcaa --- /dev/null +++ b/build/pkgs/tdlib/package-version.txt @@ -0,0 +1 @@ +0.3.1 diff --git a/build/pkgs/tdlib/spkg-install b/build/pkgs/tdlib/spkg-install new file mode 100755 index 00000000000..09c1d7c46e4 --- /dev/null +++ b/build/pkgs/tdlib/spkg-install @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +if [ "$SAGE_LOCAL" = "" ]; then + echo "SAGE_LOCAL undefined ... exiting"; + echo "Maybe run 'sage -sh'?" + exit 1 +fi + +cd src + +./configure \ + --prefix="$SAGE_LOCAL" + +$MAKE install -j1 +if [ $? -ne 0 ]; then + echo "Error installing tdlib" + exit 1 +fi + diff --git a/build/pkgs/tdlib/type b/build/pkgs/tdlib/type new file mode 100644 index 00000000000..134d9bc32d5 --- /dev/null +++ b/build/pkgs/tdlib/type @@ -0,0 +1 @@ +optional diff --git a/build/sage_bootstrap/cksum.py b/build/sage_bootstrap/cksum.py new file mode 100644 index 00000000000..5d640b69920 --- /dev/null +++ b/build/sage_bootstrap/cksum.py @@ -0,0 +1,93 @@ +""" +The unix cksum tool + +This is a weak checksum, only included for legacy reasons. +""" +import sys + +# Fun table, e.g. http://www.nco.ncep.noaa.gov/pmb/codes/nwprod/util/sorc/wgrib2.cd/grib2/wgrib2/crc32.c + +crctab = [ + 0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, + 0x17c56b6b, 0x1a864db2, 0x1e475005, 0x2608edb8, 0x22c9f00f, + 0x2f8ad6d6, 0x2b4bcb61, 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, + 0x384fbdbd, 0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9, + 0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75, 0x6a1936c8, + 0x6ed82b7f, 0x639b0da6, 0x675a1011, 0x791d4014, 0x7ddc5da3, + 0x709f7b7a, 0x745e66cd, 0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, + 0x95609039, 0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5, + 0xbe2b5b58, 0xbaea46ef, 0xb7a96036, 0xb3687d81, 0xad2f2d84, + 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d, 0xd4326d90, 0xd0f37027, + 0xddb056fe, 0xd9714b49, 0xc7361b4c, 0xc3f706fb, 0xceb42022, + 0xca753d95, 0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1, + 0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d, 0x34867077, + 0x30476dc0, 0x3d044b19, 0x39c556ae, 0x278206ab, 0x23431b1c, + 0x2e003dc5, 0x2ac12072, 0x128e9dcf, 0x164f8078, 0x1b0ca6a1, + 0x1fcdbb16, 0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca, + 0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde, 0x6b93dddb, + 0x6f52c06c, 0x6211e6b5, 0x66d0fb02, 0x5e9f46bf, 0x5a5e5b08, + 0x571d7dd1, 0x53dc6066, 0x4d9b3063, 0x495a2dd4, 0x44190b0d, + 0x40d816ba, 0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e, + 0xbfa1b04b, 0xbb60adfc, 0xb6238b25, 0xb2e29692, 0x8aad2b2f, + 0x8e6c3698, 0x832f1041, 0x87ee0df6, 0x99a95df3, 0x9d684044, + 0x902b669d, 0x94ea7b2a, 0xe0b41de7, 0xe4750050, 0xe9362689, + 0xedf73b3e, 0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2, + 0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686, 0xd5b88683, + 0xd1799b34, 0xdc3abded, 0xd8fba05a, 0x690ce0ee, 0x6dcdfd59, + 0x608edb80, 0x644fc637, 0x7a089632, 0x7ec98b85, 0x738aad5c, + 0x774bb0eb, 0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f, + 0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53, 0x251d3b9e, + 0x21dc2629, 0x2c9f00f0, 0x285e1d47, 0x36194d42, 0x32d850f5, + 0x3f9b762c, 0x3b5a6b9b, 0x0315d626, 0x07d4cb91, 0x0a97ed48, + 0x0e56f0ff, 0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623, + 0xf12f560e, 0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7, 0xe22b20d2, + 0xe6ea3d65, 0xeba91bbc, 0xef68060b, 0xd727bbb6, 0xd3e6a601, + 0xdea580d8, 0xda649d6f, 0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, + 0xc960ebb3, 0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7, + 0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b, 0x9b3660c6, + 0x9ff77d71, 0x92b45ba8, 0x9675461f, 0x8832161a, 0x8cf30bad, + 0x81b02d74, 0x857130c3, 0x5d8a9099, 0x594b8d2e, 0x5408abf7, + 0x50c9b640, 0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c, + 0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8, 0x68860bfd, + 0x6c47164a, 0x61043093, 0x65c52d24, 0x119b4be9, 0x155a565e, + 0x18197087, 0x1cd86d30, 0x029f3d35, 0x065e2082, 0x0b1d065b, + 0x0fdc1bec, 0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088, + 0x2497d08d, 0x2056cd3a, 0x2d15ebe3, 0x29d4f654, 0xc5a92679, + 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0, 0xd6ad50a5, 0xd26c4d12, + 0xdf2f6bcb, 0xdbee767c, 0xe3a1cbc1, 0xe760d676, 0xea23f0af, + 0xeee2ed18, 0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4, + 0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0, 0x9abc8bd5, + 0x9e7d9662, 0x933eb0bb, 0x97ffad0c, 0xafb010b1, 0xab710d06, + 0xa6322bdf, 0xa2f33668, 0xbcb4666d, 0xb8757bda, 0xb5365d03, + 0xb1f740b4 ] + + +UNSIGNED = lambda n: n & 0xffffffff + + +class CksumAlgorithm(object): + + def __init__(self): + self._value = 0 + self._length = 0 + + def update(self, buffer): + value = self._value + for ch in buffer: + c = ord(ch) + tabidx = (value >> 24) ^ c + value = UNSIGNED((value << 8)) ^ crctab[tabidx] + self._value = value + self._length += len(buffer) + + def get_value(self): + n = self._length + value = self._value + while n: + c = n & 0o377 + n = n >> 8 + value = UNSIGNED(value << 8) ^ crctab[(value >> 24) ^ c] + return UNSIGNED(~value) + + def hexdigest(self): + return str(self.get_value()) diff --git a/build/sage_bootstrap/cmdline.py b/build/sage_bootstrap/cmdline.py index c08d958e4c4..fc8d4588929 100644 --- a/build/sage_bootstrap/cmdline.py +++ b/build/sage_bootstrap/cmdline.py @@ -18,6 +18,7 @@ import os import sys +import re from textwrap import dedent import logging log = logging.getLogger() @@ -31,6 +32,8 @@ class CmdlineSubcommands(object): + KEYWORD_RE = re.compile('--(?P