Changeset View
Changeset View
Standalone View
Standalone View
math/sage/Makefile
Context not available. | |||||
# $FreeBSD$ | # $FreeBSD$ | ||||
PORTNAME= sage | PORTNAME= sage | ||||
PORTVERSION= 6.7 | DISTVERSION= 9.1.rc4 | ||||
PORTREVISION= 8 | |||||
CATEGORIES= math | CATEGORIES= math | ||||
MASTER_SITES= http://boxen.math.washington.edu/home/sagemath/sage-mirror/src/ \ | MASTER_SITES= http://www.cecm.sfu.ca/sage/devel/ | ||||
http://mirrors.xmission.com/sage/src/ \ | |||||
http://www-ftp.lip6.fr/pub/math/sagemath/src/ \ | |||||
http://mirrors.mit.edu/sage/src/ \ | |||||
http://www.sagemath.org/src-old/ | |||||
PKGNAMESUFFIX= -math | |||||
MAINTAINER= stephen@FreeBSD.org | MAINTAINER= stephen@FreeBSD.org | ||||
COMMENT= Open source Mathematics software | COMMENT= Open source Mathematics software | ||||
BROKEN= unfetchable | |||||
DEPRECATED= Broken for more than 6 months | |||||
EXPIRATION_DATE= 2020-06-05 | |||||
LICENSE= GPLv3 | LICENSE= GPLv3 | ||||
LICENSE_FILE= ${WRKSRC}/COPYING.txt | LICENSE_FILE= ${WRKSRC}/COPYING.txt | ||||
BUILD_DEPENDS= bash:shells/bash \ | # Please keep the same order of DEPENDS as in #27330 | ||||
convert:graphics/ImageMagick6 \ | # https://trac.sagemath.org/ticket/27330 | ||||
ffmpeg:multimedia/ffmpeg \ | BUILD_DEPENDS= bash:shells/bash \ | ||||
automake:devel/automake \ | dash:shells/dash \ | ||||
autoconf:devel/autoconf | cmake:devel/cmake \ | ||||
LIB_DEPENDS= libatlas.so:math/atlas \ | ${PYTHON_PKGNAMEPREFIX}brial>0:math/py-brial@${PY_FLAVOR}\ | ||||
liblapack.so:math/lapack | ${PYTHON_PKGNAMEPREFIX}cvxopt>0:math/py-cvxopt@${PY_FLAVOR}\ | ||||
RUN_DEPENDS= bash:shells/bash | fflas-ffpack-config:math/fflas-ffpack \ | ||||
QuadraticSieve:math/flintqs \ | |||||
gfan:math/gfan \ | |||||
git:devel/git \ | |||||
gp2c:math/gp2c \ | |||||
libatomic_ops>0:devel/libatomic_ops \ | |||||
dreadnaut:math/nauty \ | |||||
p5-XML-Writer>0:textproc/p5-XML-Writer \ | |||||
p5-XML-LibXML>0:textproc/p5-XML-LibXML \ | |||||
p5-XML-LibXSLT>0:textproc/p5-XML-LibXSLT\ | |||||
p5-File-Slurp>0:devel/p5-File-Slurp \ | |||||
p5-JSON>0:converters/p5-JSON \ | |||||
p5-SVG>0:textproc/p5-SVG \ | |||||
p5-MongoDB>0:databases/p5-MongoDB \ | |||||
p5-Term-ReadLine-Gnu>0:devel/p5-Term-ReadLine-Gnu\ | |||||
pandoc:textproc/hs-pandoc \ | |||||
pari-elldata>0:math/pari_elldata\ | |||||
pari-galdata>0:math/pari_galdata\ | |||||
pari-galpol>0:math/pari_galpol \ | |||||
pari-nftables>0:math/pari_nftables \ | |||||
pari-seadata>0:math/pari_seadata\ | |||||
ninja:devel/ninja \ | |||||
gpatch:devel/patch \ | |||||
tachyon:graphics/tachyon \ | |||||
cython:lang/cython \ | |||||
yasm:devel/yasm \ | |||||
gtar:archivers/gtar \ | |||||
convert:graphics/ImageMagick6 \ | |||||
ffmpeg:multimedia/ffmpeg \ | |||||
${LOCALBASE}/lib/libBLT.a:x11-toolkits/blt | |||||
LIB_DEPENDS= libarb.so:math/arb \ | |||||
libboost_thread.so:devel/boost-libs \ | |||||
libbraiding.so:math/libbraiding \ | |||||
libbrial.so:math/brial \ | |||||
libCbc.so:math/cbc \ | |||||
libcdd.so:math/cddlib \ | |||||
libcliquer.so:math/cliquer \ | |||||
libcurl.so:ftp/curl \ | |||||
libec.so:math/eclib \ | |||||
libecm.so:math/gmp-ecm \ | |||||
libflint.so:math/flint2 \ | |||||
libfplll.so:math/fplll \ | |||||
libfreetype.so:print/freetype2 \ | |||||
libgc.so:devel/boehm-gc \ | |||||
libgc-threaded.so:devel/boehm-gc-threaded\ | |||||
libgf2x.so:math/gf2x \ | |||||
libgivaro.so:math/givaro \ | |||||
libglpk.so:math/glpk \ | |||||
libgap.so:math/gap \ | |||||
libgmp.so:math/gmp \ | |||||
libgsl.so:math/gsl \ | |||||
libhomfly.so:math/libhomfly \ | |||||
libiml.so:math/iml \ | |||||
libisl.so:devel/isl \ | |||||
libLfunction.so:math/lcalc \ | |||||
libffi.so:devel/libffi \ | |||||
libgd.so:graphics/gd \ | |||||
libgiac.so:math/giacxcas \ | |||||
liblinbox.so:math/linbox \ | |||||
liblrcalc.so:math/lrcalc \ | |||||
liblrsgmp.so:math/lrslib \ | |||||
libm4ri.so:math/m4ri \ | |||||
libm4rie.so:math/m4rie \ | |||||
libmpc.so:math/mpc \ | |||||
libmpfi.so:math/mpfi \ | |||||
libmpfr.so:math/mpfr \ | |||||
libmpir.so:math/mpir \ | |||||
libntl.so:math/ntl \ | |||||
libpari.so:math/pari \ | |||||
libpcre.so:devel/pcre \ | |||||
libplanarity.so:math/planarity \ | |||||
libpng.so:graphics/png \ | |||||
libppl.so:devel/ppl \ | |||||
libpynac.so:math/pynac \ | |||||
libR.so:math/R \ | |||||
librw.so:math/rankwidth \ | |||||
libSingular.so:math/singular \ | |||||
libamd.so:math/suitesparse \ | |||||
libsemigroups.so:math/libsemigroups \ | |||||
libsymmetrica.so:math/symmetrica\ | |||||
libzmq.so:net/libzmq4 \ | |||||
libzn_poly-0.9.so:math/zn_poly \ | |||||
libqd.so:math/qd \ | |||||
libisl.so:devel/isl \ | |||||
libblas.so:math/blas \ | |||||
libicuuc.so:devel/icu \ | |||||
libtiff.so:graphics/tiff \ | |||||
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 \ | |||||
libopenjp2.so:graphics/openjpeg | |||||
RUN_DEPENDS= bash:shells/bash \ | |||||
${PYTHON_PKGNAMEPREFIX}brial>0:math/py-brial@${PY_FLAVOR}\ | |||||
${PYTHON_PKGNAMEPREFIX}cvxopt>0:math/py-cvxopt@${PY_FLAVOR}\ | |||||
gfan:math/gfan \ | |||||
git:devel/git \ | |||||
gp2c:math/gp2c \ | |||||
dreadnaut:math/nauty \ | |||||
QuadraticSieve:math/flintqs \ | |||||
pari-elldata>0:math/pari_elldata\ | |||||
pari-galdata>0:math/pari_galdata\ | |||||
pari-galpol>0:math/pari_galpol \ | |||||
pari-nftables>0:math/pari_nftables \ | |||||
pari-seadata>0:math/pari_seadata\ | |||||
p5-Term-ReadLine-Gnu>0:devel/p5-Term-ReadLine-Gnu\ | |||||
tachyon:graphics/tachyon \ | |||||
yasm:devel/yasm \ | |||||
pixz:archivers/pixz | |||||
pre-extract: | USES= autoreconf blaslapack:openblas compiler:c++11-lib fortran \ | ||||
@${ECHO_MSG} | gettext-runtime gmake gnome iconv jpeg libtool localbase \ | ||||
@${ECHO_MSG} Instead of installing the port, which will take a considerable amount of | ncurses perl5 pkgconfig python:3.6+ readline shared-mime-info \ | ||||
@${ECHO_MSG} extra time and space, you can instead type \"make build\". Then you can move | shebangfix sqlite ssl tk xorg | ||||
@${ECHO_MSG} work/${PORTNAME}-${PORTVERSION} to wherever you like, and run sage from there. | USE_TEX= latex:build pdftex:build tex:build | ||||
@${ECHO_MSG} However, there is no guarantee that this alternative will always work. | USE_XORG= x11 xext xscrnsaver | ||||
. if !(defined(PACKAGE_BUILDING) || defined(BATCH)) | USE_GNOME= cairo glib20 pango | ||||
@sleep 10 | |||||
. endif | |||||
PLIST_FILES= bin/sage | SHEBANG_FILES= . | ||||
USE_TEX= latex:build | SHEBANG_LANG+= dash | ||||
USES= gmake iconv jpeg tk perl5 | dash_OLD_CMD= /bin/dash | ||||
dash_CMD= ${LOCALBASE}/bin/dash | |||||
# Optimization flags will be defined by the source | DISABLE_BINUTILS= yes | ||||
CFLAGS:= ${CFLAGS:C/^-O.*$//} | |||||
FFLAGS:= ${CFLAGS:C/^-O.*$//} | |||||
MAKE_ENV+= SAGE_PORT=yes \ | LIBS= -lomp -pthread | ||||
SAGE_ATLAS_LIB=${LOCALBASE}/lib \ | GNU_CONFIGURE= yes | ||||
DOT_SAGE=${WRKSRC}/tmp/.sage \ | CONFIGURE_ENV= SAGE_PORT=yes CC=${CC} GCC=${CC} CXX=${CXX} AS=${AS} LD=${LD} \ | ||||
SAGE_FAT_BINARY=yes \ | SAGE_LOCAL=${PREFIX} SAGE_DESTDIR=${STAGEDIR}/ \ | ||||
PERL=${PERL} | DESTDIR=${STAGEDIR}/${PREFIX} PATCH=${LOCALBASE}/bin/gpatch | ||||
CONFIGURE_ARGS= --with-system-gcc=force \ | |||||
--with-system-python3=yes \ | |||||
--localstatedir=/var | |||||
MAKE_ENV= MAKE=${GMAKE} DESTDIR=${STAGEDIR} | |||||
REINPLACE_ARGS= -i '' | |||||
BINARY_ALIAS= patch=${LOCALBASE}/bin/gpatch | |||||
# The following is needed for the lapack subpackage. | .include <bsd.port.pre.mk> | ||||
MAKE_ARGS+= ARCH="${AR}" | |||||
post-patch: | WSDIR= ${STAGEDIR}${PREFIX} | ||||
# Create wrapper for invocation of make. | SPKG_INST= configure.ac configure build/sage_bootstrap/uninstall.py \ | ||||
@${MKDIR} ${WRKSRC}/local/bin | build/make/install src/bin/sage-env | ||||
@${LN} -s -f ${LOCALBASE}/bin/gmake ${WRKSRC}/local/bin/make | BASH2FIX= lib/${PYTHON_VERSION}/site-packages/bleach/_vendor/pip_install_vendor.sh | ||||
PY2FIX= bin lib/${PYTHON_VERSION} | |||||
DOC2FIX= .pickle .doctree | |||||
# External dependencies not yet handled by SageMath | |||||
SPKGCM4= brial cvxopt gap gc giac libhomfly linbox pynac singular suitesparse zn_poly | |||||
SE2FIX= ^SINGULAR | |||||
SHR2FIX= SINGULARPATH GAP_ROOT_DIR | |||||
# Create wrapper for invocation of ld. | # Problem with ECL and Maxima, waiting for https://trac.sagemath.org/ticket/29617 | ||||
@${SED} -e 's#%%LD%%#${LOCALBASE}/bin/ld#' \ | CONFLICTS= ecl-16.* maxima-5.43.* | ||||
${FILESDIR}/ld.in > ${WRKSRC}/local/bin/ld | #SPKGCM4+= ecl maxima | ||||
@${CHMOD} +x ${WRKSRC}/local/bin/ld | #SE2FIX+= MAXIMA_PREFIX ^ECLDIR= | ||||
#LIB_DEPENDS+= libecl.so:lang/ecl | |||||
#BUILD_DEPENDS+= maxima:math/maxima | |||||
#RUN_DEPENDS+= maxima:math/maxima | |||||
post-build: | post-patch: | ||||
${RM} -r ${WRKSRC}/tmp/.sage | ${CP} ${FILESDIR}/psutil__arch__bsd__freebsd_socks.c.patch \ | ||||
${CHMOD} -R a+rX ${WRKSRC} | ${WRKSRC}/build/pkgs/psutil/patches/ | ||||
.for sp in ${SPKGCM4} | |||||
${CP} ${FILESDIR}/${sp}_spkg-configure.m4 \ | |||||
${WRKSRC}/build/pkgs/${sp}/spkg-configure.m4 | |||||
.endfor | |||||
check regression-test test: build | pre-configure: | ||||
@${ECHO_MSG} This test can also be performed after installation by typing \"sage -testall\". | ${REINPLACE_CMD} -e 's|SAGE_LOCAL="$$prefix"|SAGE_LOCAL="${WSDIR}"|' \ | ||||
@${ECHO_MSG} | -e 's|lib/pkgconfig|libdata/pkgconfig|' ${WRKSRC}/configure.ac | ||||
cd ${WRKSRC} && ${SETENV} DOT_SAGE=${WRKSRC}/tmp/.sage ./sage -testall | ${REINPLACE_CMD} -e 's|SAGE_LOCAL="@prefix@"|SAGE_LOCAL="${WSDIR}"|' \ | ||||
${RM} ${WRKSRC}/python*.core | ${WRKSRC}/src/bin/sage-env-config.in | ||||
${REINPLACE_CMD} -e 's|%%CFLAGS%%|${CFLAGS}|;s|%%LDFLAGS%%|${LDFLAGS}|' \ | |||||
${WRKSRC}/build/pkgs/tachyon/patches/Make-arch.patch | |||||
${REINPLACE_CMD} -e '/SUITESPARSE_INC_DIR/s|$${SAGE_LOCAL}/include|${LOCALBASE}/include/suitesparse|'\ | |||||
${WRKSRC}/build/pkgs/cvxopt/spkg-install.in | |||||
${REINPLACE_CMD} -e 's|python3|${PYTHON_CMD}|' \ | |||||
${WRKSRC}/build/pkgs/cvxopt/spkg-configure.m4 | |||||
${REINPLACE_CMD} -e '/GAP_ROOT=/s|$$SAGE_LOCAL|${LOCALBASE}|' \ | |||||
${WRKSRC}/build/pkgs/gap_packages/spkg-install.in | |||||
${REINPLACE_CMD} -e "/os.path.join/s|SAGE_LOCAL|'${LOCALBASE}'|"\ | |||||
${WRKSRC}/src/sage/libs/gap/util.pyx | |||||
#${REINPLACE_CMD} -e '/export PYTHONPATH/s|$$SAGE_LOCAL|$$SAGE_LOCAL:${STAGEDIR}${PYTHON_SITELIBDIR:${PYTHON_SITELIBDIR}|'\ | |||||
# ${WRKSRC}/build/make/install | |||||
.for f in ${SHR2FIX} | |||||
${REINPLACE_CMD} -e "/${f}/s|SAGE_SHARE|'${LOCALBASE}/share/'|" \ | |||||
${WRKSRC}/src/sage/env.py | |||||
.endfor | |||||
.for f in ${SE2FIX} | |||||
${REINPLACE_CMD} -e '/${f}/s|$$SAGE_LOCAL|${LOCALBASE}|' \ | |||||
${WRKSRC}/src/bin/sage-env | |||||
.endfor | |||||
.for f in ${SPKG_INST} | |||||
${REINPLACE_CMD} -e 's|/var/lib/sage|/share/libdata/${PORTNAME}|' \ | |||||
${WRKSRC}/${f} | |||||
.endfor | |||||
(cd ${WRKSRC} && ./bootstrap) | |||||
${MKDIR} ${STAGEDIR}${PREFIX}/lib/pkgconfig # Removed thereafter | |||||
# Don't build docs (because of mysterious race conditions). | post-stage: | ||||
ALL_TARGET= build | .for f in ${BASH2FIX} | ||||
${SED} -i "" -e 's|/bin/bash|${LOCALBASE}/bin/bash|' ${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 | |||||
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 <bsd.port.pre.mk> | |||||
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 <bsd.port.post.mk> | .include <bsd.port.post.mk> | ||||
Context not available. |