Index: math/sage/Makefile =================================================================== --- math/sage/Makefile +++ math/sage/Makefile @@ -2,8 +2,7 @@ # $FreeBSD$ PORTNAME= sage -PORTVERSION= 6.7 -PORTREVISION= 8 +PORTVERSION= 9.0 CATEGORIES= math MASTER_SITES= http://boxen.math.washington.edu/home/sagemath/sage-mirror/src/ \ http://mirrors.xmission.com/sage/src/ \ @@ -15,120 +14,151 @@ MAINTAINER= stephen@FreeBSD.org COMMENT= Open source Mathematics software -BROKEN= unfetchable - LICENSE= GPLv3 LICENSE_FILE= ${WRKSRC}/COPYING.txt -BUILD_DEPENDS= bash:shells/bash \ - convert:graphics/ImageMagick6 \ - ffmpeg:multimedia/ffmpeg \ - automake:devel/automake \ - autoconf:devel/autoconf -LIB_DEPENDS= libatlas.so:math/atlas \ - liblapack.so:math/lapack -RUN_DEPENDS= bash:shells/bash +BUILD_DEPENDS= bash:shells/bash \ + dash:shells/dash \ + rw:sysutils/rw \ + cmake:devel/cmake \ + ninja:devel/ninja \ + gpatch:devel/patch \ + cython:lang/cython \ + gtar:archivers/gtar \ + convert:graphics/ImageMagick6 \ + ffmpeg:multimedia/ffmpeg \ + ${LOCALBASE}/lib/libBLT.a:x11-toolkits/blt +LIB_DEPENDS= libR.so:math/R \ + libqd.so:math/qd \ + libgmp.so:math/gmp \ + libarb.so:math/arb \ + libntl.so:math/ntl \ + libmpc.so:math/mpc \ + libisl.so:devel/isl \ + libcurl.so:ftp/curl \ + libec.so:math/eclib \ + libgd.so:graphics/gd \ + libblas.so:math/blas \ + libglpk.so:math/glpk \ + libm4ri.so:math/m4ri \ + libmpfr.so:math/mpfr \ + libmpir.so:math/mpir \ + libpari.so:math/pari \ + libicuuc.so:devel/icu \ + libzmq.so:net/libzmq4 \ + libpcre.so:devel/pcre \ + libffi.so:devel/libffi \ + libecm.so:math/gmp-ecm \ + libpng.so:graphics/png \ + libtiff.so:graphics/tiff \ + libgivaro.so:math/givaro \ + liblapack.so:math/lapack \ + libedit.so:devel/libedit \ + libwebp.so:graphics/webp \ + libpcre2-8.so:devel/pcre2 \ + libgdbm.so:databases/gdbm \ + liblcms2.so:graphics/lcms2 \ + libfreetype.so:print/freetype2 \ + libopenjp2.so:graphics/openjpeg \ + libclang.so:devel/llvm${LLVM_DEFAULT} + # lcalc could be ported from https://github.com/agrawroh/l-calc + # math/symmetrica should be modified to build the library + # math/flint2 to be built with NTL. See https://trac.sagemath.org/ticket/27764 +RUN_DEPENDS= bash:shells/bash \ + git:devel/git \ + yasm:devel/yasm \ + pixz:archivers/pixz -pre-extract: - @${ECHO_MSG} - @${ECHO_MSG} Instead of installing the port, which will take a considerable amount of - @${ECHO_MSG} extra time and space, you can instead type \"make build\". Then you can move - @${ECHO_MSG} work/${PORTNAME}-${PORTVERSION} to wherever you like, and run sage from there. - @${ECHO_MSG} However, there is no guarantee that this alternative will always work. -. if !(defined(PACKAGE_BUILDING) || defined(BATCH)) - @sleep 10 -. endif +# openmp is needed but USES=compiler:openmp is broken (forces GCC) +USES= blaslapack:openblas compiler:c++11-lang desktop-file-utils fortran \ + gettext-runtime gmake gnome iconv jpeg libtool localbase ncurses perl5 \ + pkgconfig python:3.6+ readline shared-mime-info shebangfix ssl tk xorg +USE_TEX= latex:build pdftex:build tex:build +USE_XORG= x11 xext xscrnsaver +USE_GNOME= cairo glib20 pango -PLIST_FILES= bin/sage -USE_TEX= latex:build -USES= gmake iconv jpeg tk perl5 +SHEBANG_FILES= . +SHEBANG_LANG+= dash +dash_OLD_CMD= /bin/dash +dash_CMD= ${LOCALBASE}/bin/dash -# Optimization flags will be defined by the source -CFLAGS:= ${CFLAGS:C/^-O.*$//} -FFLAGS:= ${CFLAGS:C/^-O.*$//} +LDFLAGS+= -L${LOCALBASE}/llvm${COMPILER_VERSION}/lib +LIBS= -lomp -pthread +GNU_CONFIGURE= yes +# sage_require_xxx=no: external package to be added to ports tree or somewhat fixed +CONFIGURE_ENV= SAGE_PORT=yes CC=${CC} GCC=${CC} CXX=${CXX} AS=${AS} LD=${LD} \ + SAGE_LOCAL=${STAGEDIR}/${PREFIX} SAGE_DESTDIR=${STAGEDIR}/ \ + DESTDIR=${STAGEDIR}/${PREFIX} PATCH=${LOCALBASE}/bin/gpatch \ + sage_require_gcc=no \ + sage_require_atlas=no \ + sage_require_pari=no \ + sage_require_eclib=no \ + sage_require_git=no \ + sage_require_givaro=no \ + sage_require_gp2c=no +CONFIGURE_ARGS= --with-system-gcc=force \ + --localstatedir=/var +MAKE_ENV= MAKE=${GMAKE} +REINPLACE_ARGS= -i '' -MAKE_ENV+= SAGE_PORT=yes \ - SAGE_ATLAS_LIB=${LOCALBASE}/lib \ - DOT_SAGE=${WRKSRC}/tmp/.sage \ - SAGE_FAT_BINARY=yes \ - PERL=${PERL} +.include -# The following is needed for the lapack subpackage. -MAKE_ARGS+= ARCH="${AR}" +WSDIR= ${STAGEDIR}${PREFIX} +SPKG_INST= configure.ac configure build/sage_bootstrap/uninstall.py \ + build/make/install src/bin/sage-env +BASH2FIX= share/gap/pkg/GAPDoc-1.6.2/example/clean \ + share/gap/pkg/GAPDoc-1.6.2/3k+1/clean \ + share/gap/pkg/GAPDoc-1.6.2/doc/clean \ + lib/${PYTHON_VERSION}/site-packages/bleach/_vendor/pip_install_vendor.sh\ + bin/libsingular-config \ + bin/libpolys-config \ + bin/linbox-config +PERL2FIX= bin/pgiac +PY2FIX= bin lib/${PYTHON_VERSION} +DOC2FIX= .pickle .doctree post-patch: -# Create wrapper for invocation of make. - @${MKDIR} ${WRKSRC}/local/bin - @${LN} -s -f ${LOCALBASE}/bin/gmake ${WRKSRC}/local/bin/make + ${CP} ${FILESDIR}/psutil__arch__bsd__freebsd_socks.c.patch \ + ${WRKSRC}/build/pkgs/psutil/patches/ -# Create wrapper for invocation of ld. - @${SED} -e 's#%%LD%%#${LOCALBASE}/bin/ld#' \ - ${FILESDIR}/ld.in > ${WRKSRC}/local/bin/ld - @${CHMOD} +x ${WRKSRC}/local/bin/ld +pre-configure: + ${REINPLACE_CMD} -e 's|SAGE_LOCAL="$$prefix"|SAGE_LOCAL="${WSDIR}"|' \ + ${WRKSRC}/${CONFIGURE_SCRIPT} + ${REINPLACE_CMD} -e 's|SAGE_LOCAL="@prefix@"|SAGE_LOCAL="${WSDIR}"|' \ + ${WRKSRC}/src/bin/sage-env-config.in + ${REINPLACE_CMD} -e 's|-v python3|-v ${PYTHON_CMD}|' \ + ${WRKSRC}/build/bin/sage-system-python + ${REINPLACE_CMD} -e 's|%%CFLAGS%%|${CFLAGS}|;s|%%LDFLAGS%%|${LDFLAGS}|' \ + ${WRKSRC}/build/pkgs/tachyon/patches/Make-arch.patch +.for f in ${SPKG_INST} + ${REINPLACE_CMD} -e 's|/var/lib/sage|/share/libdata/${PORTNAME}|' \ + ${WRKSRC}/${f} +.endfor -post-build: - ${RM} -r ${WRKSRC}/tmp/.sage - ${CHMOD} -R a+rX ${WRKSRC} +post-stage: +.for f in ${BASH2FIX} + ${SED} -i "" -e 's|/bin/bash|${LOCALBASE}/bin/bash|' ${WSDIR}/${f} +.endfor +.for f in ${PERL2FIX} + ${SED} -i "" -e 's|/usr/bin/perl|${LOCALBASE}/bin/perl|' ${WSDIR}/${f} +.endfor +.for d in ${PY2FIX} + ${FIND} ${WSDIR}/${d} -type f -exec ${GREP} -I -l "${WSDIR}/bin/python" {} \; |\ + ${XARGS} ${SED} -i "" -e 's|${WSDIR}/bin/pytho.*|${PYTHON_CMD}|' +.endfor +.for d in ${PY2FIX} + ${FIND} ${WSDIR}/${d} -type f -exec ${GREP} -I -l "/usr/bin/env python" {} \; |\ + ${XARGS} ${SED} -i "" -e 's|/usr/bin/env pytho.*|${PYTHON_CMD}|' +.endfor + ${FIND} ${STAGEDIR}/${PYTHON_LIBDIR} -type d -name __pycache__ | \ + ${XARGS} ${RM} -r + # ${TRUE} because compilation of some .py fails: compileall.py -q to see errors + (cd ${WSDIR} && (${PYTHON_CMD} ${PYTHON_LIBDIR}/compileall.py \ + -d ${PYTHONPREFIX_SITELIBDIR} -f ${PYTHONPREFIX_SITELIBDIR:S;${PREFIX}/;;} || \ + ${TRUE})) +.for f in ${DOC2FIX} + ${FIND} ${STAGEDIR}${DOCSDIR} -type f -name "*${f}" | ${XARGS} \ + ${SED} -i "" -e 's|${STAGEDIR}||g' +.endfor -check regression-test test: build - @${ECHO_MSG} This test can also be performed after installation by typing \"sage -testall\". - @${ECHO_MSG} - cd ${WRKSRC} && ${SETENV} DOT_SAGE=${WRKSRC}/tmp/.sage ./sage -testall - ${RM} ${WRKSRC}/python*.core - -# Don't build docs (because of mysterious race conditions). -ALL_TARGET= build - -INSTALL_SAGE_DIR= ${PREFIX}/${PORTNAME}-${PORTVERSION} -STAGED_SAGE_DIR= ${STAGEDIR}${INSTALL_SAGE_DIR} -do-install: - cd ${WRKDIR} && ${FIND} -s ${WRKSRC} | \ - ${GREP} -v '^${WRKSRC}/upstream/' | \ - ${GREP} -v '^${WRKSRC}/tmp' | \ - ${SED} -e 's#${WRKDIR}/##' | \ - ${CPIO} -pmud -R ${BINOWN}:${BINGRP} ${STAGEDIR}${PREFIX} - ${ECHO_CMD} | ${SETENV} DOT_SAGE=${STAGED_SAGE_DIR}/tmp/.sage ${STAGED_SAGE_DIR}/sage - ${RM} -r ${STAGED_SAGE_DIR}/tmp/.sage - ${SED} -e "s+#SAGE_ROOT.*+SAGE_ROOT=${INSTALL_SAGE_DIR}+" ${WRKSRC}/sage > ${STAGEDIR}${PREFIX}/bin/sage - ${CHMOD} ${BINMODE} ${STAGEDIR}${PREFIX}/bin/sage - -post-install: - @${FIND} -s ${STAGED_SAGE_DIR} -not -type d | \ - ${SED} -e 's#${STAGEDIR}${PREFIX}/##' >> ${TMPPLIST} - @${FIND} -s ${STAGED_SAGE_DIR} -type d -empty | \ - ${SED} -e 's#${STAGEDIR}${PREFIX}/#@dir #' >> ${TMPPLIST} - -.include - -MAKE_ENV+= MAKE="${MAKE} -j${MAKE_JOBS_NUMBER}" - -.ifdef MAINTAINER_MODE -test-fbsd-patches: patch - ${RM} -r ${WRKSRC}/build/pkgs/*/src; \ - for d in ${WRKSRC}/build/pkgs/*; do \ - if ls $$d/fbsd-patch-* > /dev/null 2>&1; then \ - ${ECHO_MSG} Testing patches in $${d##*/}; \ - b=$${d##*/}-`${CAT} $$d/package-version.txt | ${SED} 's/\.p.*//'`; \ - c=${WRKSRC}/upstream/$$b.tar.bz2 ; \ - if [ ! -e $$c ]; then \ - c=${WRKSRC}/upstream/$$b.tar.gz ; \ - if [ ! -e $$c ]; then \ - ${ECHO_MSG} Couldn\'t find $$c; \ - exit 1; \ - fi; \ - fi; \ - b=`echo $$b | sed 's/python/Python/'` ; \ - if ! (cd $$d && tar xf $$c && ${MV} $$b src); then \ - ${ECHO_MSG} Unable to unarchive $$c; \ - exit 1; \ - fi; \ - if ! (cd $$d && ${CAT} fbsd-patch-* | patch); then \ - ${ECHO_MSG} Patches in $${d##*/} failed; \ - exit 1; \ - fi; \ - fi; \ - done; \ - ${RM} -r ${WRKSRC}/build/pkgs/*/src -.endif - .include Index: math/sage/distinfo =================================================================== --- math/sage/distinfo +++ math/sage/distinfo @@ -1,2 +1,3 @@ -SHA256 (sage-6.7.tar.gz) = da4688cb48c221356005935c666fa3eac96c50de60f3e5b274072f0520745677 -SIZE (sage-6.7.tar.gz) = 487207063 +TIMESTAMP = 1583004896 +SHA256 (sage-9.0.tar.gz) = 8a8fa76f9cbdbbdd59ee88616ffee12c42b4064c699811b1ff55975268423c13 +SIZE (sage-9.0.tar.gz) = 1101719522 Index: math/sage/files/gcc.in =================================================================== --- math/sage/files/gcc.in +++ math/sage/files/gcc.in @@ -1,14 +0,0 @@ -#!/bin/sh - -# This is a wrapper to redirect compiler invokations to the port of gcc that -# contains fortran. LDFLAGS needs to be added so that the linker knows where -# to find the dynamic libraries. - -# If the compiler is invoked with the argument "-v", adding LDFLAGS to the -# arguments results in an error which stops some packages being built. - -if [ "x$*" = "x-v" ]; then - exec %%CC%% "$@" -else - exec %%CC%% %%LDFLAGS%% -Wl,--copy-dt-needed-entries "$@" -fi Index: math/sage/files/ld.in =================================================================== --- math/sage/files/ld.in +++ math/sage/files/ld.in @@ -1,3 +0,0 @@ -#!/bin/sh - -exec %%LD%% --copy-dt-needed-entries "$@" Index: math/sage/files/optional-packages.txt =================================================================== --- math/sage/files/optional-packages.txt +++ math/sage/files/optional-packages.txt @@ -1,23 +0,0 @@ -Sage comes with optional packages. Unfortunately they have to be downloaded -and installed after the port is built, and preferably before the port is -installed (see note 4). But because of the security risk of downloading files -without checksums, they can only be installed manually as follows: - -cd /usr/ports/math/sage -make build -work/sage-*/sage -optional # See note 1. -work/sage-*/sage -i $OPTIONAL_PACKAGE_NAME # See note 2. -make install # See note 3. - -1. This command gives a list of the optional packages available. -2. This will download and install the optional package. Not all packages - build properly, but if they don't build they won't be installed. -3. All the files associated with the installed optional packages will be - included in the plist file, and so will be deinstalled along with - everything else when the pkg_delete command is used. -4. You can also try installing the packages AFTER the port is installed, - but for some reason this doesn't always work. - -AND - -5. Install and use these at your own risk. Index: math/sage/files/patch-build_bin_sage-apply-patches =================================================================== --- math/sage/files/patch-build_bin_sage-apply-patches +++ math/sage/files/patch-build_bin_sage-apply-patches @@ -0,0 +1,11 @@ +--- build/bin/sage-apply-patches.orig 2020-01-01 11:03:10 UTC ++++ build/bin/sage-apply-patches +@@ -67,7 +67,7 @@ if [[ -r "${patches[0]}" ]]; then + # Skip non-existing or non-readable patches + [ -r "$patch" ] || continue + echo "Applying $patch" +- patch $patch_strip $patch_args < "$patch" ++ gpatch $patch_strip $patch_args < "$patch" + if [ $? -ne 0 ]; then + echo >&2 "Error applying '$patch'" + exit 1 Index: math/sage/files/patch-build_pkgs_eclib_spkg-install =================================================================== --- math/sage/files/patch-build_pkgs_eclib_spkg-install +++ math/sage/files/patch-build_pkgs_eclib_spkg-install @@ -1,12 +0,0 @@ ---- build/pkgs/eclib/spkg-install-orig 2015-04-15 23:32:22.643814000 +0000 -+++ build/pkgs/eclib/spkg-install 2015-04-15 23:33:02.634085000 +0000 -@@ -60,6 +60,9 @@ - - echo - echo "Now configuring eclib..." -+aclocal -+automake --add-missing -+autoconf - ./configure --prefix="$SAGE_LOCAL" \ - --with-ntl="$SAGE_LOCAL" \ - --with-pari="$SAGE_LOCAL" \ Index: math/sage/files/patch-build_pkgs_gfan_spkg-install =================================================================== --- math/sage/files/patch-build_pkgs_gfan_spkg-install +++ math/sage/files/patch-build_pkgs_gfan_spkg-install @@ -0,0 +1,12 @@ +--- build/pkgs/gfan/spkg-install.orig 2020-01-01 11:03:10 UTC ++++ build/pkgs/gfan/spkg-install +@@ -4,6 +4,9 @@ export CC CXX CFLAGS CXXFLAGS LDFLAGS + + cd src + ++echo "Patching for FreeBSD..." ++/usr/bin/sed -i.bak 's,log2,gfan_log2,g' src/*.h src/*.cpp ++ + echo "Now building gfan..." + # We don't use the makefile to install gfan so we don't need to set PREFIX + sdh_make CPPFLAGS="-I$SAGE_LOCAL/include" Index: math/sage/files/patch-build_pkgs_git_spkg-install =================================================================== --- math/sage/files/patch-build_pkgs_git_spkg-install +++ math/sage/files/patch-build_pkgs_git_spkg-install @@ -1,21 +0,0 @@ ---- build/pkgs/git/spkg-install.orig 2015-05-17 22:46:55.000000000 +0000 -+++ build/pkgs/git/spkg-install 2015-05-24 22:10:32.517077000 +0000 -@@ -69,7 +69,8 @@ - --libexecdir="$SAGE_LOCAL"/libexec \ - --with-python="$SAGE_LOCAL"/bin/python \ - --without-tcltk \ -- --with-sane-tool-path= -+ --with-sane-tool-path= \ -+ --with-perl=$PERL - if [ $? -ne 0 ]; then - echo >&2 "Error configuring git." - exit 1 -@@ -77,7 +78,7 @@ - - - echo "Building git..." --$MAKE $gettext -+$MAKE PTHREAD_LIBS=-lpthread $gettext - if [ $? -ne 0 ]; then - echo >&2 "Error building git." - exit 1 Index: math/sage/files/patch-build_pkgs_iml_spkg-install =================================================================== --- math/sage/files/patch-build_pkgs_iml_spkg-install +++ math/sage/files/patch-build_pkgs_iml_spkg-install @@ -1,20 +0,0 @@ ---- build/pkgs/iml/spkg-install-orig 2014-12-06 21:45:54.000000000 +0000 -+++ build/pkgs/iml/spkg-install 2014-12-06 21:50:08.000000000 +0000 -@@ -18,6 +18,7 @@ - fi - done - -+export CFLAGS="-I${LOCALBASE}/include $CFLAGS" - - if [ "$SAGE_DEBUG" = "yes" ]; then - echo "Building a debug version of IML." -@@ -38,6 +39,9 @@ - EXTRA_BLAS="--with-cblas=-lcblas" - fi - -+aclocal -+automake --add-missing -+autoconf - ./configure --prefix="$SAGE_LOCAL" --libdir="$SAGE_LOCAL/lib" \ - --enable-shared --with-default="$SAGE_LOCAL" "$EXTRA_BLAS" - if [ $? -ne 0 ]; then Index: math/sage/files/patch-build_pkgs_libgap_spkg-install =================================================================== --- math/sage/files/patch-build_pkgs_libgap_spkg-install +++ math/sage/files/patch-build_pkgs_libgap_spkg-install @@ -1,12 +0,0 @@ ---- build/pkgs/libgap/spkg-install-orig 2014-05-15 02:28:13.000000000 +0000 -+++ build/pkgs/libgap/spkg-install 2014-05-15 02:29:05.000000000 +0000 -@@ -42,6 +42,9 @@ - done - - echo "Configuring libGAP..." -+aclocal -+automake --add-missing -+autoconf - ./configure --disable-static \ - CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" CPPFLAGS="$CPPFLAGS" \ - --with-gap_system_arch="$GAParch_system" \ Index: math/sage/files/patch-build_pkgs_m4rie_spkg-install =================================================================== --- math/sage/files/patch-build_pkgs_m4rie_spkg-install +++ math/sage/files/patch-build_pkgs_m4rie_spkg-install @@ -1,12 +0,0 @@ ---- build/pkgs/m4rie/spkg-install-orig 2014-12-06 21:51:23.000000000 +0000 -+++ build/pkgs/m4rie/spkg-install 2014-12-06 21:51:46.000000000 +0000 -@@ -51,6 +51,9 @@ - # build M4RIE - - cd $ROOT_DIR/src/ -+aclocal -+automake --add-missing -+autoconf - ./configure \ - --prefix="$SAGE_LOCAL" \ - --libdir="$SAGE_LOCAL/lib" \ Index: math/sage/files/patch-build_pkgs_maxima_fbsd-patch-src_interfaces_xmaxima_Makefile.in =================================================================== --- math/sage/files/patch-build_pkgs_maxima_fbsd-patch-src_interfaces_xmaxima_Makefile.in +++ math/sage/files/patch-build_pkgs_maxima_fbsd-patch-src_interfaces_xmaxima_Makefile.in @@ -1,23 +0,0 @@ ---- /dev/null 2014-01-29 03:00:00.000000000 +0000 -+++ build/pkgs/maxima/fbsd-patch-src_interfaces_xmaxima_Makefile.in 2014-01-29 03:01:19.000000000 +0000 -@@ -0,0 +1,20 @@ -+--- src/interfaces/xmaxima/Makefile.in-orig 2013-05-09 02:26:31.000000000 +0000 -++++ src/interfaces/xmaxima/Makefile.in 2013-05-09 02:30:12.000000000 +0000 -+@@ -624,14 +624,10 @@ -+ tclIndex:: $(TKSOURCES) -+ echo "source ../ObjTcl/Object.tcl; auto_mkindex . $(TKSOURCES)" | $(TCLSH) -+ -+-# Create Tkmaxima/tclIndex if tclsh is available. Otherwise, create empty file -+-# to satisfy make. -++# Create empty Tkmaxima/tclIndex, because attempting to create it using tclsh -++# seems to soak up huge amounts of resources. -+ Tkmaxima/tclIndex: $(TKSOURCES) -+- $(TCLSH) < /dev/null > /dev/null 2>&1 && \ -+- (cd Tkmaxima ; \ -+- echo "source ../ObjTcl/Object.tcl; auto_mkindex . $(ALLFILES)" | \ -+- $(TCLSH)) || \ -+- touch Tkmaxima/tclIndex -++ touch Tkmaxima/tclIndex -+ -+ FORCE: -+ # Tell versions [3.59,3.63) of GNU make to not export all variables. Index: math/sage/files/patch-build_pkgs_maxima_spkg-install =================================================================== --- math/sage/files/patch-build_pkgs_maxima_spkg-install +++ math/sage/files/patch-build_pkgs_maxima_spkg-install @@ -1,11 +0,0 @@ ---- build/pkgs/maxima/spkg-install-orig 2014-12-06 21:53:38.000000000 +0000 -+++ build/pkgs/maxima/spkg-install 2014-12-06 21:54:40.000000000 +0000 -@@ -51,6 +51,8 @@ - ./configure --prefix="$SAGE_LOCAL" --libdir="$SAGE_LOCAL/lib" --enable-ecl git_found=false - check_error "Failed to configure Maxima." - -+# Remove extraneous spaces created in some of the flags passed to cc -+sed -i.bak 's/" /"/' src/autoconf-variables.lisp - - # Touching html and info files to avoid to regenerate them. - # This must be done after configuration since the timestamps need Index: math/sage/files/patch-build_pkgs_ncurses_fbsd-patch-src_configure =================================================================== --- math/sage/files/patch-build_pkgs_ncurses_fbsd-patch-src_configure +++ math/sage/files/patch-build_pkgs_ncurses_fbsd-patch-src_configure @@ -1,14 +0,0 @@ ---- /dev/null 2014-01-29 03:00:00.000000000 +0000 -+++ build/pkgs/ncurses/fbsd-patch-src_configure 2014-01-29 03:01:19.000000000 +0000 -@@ -0,0 +1,11 @@ -+--- src/configure.orig 2013-08-21 02:51:59.000000000 +0000 -++++ src/configure 2013-08-21 02:53:23.000000000 +0000 -+@@ -5719,7 +5719,7 @@ -+ cf_cv_shared_soname='`basename $@`' -+ fi -+ -+- MK_SHARED_LIB='${LD} -shared -Bshareable -soname=`basename $@` -o $@' -++ MK_SHARED_LIB='${CC} -shared -Bshareable -Wl,-soname=`basename $@` -o $@' -+ ;; -+ netbsd*) #(vi -+ CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" Index: math/sage/files/patch-build_pkgs_numpy_fbsd-patch-src_numpy_distutils_system_info.py =================================================================== --- math/sage/files/patch-build_pkgs_numpy_fbsd-patch-src_numpy_distutils_system_info.py +++ math/sage/files/patch-build_pkgs_numpy_fbsd-patch-src_numpy_distutils_system_info.py @@ -1,16 +0,0 @@ ---- /dev/null 2014-01-29 03:00:00.000000000 +0000 -+++ build/pkgs/numpy/fbsd-patch-src_numpy_distutils_system_info.py 2014-01-29 03:01:19.000000000 +0000 -@@ -0,0 +1,13 @@ -+--- src/numpy/distutils/system_info.py.orig 2013-02-09 21:04:56.000000000 +0000 -++++ src/numpy/distutils/system_info.py 2013-05-27 21:51:12.000000000 +0000 -+@@ -983,8 +983,8 @@ -+ dir_env_var = 'ATLAS' -+ _lib_names = ['f77blas', 'cblas'] -+ if sys.platform[:7] == 'freebsd': -+- _lib_atlas = ['atlas_r'] -+- _lib_lapack = ['alapack_r'] -++ _lib_atlas = ['atlas'] -++ _lib_lapack = ['alapack'] -+ else: -+ _lib_atlas = ['atlas'] -+ _lib_lapack = ['lapack'] Index: math/sage/files/patch-build_pkgs_ppl_fbsd-patch-src_demos_ppl_lpsol_ppl_lpsol.c =================================================================== --- math/sage/files/patch-build_pkgs_ppl_fbsd-patch-src_demos_ppl_lpsol_ppl_lpsol.c +++ math/sage/files/patch-build_pkgs_ppl_fbsd-patch-src_demos_ppl_lpsol_ppl_lpsol.c @@ -1,14 +0,0 @@ ---- /dev/null 2014-01-29 03:00:00.000000000 +0000 -+++ build/pkgs/ppl/fbsd-patch-src_demos_ppl_lpsol_ppl_lpsol.c 2014-01-29 03:01:19.000000000 +0000 -@@ -0,0 +1,11 @@ -+--- src/demos/ppl_lpsol/ppl_lpsol.c.orig 2013-06-20 17:21:39.000000000 +0000 -++++ src/demos/ppl_lpsol/ppl_lpsol.c 2013-06-20 17:39:44.000000000 +0000 -+@@ -534,7 +534,7 @@ -+ if (getrlimit(RLIMIT_AS, &t) != 0) -+ fatal("getrlimit failed: %s", strerror(errno)); -+ -+- if (bytes < t.rlim_cur) { -++ if (bytes < (unsigned long)(t.rlim_cur)) { -+ t.rlim_cur = bytes; -+ if (setrlimit(RLIMIT_AS, &t) != 0) -+ fatal("setrlimit failed: %s", strerror(errno)); Index: math/sage/files/patch-build_pkgs_ppl_spkg-install =================================================================== --- math/sage/files/patch-build_pkgs_ppl_spkg-install +++ math/sage/files/patch-build_pkgs_ppl_spkg-install @@ -1,13 +0,0 @@ ---- build/pkgs/ppl/spkg-install-orig 2015-03-04 03:45:31.000000000 +0000 -+++ build/pkgs/ppl/spkg-install 2015-03-04 03:32:09.000000000 +0000 -@@ -36,6 +36,10 @@ - fi - done - -+aclocal -+automake --add-missing -+autoconf -+ - # Enable only what's needed for Sage - PPL_CONFIGURE="--enable-coefficients=mpz --disable-fpmath $PPL_CONFIGURE" - Index: math/sage/files/patch-build_pkgs_pynac_spkg-install =================================================================== --- math/sage/files/patch-build_pkgs_pynac_spkg-install +++ math/sage/files/patch-build_pkgs_pynac_spkg-install @@ -1,15 +0,0 @@ ---- build/pkgs/pynac/spkg-install.orig 2014-05-06 11:21:42.000000000 +0000 -+++ build/pkgs/pynac/spkg-install 2014-07-21 04:36:42.000000000 +0000 -@@ -31,8 +31,12 @@ - - build_pynac() - { -+ chmod -R g-w ${PYNACDIR} - cd ${PYNACDIR} - PKG_CONFIG_PATH=${SAGE_LOCAL}/lib/pkgconfig; export PKG_CONFIG_PATH -+ aclocal -+ automake --add-missing -+ autoconf - ./configure --disable-static --prefix=${SAGE_LOCAL} --libdir="$SAGE_LOCAL/lib" - $MAKE - if [ $? -ne 0 ]; then Index: math/sage/files/patch-build_pkgs_python_fbsd-patch-src_Doc-library-fcntl.rst =================================================================== --- math/sage/files/patch-build_pkgs_python_fbsd-patch-src_Doc-library-fcntl.rst +++ math/sage/files/patch-build_pkgs_python_fbsd-patch-src_Doc-library-fcntl.rst @@ -1,13 +0,0 @@ ---- /dev/null 2014-11-18 03:33:07.000000000 +0000 -+++ build/pkgs/python/fbsd-patch-src_Doc__library__fcntl.rst 2014-11-18 03:37:12.000000000 +0000 -@@ -0,0 +1,10 @@ -+--- src/./Doc/library/fcntl.rst.orig 2014-07-03 21:53:41.473098625 +1000 -++++ src/./Doc/library/fcntl.rst 2014-07-03 21:54:04.342833056 +1000 -+@@ -50,7 +50,6 @@ -+ operations are typically defined in the library module :mod:`termios` and the -+ argument handling is even more complicated. -+ -+- The op parameter is limited to values that can fit in 32-bits. -+ Additional constants of interest for use as the *op* argument can be -+ found in the :mod:`termios` module, under the same names as used in -+ the relevant C header files. Index: math/sage/files/patch-build_pkgs_python_fbsd-patch-src_Lib__distutils__unixccompiler.py =================================================================== --- math/sage/files/patch-build_pkgs_python_fbsd-patch-src_Lib__distutils__unixccompiler.py +++ math/sage/files/patch-build_pkgs_python_fbsd-patch-src_Lib__distutils__unixccompiler.py @@ -1,18 +0,0 @@ ---- /dev/null 2014-11-18 03:33:07.000000000 +0000 -+++ build/pkgs/python/fbsd-patch-src_Lib__distutils__unixccompiler.py 2014-11-18 03:37:12.000000000 +0000 -@@ -0,0 +1,15 @@ -+# Description: Some python extensions can't be compiled with clang 3.4 -+# Issue ID: http://bugs.python.org/issue20767 -+# Submitted by: antoine -+ -+--- src/./Lib/distutils/unixccompiler.py.orig 2013-11-10 07:36:40.000000000 +0000 -++++ src/./Lib/distutils/unixccompiler.py 2014-02-19 15:41:48.000000000 +0000 -+@@ -228,6 +228,8 @@ -+ if sys.platform[:6] == "darwin": -+ # MacOSX's linker doesn't understand the -R flag at all -+ return "-L" + dir -++ elif sys.platform[:7] == "freebsd": -++ return "-Wl,-rpath=" + dir -+ elif sys.platform[:5] == "hp-ux": -+ if self._is_gcc(compiler): -+ return ["-Wl,+s", "-L" + dir] Index: math/sage/files/patch-build_pkgs_python_fbsd-patch-src_Lib_distutils_command_build_scripts.py =================================================================== --- math/sage/files/patch-build_pkgs_python_fbsd-patch-src_Lib_distutils_command_build_scripts.py +++ math/sage/files/patch-build_pkgs_python_fbsd-patch-src_Lib_distutils_command_build_scripts.py @@ -1,20 +0,0 @@ ---- /dev/null 2014-11-18 03:33:07.000000000 +0000 -+++ build/pkgs/python/fbsd-patch-src_Lib_distutils_command_build_scripts.py 2014-11-18 03:37:12.000000000 +0000 -@@ -0,0 +1,17 @@ -+# Description: A non-invasive partial backport of the Python3 distutils behaviour. -+# This allows Python's scripts to be properly suffixed (similar to Python 3.x) on -+# installation. -+# Submitted by: mva -+ -+--- src/Lib/distutils/command/build_scripts.py.orig 2014-07-26 11:52:20.000000000 +0200 -++++ src/Lib/distutils/command/build_scripts.py 2014-07-26 11:52:56.000000000 +0200 -+@@ -126,6 +126,9 @@ -+ file, oldmode, newmode) -+ os.chmod(file, newmode) -+ -++ # XXX should we modify self.outfiles? -++ return outfiles -++ -+ # copy_scripts () -+ -+ # class build_scripts Index: math/sage/files/patch-build_pkgs_python_fbsd-patch-src_Makefile.pre.in =================================================================== --- math/sage/files/patch-build_pkgs_python_fbsd-patch-src_Makefile.pre.in +++ math/sage/files/patch-build_pkgs_python_fbsd-patch-src_Makefile.pre.in @@ -1,21 +0,0 @@ ---- /dev/null 2014-11-18 03:33:07.000000000 +0000 -+++ build/pkgs/python/fbsd-patch-src_Makefile.pre.in 2014-11-18 03:37:12.000000000 +0000 -@@ -0,0 +1,18 @@ -+# Description: Link scripts in the same way Python3 does -+# Submitted by: mva -+ -+--- src/Makefile.pre.in.orig 2014-06-30 04:05:39.000000000 +0200 -++++ src/Makefile.pre.in 2014-07-26 11:09:46.000000000 +0200 -+@@ -868,6 +868,12 @@ -+ (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python2.pc) -+ -rm -f $(DESTDIR)$(LIBPC)/python.pc -+ (cd $(DESTDIR)$(LIBPC); $(LN) -s python2.pc python.pc) -++ -rm -f $(DESTDIR)$(BINDIR)/idle -++ (cd $(DESTDIR)$(BINDIR); $(LN) -s idle$(VERSION) idle2) -++ -rm -f $(DESTDIR)$(BINDIR)/pydoc -++ (cd $(DESTDIR)$(BINDIR); $(LN) -s pydoc$(VERSION) pydoc2) -++ -rm -f $(DESTDIR)$(BINDIR)/2to3 -++ (cd $(DESTDIR)$(BINDIR); $(LN) -s 2to3-$(VERSION) 2to3) -+ -+ # Install the interpreter with $(VERSION) affixed -+ # This goes into $(exec_prefix) Index: math/sage/files/patch-build_pkgs_python_fbsd-patch-src_Modules-_ctypes-libffi-configure =================================================================== --- math/sage/files/patch-build_pkgs_python_fbsd-patch-src_Modules-_ctypes-libffi-configure +++ math/sage/files/patch-build_pkgs_python_fbsd-patch-src_Modules-_ctypes-libffi-configure @@ -1,25 +0,0 @@ ---- /dev/null 2014-11-18 03:33:07.000000000 +0000 -+++ build/pkgs/python/fbsd-patch-src_Modules-_ctypes-libffi-configure 2014-11-18 03:37:12.000000000 +0000 -@@ -0,0 +1,22 @@ -+--- src/Modules/_ctypes/libffi/configure.orig 2010-03-19 19:59:20.000000000 +0100 -++++ src/Modules/_ctypes/libffi/configure 2011-03-06 09:20:16.000000000 +0100 -+@@ -6289,7 +6289,7 @@ -+ rm -rf conftest* -+ ;; -+ -+-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ -++amd64-*-freebsd*|x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ -+ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) -+ # Find out which ABI we are using. -+ echo 'int i;' > conftest.$ac_ext -+@@ -11275,6 +11275,9 @@ -+ powerpc-*-freebsd*) -+ TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc -+ ;; -++ powerpc64-*-freebsd*) -++ TARGET=POWERPC; TARGETDIR=powerpc -++ ;; -+ powerpc*-*-rtems*) -+ TARGET=POWERPC; TARGETDIR=powerpc -+ ;; -+ Index: math/sage/files/patch-build_pkgs_python_fbsd-patch-src_Modules-fcntlmodule.c =================================================================== --- math/sage/files/patch-build_pkgs_python_fbsd-patch-src_Modules-fcntlmodule.c +++ math/sage/files/patch-build_pkgs_python_fbsd-patch-src_Modules-fcntlmodule.c @@ -1,56 +0,0 @@ ---- /dev/null 2014-11-18 03:33:07.000000000 +0000 -+++ build/pkgs/python/fbsd-patch-src_Modules__fcntlmodule.c 2014-11-18 03:37:12.000000000 +0000 -@@ -0,0 +1,53 @@ -+--- src/./Modules/fcntlmodule.c.orig 2014-07-03 21:57:10.429953240 +1000 -++++ src/./Modules/fcntlmodule.c 2014-07-03 21:59:36.517210444 +1000 -+@@ -98,20 +98,15 @@ -+ { -+ #define IOCTL_BUFSZ 1024 -+ int fd; -+- /* In PyArg_ParseTuple below, we use the unsigned non-checked 'I' -++ /* In PyArg_ParseTuple below, we use the unsigned non-checked 'k' -+ format for the 'code' parameter because Python turns 0x8000000 -+ into either a large positive number (PyLong or PyInt on 64-bit -+ platforms) or a negative number on others (32-bit PyInt) -+ whereas the system expects it to be a 32bit bit field value -+ regardless of it being passed as an int or unsigned long on -+- various platforms. See the termios.TIOCSWINSZ constant across -+- platforms for an example of this. -+- -+- If any of the 64bit platforms ever decide to use more than 32bits -+- in their unsigned long ioctl codes this will break and need -+- special casing based on the platform being built on. -++ various platforms. -+ */ -+- unsigned int code; -++ unsigned long code; -+ int arg; -+ int ret; -+ char *str; -+@@ -119,7 +114,7 @@ -+ int mutate_arg = 1; -+ char buf[IOCTL_BUFSZ+1]; /* argument plus NUL byte */ -+ -+- if (PyArg_ParseTuple(args, "O&Iw#|i:ioctl", -++ if (PyArg_ParseTuple(args, "O&kw#|i:ioctl", -+ conv_descriptor, &fd, &code, -+ &str, &len, &mutate_arg)) { -+ char *arg; -+@@ -170,7 +165,7 @@ -+ } -+ -+ PyErr_Clear(); -+- if (PyArg_ParseTuple(args, "O&Is#:ioctl", -++ if (PyArg_ParseTuple(args, "O&ks#:ioctl", -+ conv_descriptor, &fd, &code, &str, &len)) { -+ if (len > IOCTL_BUFSZ) { -+ PyErr_SetString(PyExc_ValueError, -+@@ -192,7 +187,7 @@ -+ PyErr_Clear(); -+ arg = 0; -+ if (!PyArg_ParseTuple(args, -+- "O&I|i;ioctl requires a file or file descriptor," -++ "O&k|i;ioctl requires a file or file descriptor," -+ " an integer and optionally an integer or buffer argument", -+ conv_descriptor, &fd, &code, &arg)) { -+ return NULL; Index: math/sage/files/patch-build_pkgs_python_fbsd-patch-src_Modules___ctypes__libffi__src__arm__ffi.c =================================================================== --- math/sage/files/patch-build_pkgs_python_fbsd-patch-src_Modules___ctypes__libffi__src__arm__ffi.c +++ math/sage/files/patch-build_pkgs_python_fbsd-patch-src_Modules___ctypes__libffi__src__arm__ffi.c @@ -1,39 +0,0 @@ ---- /dev/null 2014-11-18 03:33:07.000000000 +0000 -+++ build/pkgs/python/fbsd-patch-src_Modules___ctypes__libffi__src__arm__ffi.c 2014-11-18 03:37:12.000000000 +0000 -@@ -0,0 +1,36 @@ -+# Description: Fix _ctypes abort on import for FreeBSD/ARM. This is an issue -+# for anything !apple that is using the libcompiler_rt provided by clang on arm -+# PR: ports/149167 ports/184517 -+# Patch by: cognet@ (to be upstreamed @ LLVM) -+ -+--- src/./Modules/_ctypes/libffi/src/arm/ffi.c.orig 2013-11-10 18:36:41.000000000 +1100 -++++ src/./Modules/_ctypes/libffi/src/arm/ffi.c 2013-12-03 18:05:51.461078888 +1100 -+@@ -33,6 +33,11 @@ -+ -+ #include -+ -++#if defined(__FreeBSD__) && defined(__arm__) -++#include -++#include -++#endif -++ -+ /* Forward declares. */ -+ static int vfp_type_p (ffi_type *); -+ static void layout_vfp_args (ffi_cif *); -+@@ -582,6 +587,16 @@ -+ -+ #else -+ -++#if defined(__FreeBSD__) && defined(__arm__) -++#define __clear_cache(start, end) do { \ -++ struct arm_sync_icache_args ua; \ -++ \ -++ ua.addr = (uintptr_t)(start); \ -++ ua.len = (char *)(end) - (char *)start; \ -++ sysarch(ARM_SYNC_ICACHE, &ua); \ -++ } while (0); -++#endif -++ -+ #define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX) \ -+ ({ unsigned char *__tramp = (unsigned char*)(TRAMP); \ -+ unsigned int __fun = (unsigned int)(FUN); \ Index: math/sage/files/patch-build_pkgs_python_fbsd-patch-src_issue21166 =================================================================== --- math/sage/files/patch-build_pkgs_python_fbsd-patch-src_issue21166 +++ math/sage/files/patch-build_pkgs_python_fbsd-patch-src_issue21166 @@ -1,77 +0,0 @@ ---- /dev/null 2014-11-18 03:33:07.000000000 +0000 -+++ build/pkgs/python/fbsd-patch-src_issue21166 2014-11-18 03:37:12.000000000 +0000 -@@ -0,0 +1,74 @@ -+# HG changeset patch -+# User Ned Deily -+# Date 1408739459 25200 -+# Node ID edb6b282469ea0e8f819d0310afb2937b59dd6b9 -+# Parent 727fd4ead3fd854e900ed89362714ad1f7434e5a -+Issue #21166: Prevent possible segfaults and other random failures of -+python --generate-posix-vars in pybuilddir.txt build target by ensuring -+that pybuilddir.txt is always regenerated when configure is run and -+that the newly built skeleton python does not inadvertently import -+modules from previously installed instances. -+ -+diff --git a/Makefile.pre.in b/Makefile.pre.in -+--- src/Makefile.pre.in -++++ src/Makefile.pre.in -+@@ -447,8 +447,18 @@ platform: $(BUILDPYTHON) pybuilddir.txt -+ # Create build directory and generate the sysconfig build-time data there. -+ # pybuilddir.txt contains the name of the build dir and is used for -+ # sys.path fixup -- see Modules/getpath.c. -++# Since this step runs before shared modules are built, try to avoid bootstrap -++# problems by creating a dummy pybuildstr.txt just to allow interpreter -++# initialization to succeed. It will be overwritten by generate-posix-vars -++# or removed in case of failure. -+ pybuilddir.txt: $(BUILDPYTHON) -+- $(RUNSHARED) $(PYTHON_FOR_BUILD) -S -m sysconfig --generate-posix-vars -++ @echo "none" > ./pybuilddir.txt -++ $(RUNSHARED) $(PYTHON_FOR_BUILD) -S -m sysconfig --generate-posix-vars ;\ -++ if test $$? -ne 0 ; then \ -++ echo "generate-posix-vars failed" ; \ -++ rm -f ./pybuilddir.txt ; \ -++ exit 1 ; \ -++ fi -+ -+ # Build the shared modules -+ # Under GNU make, MAKEFLAGS are sorted and normalized; the 's' for -+diff --git a/Misc/NEWS b/Misc/NEWS -+--- src/Misc/NEWS -++++ src/Misc/NEWS -+@@ -120,6 +120,9 @@ Build -+ - Issue #15759: "make suspicious", "make linkcheck" and "make doctest" in Doc/ -+ now display special message when and only when there are failures. -+ -++- Issue #21166: Prevent possible segfaults and other random failures of -++ python --generate-posix-vars in pybuilddir.txt build target. -++ -+ Windows -+ ------- -+ -+diff --git a/configure b/configure -+--- src/configure -++++ src/configure -+@@ -2857,6 +2857,9 @@ case $host_os in *\ *) host_os=`echo "$h -+ -+ -+ -++# pybuilddir.txt will be created by --generate-posix-vars in the Makefile -++rm -f pybuilddir.txt -++ -+ if test "$cross_compiling" = yes; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python interpreter for cross build" >&5 -+ $as_echo_n "checking for python interpreter for cross build... " >&6; } -+diff --git a/configure.ac b/configure.ac -+--- src/configure.ac -++++ src/configure.ac -+@@ -16,6 +16,9 @@ AC_CANONICAL_HOST -+ AC_SUBST(build) -+ AC_SUBST(host) -+ -++# pybuilddir.txt will be created by --generate-posix-vars in the Makefile -++rm -f pybuilddir.txt -++ -+ if test "$cross_compiling" = yes; then -+ AC_MSG_CHECKING([for python interpreter for cross build]) -+ if test -z "$PYTHON_FOR_BUILD"; then -+ Index: math/sage/files/patch-build_pkgs_python_fbsd-patch-src_pr192365 =================================================================== --- math/sage/files/patch-build_pkgs_python_fbsd-patch-src_pr192365 +++ math/sage/files/patch-build_pkgs_python_fbsd-patch-src_pr192365 @@ -1,61 +0,0 @@ ---- /dev/null 2014-11-18 03:33:07.000000000 +0000 -+++ build/pkgs/python/fbsd-patch-src_pr192365 2014-11-18 03:37:12.000000000 +0000 -@@ -0,0 +1,58 @@ -+# Description: do not define __BSD_VISIBLE/_XOPEN_SOURCE/_POSIX_C_SOURCE -+# in include/python2.7/pyconfig.h -+# Submitted by: antoine -+ -+--- src/configure.orig 2014-09-06 14:42:50 UTC -++++ src/configure -+@@ -2919,13 +2919,6 @@ -+ -+ -+ # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables -+-# certain features on FreeBSD, so we need __BSD_VISIBLE to re-enable -+-# them. -+- -+-$as_echo "#define __BSD_VISIBLE 1" >>confdefs.h -+- -+- -+-# The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables -+ # u_int on Irix 5.3. Defining _BSD_TYPES brings it back. -+ -+ $as_echo "#define _BSD_TYPES 1" >>confdefs.h -+@@ -3293,9 +3286,8 @@ -+ # but used in struct sockaddr.sa_family. Reported by Tim Rice. -+ SCO_SV/3.2) -+ define_xopen_source=no;; -+- # On FreeBSD 4, the math functions C89 does not cover are never defined -+- # with _XOPEN_SOURCE and __BSD_VISIBLE does not re-enable them. -+- FreeBSD/4.*) -++ # On FreeBSD, defining _XOPEN_SOURCE to 600 requests a strict environment. -++ FreeBSD/*) -+ define_xopen_source=no;; -+ # On MacOS X 10.2, a bug in ncurses.h means that it craps out if -+ # _XOPEN_EXTENDED_SOURCE is defined. Apparently, this is fixed in 10.3, which -+--- src/configure.ac.orig 2014-09-06 14:42:50 UTC -++++ src/configure.ac -+@@ -88,11 +88,6 @@ -+ AC_DEFINE(_NETBSD_SOURCE, 1, [Define on NetBSD to activate all library features]) -+ -+ # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables -+-# certain features on FreeBSD, so we need __BSD_VISIBLE to re-enable -+-# them. -+-AC_DEFINE(__BSD_VISIBLE, 1, [Define on FreeBSD to activate all library features]) -+- -+-# The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables -+ # u_int on Irix 5.3. Defining _BSD_TYPES brings it back. -+ AC_DEFINE(_BSD_TYPES, 1, [Define on Irix to enable u_int]) -+ -+@@ -426,9 +421,8 @@ -+ # but used in struct sockaddr.sa_family. Reported by Tim Rice. -+ SCO_SV/3.2) -+ define_xopen_source=no;; -+- # On FreeBSD 4, the math functions C89 does not cover are never defined -+- # with _XOPEN_SOURCE and __BSD_VISIBLE does not re-enable them. -+- FreeBSD/4.*) -++ # On FreeBSD, defining _XOPEN_SOURCE to 600 requests a strict environment. -++ FreeBSD/*) -+ define_xopen_source=no;; -+ # On MacOS X 10.2, a bug in ncurses.h means that it craps out if -+ # _XOPEN_EXTENDED_SOURCE is defined. Apparently, this is fixed in 10.3, which Index: math/sage/files/patch-build_pkgs_python_fbsd-patch-src_setup.py =================================================================== --- math/sage/files/patch-build_pkgs_python_fbsd-patch-src_setup.py +++ math/sage/files/patch-build_pkgs_python_fbsd-patch-src_setup.py @@ -1,33 +0,0 @@ ---- /dev/null 2014-11-18 03:33:07.000000000 +0000 -+++ build/pkgs/python/fbsd-patch-src_setup.py 2014-11-18 03:37:12.000000000 +0000 -@@ -0,0 +1,30 @@ -+# Description: SEM option patch. If SEM is enabled, enable the build properly -+# Not upstreamed -+ -+--- src/setup.py.orig 2013-04-07 11:07:43.000000000 +0400 -++++ src/setup.py 2013-04-07 11:16:36.000000000 +0400 -+@@ -1551,10 +1551,22 @@ -+ macros = dict() -+ libraries = [] -+ -+- elif host_platform in ('freebsd4', 'freebsd5', 'freebsd6', 'freebsd7', 'freebsd8'): -++ elif host_platform in ('freebsd4', 'freebsd5', 'freebsd6'): -+ # FreeBSD's P1003.1b semaphore support is very experimental -+ # and has many known problems. (as of June 2008) -+- macros = dict() -++ macros = dict( # FreeBSD 4-6 -++ HAVE_SEM_OPEN=0, -++ HAVE_SEM_TIMEDWAIT=0, -++ HAVE_FD_TRANSFER=1, -++ ) -++ libraries = [] -++ -++ elif host_platform in ('freebsd7', 'freebsd8', 'freebsd9', 'freebsd10', 'freebsd11'): -++ macros = dict( # FreeBSD 7+ -++ HAVE_SEM_OPEN=1, -++ HAVE_SEM_TIMEDWAIT=1, -++ HAVE_FD_TRANSFER=1, -++ ) -+ libraries = [] -+ -+ elif host_platform.startswith('openbsd'): Index: math/sage/files/patch-build_pkgs_scons_fbsd-patch-src_engine_SCons_compat__scons_subprocess.py =================================================================== --- math/sage/files/patch-build_pkgs_scons_fbsd-patch-src_engine_SCons_compat__scons_subprocess.py +++ math/sage/files/patch-build_pkgs_scons_fbsd-patch-src_engine_SCons_compat__scons_subprocess.py @@ -1,34 +0,0 @@ ---- /dev/null 2014-02-05 05:15:00.000000000 +0000 -+++ build/pkgs/scons/fbsd-patch-src_engine_SCons_compat__scons_subprocess.py 2014-02-05 05:16:45.000000000 +0000 -@@ -0,0 +1,31 @@ -+--- src/engine/SCons/compat/_scons_subprocess.py.orig 2008-12-21 06:59:59.000000000 +0000 -++++ src/engine/SCons/compat/_scons_subprocess.py 2014-02-05 05:11:11.000000000 +0000 -+@@ -585,13 +585,19 @@ -+ class object: -+ pass -+ -++import thread -++lock = thread.allocate_lock() -++ -+ class Popen(object): -+ def __init__(self, args, bufsize=0, executable=None, -+ stdin=None, stdout=None, stderr=None, -+ preexec_fn=None, close_fds=False, shell=False, -+ cwd=None, env=None, universal_newlines=False, -+ startupinfo=None, creationflags=0): -+- """Create new Popen instance.""" -++ """Create new Popen instance. -++ Popen is not thread-safe and is therefore protected with a lock. -++ """ -++ lock.acquire() -+ _cleanup() -+ -+ self._child_created = False -+@@ -659,6 +665,7 @@ -+ self.stderr = os.fdopen(errread, 'rU', bufsize) -+ else: -+ self.stderr = os.fdopen(errread, 'rb', bufsize) -++ lock.release() -+ -+ -+ def _translate_newlines(self, data): Index: math/sage/files/patch-build_pkgs_sympow_fbsd-patch-src_disk.c =================================================================== --- math/sage/files/patch-build_pkgs_sympow_fbsd-patch-src_disk.c +++ math/sage/files/patch-build_pkgs_sympow_fbsd-patch-src_disk.c @@ -1,14 +0,0 @@ ---- /dev/null 2014-01-29 03:00:00.000000000 +0000 -+++ build/pkgs/sympow/fbsd-patch-src_disk.c 2014-01-29 03:01:19.000000000 +0000 -@@ -0,0 +1,11 @@ -+--- src/disk.c-orig 2012-04-19 02:33:51.000000000 +0000 -++++ src/disk.c 2012-04-19 02:34:22.000000000 +0000 -+@@ -39,7 +39,7 @@ -+ else if (((sp&3)==0) && CM_CASE) {if (2*ep==sp) S[3]='l'; else S[3]='h';} -+ else {if (2*ep==sp) S[3]='L'; else S[3]='H';} -+ if (HECKE && dv) {TACKS[which]=malloc(dv*sizeof(QD)); TACKON[which]=dv;} -+- else if (dv<=sp/2) TACKON[which]=0; -++ else if (dv<=sp/2) {TACKS[which]=NULL; TACKON[which]=0;} -+ else {TACKS[which]=malloc((dv-sp/2)*sizeof(QD)); TACKON[which]=dv-sp/2;} -+ S[4]=0; F=fopen("datafiles/param_data","r"); strcpy(U,S); -+ if (ANAL_RANK) {if (dv>0) U[0]='A'; else U[0]='m';} Index: math/sage/files/patch-build_pkgs_tachyon_patches_Make-arch.patch =================================================================== --- math/sage/files/patch-build_pkgs_tachyon_patches_Make-arch.patch +++ math/sage/files/patch-build_pkgs_tachyon_patches_Make-arch.patch @@ -0,0 +1,542 @@ +--- build/pkgs/tachyon/patches/Make-arch.patch.orig 2020-01-01 11:03:10 UTC ++++ build/pkgs/tachyon/patches/Make-arch.patch +@@ -10,7 +10,15 @@ + + # MPI path setup, probably shouldn't need to be changed. + MPIINC=$(MPIDIR)/include +-@@ -23,7 +24,8 @@ default: ++@@ -16,14 +17,15 @@ ++ MISCDEFS=$(USEJPEG) $(USEPNG) $(FLT) $(MBOX) ++ MISCINC=$(JPEGINC) $(PNGINC) $(SPACEBALLINC) ++ MISCFLAGS=$(MISCDEFS) $(MISCINC) ++-MISCLIB=$(JPEGLIB) $(PNGLIB) $(SPACEBALLLIB) +++MISCLIB=%%LDFLAGS%% $(JPEGLIB) $(PNGLIB) $(SPACEBALLLIB) ++ ++ default: ++ @echo " Choose one of the architectures specified below." + @echo "--------------------------------------------------------------" + @echo " Parallel Versions " + @echo "" +@@ -20,7 +28,7 @@ + @echo " aix-64-thr - IBM AIX 5.x POSIX Threads, 64-bit " + @echo " aix-mpi - IBM AIX 5.x (SP) MPI " + @echo " asci-red-mpi - Intel ASCI Red MPI " +-@@ -32,11 +34,12 @@ default: ++@@ -32,11 +34,12 @@ + @echo " cray-t3e-mpi - Cray T3E MPI " + @echo " cray-xt3-mpi - Cray XT3 MPI " + @echo " compaq-alphasc-mpi - Lemieux at PSC MPI " +@@ -34,7 +42,7 @@ + @echo " linux-alpha-ccc-qsw - Linux Alpha, Compaq C, MPI, QSWnet " + @echo " linux-lam - Linux MPI (OSC LAM) " + @echo " linux-lam-64 - Linux AMD64/EM64T, MPI, 64-bit " +-@@ -48,13 +51,14 @@ default: ++@@ -48,13 +51,14 @@ + @echo "linux-ia64-thr-sgicc - Linux IA-64, SGI Pro64 Compilers " + @echo " macosx-thr - MacOS X PowerPC, POSIX Threads " + @echo " macosx-x86-thr - MacOS X Intel x86, POSIX Threads " +@@ -56,7 +64,7 @@ + @echo "--------------------------------------------------------------" + @echo " Hybrid Parallel Versions " + @echo "" +-@@ -63,9 +67,11 @@ default: ++@@ -63,9 +67,11 @@ + @echo "--------------------------------------------------------------" + @echo " Sequential Versions " + @echo "" +@@ -70,7 +78,7 @@ + @echo " irix6 - SGI Irix 6.x " + @echo " linux - Linux " + @echo " linux-64 - Linux, AMD64/EM64T, GCC 3.x, 64-bit " +-@@ -102,7 +108,7 @@ default: ++@@ -102,7 +108,7 @@ + @echo "Consult the README file in this directory for further info. " + + ## +@@ -79,7 +87,7 @@ + ## No pthreads on ASCI Red yet. I didn't bother with the cop() stuff + ## + asci-red-mpi: +-@@ -118,7 +124,7 @@ asci-red-mpi: ++@@ -118,7 +124,7 @@ + + ## + ## IBM Blue Gene/L Parallel Supercomputer +@@ -88,7 +96,7 @@ + ## NOTE: strip breaks bluegene executables, they are dynamically re-linked + ## at runtime, so we must use /bin/true rather than strip + ## +-@@ -137,7 +143,7 @@ bluegene-mpi: ++@@ -137,7 +143,7 @@ + ## Cray Parallel Vector Processor Machines Using Threads + ## + ## Tested on J90s, but should work on almost any of the Cray PVP systems. +@@ -97,7 +105,7 @@ + ## off running on a fast workstation, or even better, on a T3E!!! + ## + cray-thr: +-@@ -228,7 +234,7 @@ cray-xt3-mpi: ++@@ -228,7 +234,7 @@ + ## + ## Architecture flags for the Intel Paragon XP/S Supercomputer using MPI + ## for message passing. NX is no longer supported by this software. +@@ -106,7 +114,7 @@ + ## Concurrent I/O is used by default. + ## + +-@@ -264,8 +270,8 @@ paragon-mpi: ++@@ -264,8 +270,8 @@ + + + ## +@@ -117,7 +125,7 @@ + ## Tested with the mpich distribution from Argonne National Labs + ## + +-@@ -277,7 +283,7 @@ ipsc860-mpi: ++@@ -277,7 +283,7 @@ + "AR = ar860" \ + "ARFLAGS = r" \ + "STRIP = strip860" \ +@@ -126,7 +134,7 @@ + + ipsc860-mpi-debug: + $(MAKE) all \ +-@@ -287,7 +293,7 @@ ipsc860-mpi-debug: ++@@ -287,7 +293,7 @@ + "AR = ar860" \ + "ARFLAGS = r" \ + "STRIP = touch " \ +@@ -135,7 +143,7 @@ + + + ## +-@@ -296,22 +302,18 @@ ipsc860-mpi-debug: ++@@ -296,22 +302,18 @@ + tru64-alpha: + $(MAKE) all \ + "ARCH = tru64-alpha" \ +@@ -159,7 +167,7 @@ + "ARFLAGS = r" \ + "STRIP = strip" \ + "LIBS = -L. -ltachyon $(MISCLIB) -lm" +-@@ -319,9 +321,7 @@ tru64-alpha-thr: ++@@ -319,9 +321,7 @@ + tru64-alpha-thr-ogl: + $(MAKE) all \ + "ARCH = tru64-alpha-thr-ogl" \ +@@ -169,7 +177,7 @@ + "ARFLAGS = r" \ + "STRIP = strip" \ + "LIBS = -L. -ltachyon $(TRU64_GLX_LIBS) $(MISCLIB) -lm" +-@@ -448,7 +448,7 @@ solaris-ultra-hpc: ++@@ -448,7 +448,7 @@ + "AR = ar" \ + "ARFLAGS = r" \ + "STRIP = strip" \ +@@ -178,7 +186,7 @@ + + solaris-mpi: + $(MAKE) all \ +-@@ -458,7 +458,7 @@ solaris-mpi: ++@@ -458,7 +458,7 @@ + "AR = ar" \ + "ARFLAGS = r" \ + "STRIP = strip" \ +@@ -187,25 +195,29 @@ + + solaris-thr: + $(MAKE) all \ +-@@ -473,9 +473,15 @@ solaris-thr: ++@@ -473,13 +473,19 @@ + solaris-pthreads-gcc: + $(MAKE) all \ + "ARCH = solaris-pthreads-gcc" \ + - "CC = gcc" \ + "CFLAGS = -Wall -O3 -fomit-frame-pointer -ffast-math -D_REENTRANT -DSunOS $(MISCFLAGS) -DTHR -DUSEPOSIXTHREADS" \ + - "AR = ar" \ +-+ "ARFLAGS = r" \ +-+ "STRIP = strip" \ +-+ "LIBS = -L. -ltachyon $(MISCLIB) -lm -lpthread" +-+ ++ "ARFLAGS = r" \ ++ "STRIP = strip" \ ++ "LIBS = -L. -ltachyon $(MISCLIB) -lm -lpthread" ++ + +solaris-pthreads-gcc-64-bit: + + $(MAKE) all \ + + "ARCH = solaris-pthreads-gcc" \ + + "CFLAGS = -Wall -O4 -m64 -fomit-frame-pointer -ffast-math -D_REENTRANT -DSunOS $(MISCFLAGS) -DTHR -DUSEPOSIXTHREADS" \ +- "ARFLAGS = r" \ +- "STRIP = strip" \ +- "LIBS = -L. -ltachyon $(MISCLIB) -lm -lpthread" +-@@ -618,7 +624,7 @@ solaris-ultra-hpc-ogl: +++ "ARFLAGS = r" \ +++ "STRIP = strip" \ +++ "LIBS = -L. -ltachyon $(MISCLIB) -lm -lpthread" +++ ++ solaris-thr-x11: ++ $(MAKE) all \ ++ "ARCH = solaris-thr-x11" \ ++@@ -618,7 +624,7 @@ + "AR = ar" \ + "ARFLAGS = r" \ + "STRIP = strip" \ +@@ -214,7 +226,7 @@ + + solaris-ultra-pthreads-ogl: + $(MAKE) all \ +-@@ -643,9 +649,7 @@ solaris-apcc-ultra-thr: ++@@ -643,9 +649,7 @@ + solaris-gcc-thr: + $(MAKE) all \ + "ARCH = solaris-gcc-thr" \ +@@ -224,7 +236,7 @@ + "ARFLAGS = r" \ + "STRIP = touch" \ + "LIBS = -L. -ltachyon $(MISCLIB) -lm -lsocket -lthread" +-@@ -653,9 +657,7 @@ solaris-gcc-thr: ++@@ -653,9 +657,7 @@ + solaris-gcc-thr-x11: + $(MAKE) all \ + "ARCH = solaris-gcc-thr-x11" \ +@@ -234,7 +246,7 @@ + "ARFLAGS = r" \ + "STRIP = touch" \ + "LIBS = -L. -ltachyon $(MISCLIB) -lm -lsocket $(X11LIB) -lthread" +-@@ -701,7 +703,7 @@ irix5-mpi: ++@@ -701,7 +703,7 @@ + "AR = ar" \ + "ARFLAGS = r" \ + "STRIP = strip" \ +@@ -243,7 +255,7 @@ + + irix5: + $(MAKE) all \ +-@@ -710,7 +712,7 @@ irix5: ++@@ -710,7 +712,7 @@ + "AR = ar" \ + "ARFLAGS = r" \ + "STRIP = strip" \ +@@ -252,7 +264,7 @@ + + irix6: + $(MAKE) all \ +-@@ -719,7 +721,7 @@ irix6: ++@@ -719,7 +721,7 @@ + "AR = ar" \ + "ARFLAGS = r" \ + "STRIP = strip" \ +@@ -261,7 +273,7 @@ + + irix6-purify: + $(MAKE) all \ +-@@ -738,7 +740,7 @@ irix6-64-thr: ++@@ -738,7 +740,7 @@ + "AR = ar" \ + "ARFLAGS = r" \ + "STRIP = strip" \ +@@ -270,7 +282,7 @@ + + irix6-thr: + $(MAKE) all \ +-@@ -747,7 +749,7 @@ irix6-thr: ++@@ -747,7 +749,7 @@ + "AR = ar" \ + "ARFLAGS = r" \ + "STRIP = strip" \ +@@ -279,7 +291,7 @@ + + irix6-thr-purify: + $(MAKE) all \ +-@@ -766,7 +768,7 @@ irix6-thr-ogl: ++@@ -766,7 +768,7 @@ + "AR = ar" \ + "ARFLAGS = r" \ + "STRIP = strip" \ +@@ -288,7 +300,7 @@ + + + ## +-@@ -776,6 +778,8 @@ irix6-thr-ogl: ++@@ -776,6 +778,8 @@ + ## available yet, since access to a thread capable test machine is needed + ## for implementation. These configurations require xlc. + ## +@@ -297,7 +309,7 @@ + + + aix: +-@@ -788,6 +792,19 @@ aix: ++@@ -788,6 +792,19 @@ + "STRIP = strip" \ + "LIBS = -L. -ltachyon $(MISCLIB) -lm" + +@@ -317,7 +329,7 @@ + aix-mpi: + $(MAKE) all \ + "ARCH = aix-mpi" \ +-@@ -808,6 +825,19 @@ aix-thr: ++@@ -808,6 +825,19 @@ + "STRIP = strip" \ + "LIBS = -L. -ltachyon $(MISCLIB) -lm -lpthread" + +@@ -337,7 +349,7 @@ + aix-64-thr: + $(MAKE) all \ + "ARCH = aix-64-thr" \ +-@@ -836,6 +866,32 @@ hpux: ++@@ -836,6 +866,32 @@ + "STRIP = strip" \ + "LIBS = -L. -ltachyon $(MISCLIB) -lm" + +@@ -370,7 +382,7 @@ + hpux-thr: + $(MAKE) all \ + "ARCH = hpux-thr" \ +-@@ -867,67 +923,57 @@ hpux-ia64-thr: ++@@ -867,67 +923,57 @@ + next: + $(MAKE) all \ + "ARCH = next" \ +@@ -391,16 +403,16 @@ + "ARFLAGS = r" \ + "STRIP = strip" \ + - "RANLIB = ranlib" \ +-+ "LIBS = -L. -ltachyon $(MISCLIB)" +-+ ++ "LIBS = -L. -ltachyon $(MISCLIB)" ++ + +macosx-64: + + $(MAKE) all \ + + "ARCH = macosx" \ + + "CFLAGS = -Os -m64 -ffast-math -DBsd $(MISCFLAGS)" \ + + "ARFLAGS = r" \ + + "STRIP = strip" \ +- "LIBS = -L. -ltachyon $(MISCLIB)" +- +++ "LIBS = -L. -ltachyon $(MISCLIB)" +++ + macosx-thr: + $(MAKE) all \ + "ARCH = macosx-thr" \ +@@ -446,7 +458,7 @@ + "LIBS = -L. -ltachyon $(MISCLIB) -lpthread -L/usr/X11R6/lib -lGLU -lGL -lX11 -framework Carbon" + + +-@@ -938,12 +984,9 @@ macosx-x86-thr-ogl: ++@@ -938,12 +984,9 @@ + beos: + $(MAKE) all \ + "ARCH = beos" \ +@@ -459,13 +471,14 @@ + "LIBS = -L. -ltachyon $(MISCLIB)" + + ## +-@@ -954,23 +997,17 @@ beos: ++@@ -954,23 +997,17 @@ + bsd: + $(MAKE) all \ + "ARCH = bsd" \ + - "CC = gcc" \ +- "CFLAGS = -O3 -fomit-frame-pointer -ffast-math -DBsd $(MISCFLAGS)" \ ++- "CFLAGS = -O3 -fomit-frame-pointer -ffast-math -DBsd $(MISCFLAGS)" \ + - "AR = ar" \ +++ "CFLAGS = %%CFLAGS%% -DBsd $(MISCFLAGS)" \ + "ARFLAGS = r" \ + "STRIP = strip" \ + - "RANLIB = ranlib" \ +@@ -475,15 +488,16 @@ + $(MAKE) all \ + "ARCH = bsd-sparc" \ + - "CC = gcc" \ +- "CFLAGS = -mv8 -msupersparc -O3 -fomit-frame-pointer -ffast-math -DBsd $(MISCFLAGS)" \ ++- "CFLAGS = -mv8 -msupersparc -O3 -fomit-frame-pointer -ffast-math -DBsd $(MISCFLAGS)" \ + - "AR = ar" \ +++ "CFLAGS = -mv8 -msupersparc %%CFLAGS%% -DBsd $(MISCFLAGS)" \ + "ARFLAGS = r" \ + "STRIP = strip" \ + - "RANLIB = ranlib" \ + "LIBS = -L. -ltachyon $(MISCLIB) -lm" + + ## +-@@ -980,23 +1017,17 @@ bsd-sparc: ++@@ -980,23 +1017,17 @@ + win32: + $(MAKE) all \ + "ARCH = win32" \ +@@ -509,7 +523,7 @@ + "LIBS = -L. -L'/Program files/MPIPro/LIB' -ltachyon -lmpi $(MISCLIB) -lm" + + ## +-@@ -1007,60 +1038,45 @@ win32-mpi: ++@@ -1007,60 +1038,45 @@ + linux: + $(MAKE) all \ + "ARCH = linux" \ +@@ -570,7 +584,7 @@ + "LIBS = -L. -ltachyon $(MISCLIB) -lm" + + +-@@ -1068,12 +1084,9 @@ linux-64-debug: ++@@ -1068,12 +1084,9 @@ + linux-64-thr: + $(MAKE) all \ + "ARCH = linux-64-thr" \ +@@ -583,7 +597,7 @@ + "LIBS = -L. -ltachyon $(MISCLIB) -lm -lpthread" + + +-@@ -1081,17 +1094,14 @@ linux-64-thr: ++@@ -1081,17 +1094,14 @@ + linux-p4: + $(MAKE) all \ + "ARCH = linux-p4" \ +@@ -603,7 +617,7 @@ + linux-p4-icc: + $(MAKE) all \ + "ARCH = linux-p4-icc" \ +-@@ -1119,23 +1129,17 @@ linux-p4-icc-thr: ++@@ -1119,23 +1129,17 @@ + linux-athlon: + $(MAKE) all \ + "ARCH = linux-athlon" \ +@@ -627,7 +641,7 @@ + "LIBS = -L. -ltachyon $(MISCLIB) -lm -lpthread" + + +-@@ -1167,21 +1171,25 @@ linux-athlon-pgcc: ++@@ -1167,21 +1171,25 @@ + linux-thr: + $(MAKE) all \ + "ARCH = linux-thr" \ +@@ -637,8 +651,8 @@ + "ARFLAGS = r" \ + "STRIP = strip" \ + - "RANLIB = ranlib" \ +-+ "LIBS = -L. -ltachyon $(MISCLIB) -lm -lpthread" +-+ ++ "LIBS = -L. -ltachyon $(MISCLIB) -lm -lpthread" ++ + +# Linux Arm using gcc, with threads + +linux-arm-thr: + + $(MAKE) all \ +@@ -646,8 +660,8 @@ + + "CFLAGS = -Wall -O3 -fomit-frame-pointer -ffast-math -DLinux -DTHR -D_REENTRANT $(MISCFLAGS)" \ + + "ARFLAGS = r" \ + + "STRIP = strip" \ +- "LIBS = -L. -ltachyon $(MISCLIB) -lm -lpthread" +- +++ "LIBS = -L. -ltachyon $(MISCLIB) -lm -lpthread" +++ + # Linux x86 using gcc, threads, and OpenGL + linux-thr-ogl: + $(MAKE) all \ +@@ -658,7 +672,7 @@ + "ARFLAGS = r" \ + "STRIP = touch" \ + "LIBS = -L. -ltachyon $(MISCLIB) $(LINUX_GLX_LIBS) $(MISCLIB) -lm -lpthread" +-@@ -1190,24 +1198,18 @@ linux-thr-ogl: ++@@ -1190,24 +1198,18 @@ + linux-beowulf-mpi-ogl: + $(MAKE) all \ + "ARCH = linux-beowulf-mpi" \ +@@ -683,7 +697,7 @@ + "LIBS = -L. -ltachyon -lmpi $(MISCLIB) -lm" + + # Linux x86 using LAM MPI +-@@ -1239,10 +1241,8 @@ linux-mpi: ++@@ -1239,10 +1241,8 @@ + "ARCH = linux-mpi" \ + "CC = mpicc" \ + "CFLAGS = -DLinux -DMPI $(MISCFLAGS)" \ +@@ -694,7 +708,7 @@ + "LIBS = -L. -ltachyon $(MISCLIB) -lm" + + linux-mpi-thr: +-@@ -1250,10 +1250,8 @@ linux-mpi-thr: ++@@ -1250,10 +1250,8 @@ + "ARCH = linux-mpi-thr" \ + "CC = mpicc" \ + "CFLAGS = -DLinux -DMPI -DTHR $(MISCFLAGS)" \ +@@ -705,7 +719,7 @@ + "LIBS = -L. -ltachyon $(MISCLIB) -lm -lpthread" + + linux-mpi-64: +-@@ -1261,10 +1259,8 @@ linux-mpi-64: ++@@ -1261,10 +1259,8 @@ + "ARCH = linux-mpi-64" \ + "CC = mpicc" \ + "CFLAGS = -Wall -O3 -fomit-frame-pointer -ffast-math -I$(LAMHOME)/h -DLinux -DMPI -DLP64 $(MISCFLAGS)" \ +@@ -716,7 +730,7 @@ + "LIBS = -L. -L$(LAMHOME)/lib -ltachyon $(MISCLIB) -lm" + + +-@@ -1297,48 +1293,36 @@ linux-lam-thr: ++@@ -1297,48 +1293,36 @@ + linux-ipaq: + $(MAKE) all \ + "ARCH = linux-ipaq" \ +@@ -768,7 +782,7 @@ + "LIBS = -L. -ltachyon $(MISCLIB) -lm" + + # Linux Alpha using Compaq's compilers +-@@ -1369,12 +1353,9 @@ linux-alpha-ccc-qsw: ++@@ -1369,12 +1353,9 @@ + linux-ia64: + $(MAKE) all \ + "ARCH = linux-ia64" \ +@@ -782,7 +796,7 @@ + "LIBS = -L. -ltachyon $(MISCLIB) -lm" + + # Linux IA-64 using SGI compilers (Merced, Itanium, McKinley, etc) +-@@ -1393,12 +1374,9 @@ linux-ia64-sgicc: ++@@ -1393,12 +1374,9 @@ + linux-ia64-thr: + $(MAKE) all \ + "ARCH = linux-ia64-thr" \ +@@ -796,7 +810,7 @@ + "LIBS = -L. -ltachyon $(MISCLIB) -lm -lpthread" + + # Linux IA-64 using SGI compilers and threads (Merced, Itanium, McKinley, etc) +-@@ -1421,9 +1399,7 @@ linux-ia64-thr-sgicc: ++@@ -1421,9 +1399,7 @@ + sgi-altix-mpi: + $(MAKE) all \ + "ARCH = sgi-altix-mpi" \ +@@ -806,7 +820,7 @@ + "ARFLAGS = r" \ + "STRIP = strip" \ + "LIBS = -ltachyon -lmpi $(MISCLIB) -lm " +-@@ -1432,7 +1408,7 @@ sgi-altix-mpi: ++@@ -1432,7 +1408,7 @@ + ## CSPI PowerPC Based Multicomputers Running VXWORKS + ## This configuration works for the machine at MPI Software Technologies + ## Uses MSTI MPI/Pro for message passing. +@@ -815,7 +829,7 @@ + cspi-ppc-mpi: + $(MAKE) all \ + "ARCH = cspi-ppc-mpi" \ +-@@ -1448,7 +1424,7 @@ cspi-ppc-mpi: ++@@ -1448,7 +1424,7 @@ + ## Mercury PowerPC Based Multicomputers Running MCOS + ## This configuration works for the machine at MPI Software Technologies + ## Uses MSTI MPI/Pro for message passing. +@@ -824,7 +838,7 @@ + mercury-ppc-mpi: + $(MAKE) all \ + "ARCH = mercury-ppc-mpi" \ +-@@ -1469,7 +1445,7 @@ mercury-ppc-mpi-rtvi: ++@@ -1469,7 +1445,7 @@ + "ARFLAGS = -r" \ + "STRIP = /bin/touch" \ + "LIBS = -L. -L/opt/MPIPro/lib ../compile/mercury-ppc-mpi-rtvi/libmgf.a ../compile/mercury-ppc-mpi-rtvi/libray.a $(RTVILIB) -lmpi.appc" +@@ -833,7 +847,7 @@ + @echo " Also, copy your machines file into your CWD." + + ## +-@@ -1490,7 +1466,7 @@ mercury-i860-rtvi: ++@@ -1490,7 +1466,7 @@ + ## Mercury i860 Based Multicomputers Running MCOS + ## This configuration works for the machine at MPI Software Technologies + ## Uses MSTI MPI/Pro for message passing. Index: math/sage/files/patch-build_pkgs_zlib_spkg-install =================================================================== --- math/sage/files/patch-build_pkgs_zlib_spkg-install +++ math/sage/files/patch-build_pkgs_zlib_spkg-install @@ -1,12 +0,0 @@ ---- build/pkgs/zlib/spkg-install-orig 2014-12-06 21:41:30.000000000 +0000 -+++ build/pkgs/zlib/spkg-install 2014-12-06 21:42:12.000000000 +0000 -@@ -1,5 +1,9 @@ - #!/usr/bin/env bash - -+# Use system zlibc because on FreeBSD the following doesn't build relocatable -+# libraries. -+exit 0 -+ - if [ -z "$SAGE_LOCAL" ]; then - echo >&2 "Error: SAGE_LOCAL undefined - exiting..." - echo >&2 "Maybe run 'sage -sh'?" Index: math/sage/files/patch-configure =================================================================== --- math/sage/files/patch-configure +++ math/sage/files/patch-configure @@ -0,0 +1,22 @@ +--- configure.orig 2020-01-01 11:04:18 UTC ++++ configure +@@ -3843,18 +3843,9 @@ please join the sage-devel discussion list - see + http://groups.google.com/group/sage-devel + The Sage community would also appreciate any patches you submit" "$LINENO" 5;; + +-*-*-freebsd*) +-as_fn_error $? " +-You are attempting to build Sage on the FreeBSD operating system, +-which is not a supported platform for Sage yet, though +-developers are working on adding FreeBSD support. Things may or +-may not work. If you would like to help port Sage to FreeBSD, +-please join the sage-devel discussion list - see +-http://groups.google.com/group/sage-devel +-The Sage community would also appreciate any patches you submit" "$LINENO" 5;; +- + # The following are all supported platforms. + *-*-linux*);; ++*-*-freebsd*);; + *-*-darwin*);; + *-*-solaris*);; + *-*-cygwin*);; Index: math/sage/files/patch-src_bin_sage-spkg =================================================================== --- math/sage/files/patch-src_bin_sage-spkg +++ math/sage/files/patch-src_bin_sage-spkg @@ -1,32 +0,0 @@ ---- src/bin/sage-spkg-orig 2014-01-29 17:26:07.000000000 +0000 -+++ src/bin/sage-spkg 2014-01-29 17:41:25.000000000 +0000 -@@ -593,6 +593,29 @@ - exit 1 - fi - -+if ls fbsd-patch-* > /dev/null 2>&1; then -+ echo "===> Applying FreeBSD patches" -+ cat fbsd-patch-* | patch -p0 || exit 1 -+ echo "===> Done applying FreeBSD patches" -+fi -+ -+# Inspired by run-autotools-fixup target in Mk/bsd.port.mk. -+# Work around an issue where FreeBSD 10.0 is detected as FreeBSD 1.x. -+for f in `find src -type f \( -name config.libpath -o \ -+ -name config.rpath -o -name configure -o -name libtool.m4 -o \ -+ -name ltconfig -o -name libtool -o -name aclocal.m4 -o \ -+ -name acinclude.m4 \)` ; do \ -+ sed -i.fbsd10bak \ -+ -e 's|freebsd1\*)|freebsd1.\*)|g' \ -+ -e 's|freebsd\[12\]\*)|freebsd[12].*)|g' \ -+ -e 's|freebsd\[123\]\*)|freebsd[123].*)|g' \ -+ -e 's|freebsd\[\[12\]\]\*)|freebsd[[12]].*)|g' \ -+ -e 's|freebsd\[\[123\]\]\*)|freebsd[[123]].*)|g' \ -+ ${f} -+ rm -f ${f}.fbsd10bak -+ echo "===> FreeBSD 10 autotools fix applied to ${f}"; \ -+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. Index: math/sage/files/patch-src_doc_common_builder.py =================================================================== --- math/sage/files/patch-src_doc_common_builder.py +++ math/sage/files/patch-src_doc_common_builder.py @@ -1,68 +0,0 @@ ---- src/doc/common/builder.py.orig 2014-05-06 11:21:42.000000000 +0000 -+++ src/doc/common/builder.py 2014-05-15 21:18:06.000000000 +0000 -@@ -281,19 +281,22 @@ - - # build the other documents in parallel - from multiprocessing import Pool -- pool = Pool(NUM_THREADS, maxtasksperchild=1) -+ # pool = Pool(NUM_THREADS, maxtasksperchild=1) - L = [(doc, name, kwds) + args for doc in others] -- # map_async handles KeyboardInterrupt correctly. Plain map and -- # apply_async does not, so don't use it. -- x = pool.map_async(build_other_doc, L, 1) -- try: -- x.get(99999) -- pool.close() -- pool.join() -- except Exception: -- pool.terminate() -- if ABORT_ON_ERROR: -- raise -+ # Pool doesn't work properly in FreeBSD. Instead: -+ for iii in L: -+ build_other_doc(iii) -+ # # map_async handles KeyboardInterrupt correctly. Plain map and -+ # # apply_async does not, so don't use it. -+ # x = pool.map_async(build_other_doc, L, 1) -+ # try: -+ # x.get(99999) -+ # pool.close() -+ # pool.join() -+ # except Exception: -+ # pool.terminate() -+ # if ABORT_ON_ERROR: -+ # raise - logger.warning("Elapsed time: %.1f seconds."%(time.time()-start)) - logger.warning("Done building the documentation!") - -@@ -479,18 +482,20 @@ - continue - output_dir = self._output_dir(format, lang) - from multiprocessing import Pool -- pool = Pool(NUM_THREADS, maxtasksperchild=1) -+ # pool = Pool(NUM_THREADS, maxtasksperchild=1) - L = [(doc, lang, format, kwds) + args for doc in self.get_all_documents(refdir)] - # (See comment in AllBuilder._wrapper about using map instead of apply.) -- x = pool.map_async(build_ref_doc, L, 1) -- try: -- x.get(99999) -- pool.close() -- pool.join() -- except Exception: -- pool.terminate() -- if ABORT_ON_ERROR: -- raise -+ for iii in L: -+ build_ref_doc(iii) -+ # x = pool.map_async(build_ref_doc, L, 1) -+ # try: -+ # x.get(99999) -+ # pool.close() -+ # pool.join() -+ # except Exception: -+ # pool.terminate() -+ # if ABORT_ON_ERROR: -+ # raise - # The html refman must be build at the end to ensure correct - # merging of indexes and inventories. - # Sphinx is run here in the current process (not in a Index: math/sage/files/patch-src_doc_common_custom-sphinx-build.py =================================================================== --- math/sage/files/patch-src_doc_common_custom-sphinx-build.py +++ math/sage/files/patch-src_doc_common_custom-sphinx-build.py @@ -1,9 +0,0 @@ ---- src/doc/common/custom-sphinx-build.py-orig 2014-05-15 19:16:13.000000000 +0000 -+++ src/doc/common/custom-sphinx-build.py 2014-05-15 19:17:11.000000000 +0000 -@@ -207,4 +207,5 @@ - if ERROR_MESSAGE and ABORT_ON_ERROR: - sys.stdout.flush() - sys.stderr.flush() -- raise OSError(ERROR_MESSAGE) -+ # Comment out next line so that warnings don't stop doc build. -+ # raise OSError(ERROR_MESSAGE) Index: math/sage/files/psutil__arch__bsd__freebsd_socks.c.patch =================================================================== --- math/sage/files/psutil__arch__bsd__freebsd_socks.c.patch +++ math/sage/files/psutil__arch__bsd__freebsd_socks.c.patch @@ -0,0 +1,86 @@ +--- a/psutil/arch/bsd/freebsd_socks.c.orig 2017-03-21 00:28:50.234080000 -0700 ++++ b/psutil/arch/bsd/freebsd_socks.c 2017-03-21 00:35:53.545508000 -0700 +@@ -112,10 +112,17 @@ + } + + ++#if __FreeBSD_version >= 1200026 ++static struct xtcpcb * ++psutil_search_tcplist(char *buf, struct kinfo_file *kif) { ++ struct xtcpcb *tp; ++ struct xinpcb *inp; ++#else + static struct tcpcb * + psutil_search_tcplist(char *buf, struct kinfo_file *kif) { + struct tcpcb *tp; + struct inpcb *inp; ++#endif + struct xinpgen *xig, *oxig; + struct xsocket *so; + +@@ -123,9 +130,15 @@ + for (xig = (struct xinpgen *)((char *)xig + xig->xig_len); + xig->xig_len > sizeof(struct xinpgen); + xig = (struct xinpgen *)((char *)xig + xig->xig_len)) { ++#if __FreeBSD_version >= 1200026 ++ tp = (struct xtcpcb *)xig; ++ inp = &tp->xt_inp; ++ so = &inp->xi_socket; ++#else + tp = &((struct xtcpcb *)xig)->xt_tp; + inp = &((struct xtcpcb *)xig)->xt_inp; + so = &((struct xtcpcb *)xig)->xt_socket; ++#endif + + if (so->so_type != kif->kf_sock_type || + so->xso_family != kif->kf_sock_domain || +@@ -208,7 +221,11 @@ + struct xinpgen *xig, *exig; + struct xinpcb *xip; + struct xtcpcb *xtp; ++#if __FreeBSD_version >= 1200026 ++ struct xinpcb *inp; ++#else + struct inpcb *inp; ++#endif + struct xsocket *so; + const char *varname = NULL; + size_t len, bufsize; +@@ -273,8 +290,13 @@ + goto error; + } + inp = &xtp->xt_inp; ++#if __FreeBSD_version >= 1200026 ++ so = &inp->xi_socket; ++ status = xtp->t_state; ++#else + so = &xtp->xt_socket; + status = xtp->xt_tp.t_state; ++#endif + break; + case IPPROTO_UDP: + xip = (struct xinpcb *)xig; +@@ -283,7 +305,11 @@ + "struct xinpcb size mismatch"); + goto error; + } ++#if __FreeBSD_version >= 1200026 ++ inp = xip; ++#else + inp = &xip->xi_inp; ++#endif + so = &xip->xi_socket; + status = PSUTIL_CONN_NONE; + break; +@@ -477,7 +503,11 @@ + struct kinfo_file *freep = NULL; + struct kinfo_file *kif; + char *tcplist = NULL; ++#if __FreeBSD_version >= 1200026 ++ struct xtcpcb *tcp; ++#else + struct tcpcb *tcp; ++#endif + + PyObject *py_retlist = PyList_New(0); + PyObject *py_tuple = NULL; Index: math/sage/pkg-plist =================================================================== --- math/sage/pkg-plist +++ math/sage/pkg-plist @@ -0,0 +1 @@ +@comment TODO, depending where we choose to install.