Changeset View
Changeset View
Standalone View
Standalone View
math/sage/Makefile
Context not available. | |||||
# $FreeBSD$ | # $FreeBSD$ | ||||
PORTNAME= sage | PORTNAME= sage | ||||
PORTVERSION= 6.7 | PORTVERSION= 9.0 | ||||
PORTREVISION= 8 | |||||
CATEGORIES= math | CATEGORIES= math | ||||
MASTER_SITES= http://boxen.math.washington.edu/home/sagemath/sage-mirror/src/ \ | MASTER_SITES= http://boxen.math.washington.edu/home/sagemath/sage-mirror/src/ \ | ||||
http://mirrors.xmission.com/sage/src/ \ | http://mirrors.xmission.com/sage/src/ \ | ||||
Context not available. | |||||
MAINTAINER= stephen@FreeBSD.org | MAINTAINER= stephen@FreeBSD.org | ||||
COMMENT= Open source Mathematics software | COMMENT= Open source Mathematics software | ||||
BROKEN= unfetchable | |||||
LICENSE= GPLv3 | LICENSE= GPLv3 | ||||
LICENSE_FILE= ${WRKSRC}/COPYING.txt | LICENSE_FILE= ${WRKSRC}/COPYING.txt | ||||
BUILD_DEPENDS= bash:shells/bash \ | BUILD_DEPENDS= bash:shells/bash \ | ||||
convert:graphics/ImageMagick6 \ | dash:shells/dash \ | ||||
ffmpeg:multimedia/ffmpeg \ | rw:sysutils/rw \ | ||||
automake:devel/automake \ | cmake:devel/cmake \ | ||||
autoconf:devel/autoconf | ninja:devel/ninja \ | ||||
LIB_DEPENDS= libatlas.so:math/atlas \ | gpatch:devel/patch \ | ||||
liblapack.so:math/lapack | cython:lang/cython \ | ||||
RUN_DEPENDS= bash:shells/bash | 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: | # openmp is needed but USES=compiler:openmp is broken (forces GCC) | ||||
@${ECHO_MSG} | USES= blaslapack:openblas compiler:c++11-lang desktop-file-utils fortran \ | ||||
@${ECHO_MSG} Instead of installing the port, which will take a considerable amount of | gettext-runtime gmake gnome iconv jpeg libtool localbase ncurses perl5 \ | ||||
@${ECHO_MSG} extra time and space, you can instead type \"make build\". Then you can move | pkgconfig python:3.6+ readline shared-mime-info shebangfix 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 | LDFLAGS+= -L${LOCALBASE}/llvm${COMPILER_VERSION}/lib | ||||
CFLAGS:= ${CFLAGS:C/^-O.*$//} | LIBS= -lomp -pthread | ||||
FFLAGS:= ${CFLAGS:C/^-O.*$//} | 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 \ | .include <bsd.port.pre.mk> | ||||
SAGE_ATLAS_LIB=${LOCALBASE}/lib \ | |||||
DOT_SAGE=${WRKSRC}/tmp/.sage \ | |||||
SAGE_FAT_BINARY=yes \ | |||||
PERL=${PERL} | |||||
# The following is needed for the lapack subpackage. | WSDIR= ${STAGEDIR}${PREFIX} | ||||
MAKE_ARGS+= ARCH="${AR}" | 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: | post-patch: | ||||
# Create wrapper for invocation of make. | ${CP} ${FILESDIR}/psutil__arch__bsd__freebsd_socks.c.patch \ | ||||
@${MKDIR} ${WRKSRC}/local/bin | ${WRKSRC}/build/pkgs/psutil/patches/ | ||||
@${LN} -s -f ${LOCALBASE}/bin/gmake ${WRKSRC}/local/bin/make | |||||
# Create wrapper for invocation of ld. | pre-configure: | ||||
@${SED} -e 's#%%LD%%#${LOCALBASE}/bin/ld#' \ | ${REINPLACE_CMD} -e 's|SAGE_LOCAL="$$prefix"|SAGE_LOCAL="${WSDIR}"|' \ | ||||
${FILESDIR}/ld.in > ${WRKSRC}/local/bin/ld | ${WRKSRC}/${CONFIGURE_SCRIPT} | ||||
@${CHMOD} +x ${WRKSRC}/local/bin/ld | ${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: | post-stage: | ||||
${RM} -r ${WRKSRC}/tmp/.sage | .for f in ${BASH2FIX} | ||||
${CHMOD} -R a+rX ${WRKSRC} | ${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 <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. |