2013-12-28 10:28:40 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
# Use the Comprehensive R Archive Network
|
|
|
|
#
|
|
|
|
# Feature: cran
|
|
|
|
# Usage: USES=cran or USES=cran:ARGS
|
2016-06-18 17:46:30 +00:00
|
|
|
# Valid ARGS: auto-plist, compiles
|
2013-12-28 10:28:40 +00:00
|
|
|
#
|
2016-06-18 17:46:30 +00:00
|
|
|
# auto-plist The pkg-plist is to be automatically generated
|
|
|
|
# compiles The port has code that needs to be compiled
|
2014-03-15 10:31:54 +00:00
|
|
|
#
|
2016-08-26 20:30:18 +00:00
|
|
|
# MAINTAINER= dbn@FreeBSD.org
|
2013-12-28 10:28:40 +00:00
|
|
|
|
|
|
|
.if !defined(_INCLUDE_USES_CRAN_MK)
|
|
|
|
_INCLUDE_USES_CRAN_MK= yes
|
|
|
|
|
2016-10-25 17:04:38 +00:00
|
|
|
MASTER_SITES?= CRAN/src/contrib CRAN_ARCHIVE/src/contrib
|
2013-12-28 10:28:40 +00:00
|
|
|
|
2016-03-27 01:23:25 +00:00
|
|
|
BUILD_DEPENDS+= ${LOCALBASE}/bin/R:math/R
|
|
|
|
RUN_DEPENDS+= ${LOCALBASE}/bin/R:math/R
|
2013-12-28 10:28:40 +00:00
|
|
|
|
|
|
|
PKGNAMEPREFIX?= R-cran-
|
|
|
|
|
|
|
|
R_LIB_DIR= lib/R/library
|
|
|
|
R_MOD_DIR?= ${R_LIB_DIR}/${PORTNAME}
|
|
|
|
PLIST_SUB+= R_MOD_DIR=${R_MOD_DIR}
|
|
|
|
WRKSRC?= ${WRKDIR}/${PORTNAME}
|
|
|
|
|
|
|
|
NO_BUILD= yes
|
|
|
|
R_COMMAND= ${LOCALBASE}/bin/R
|
|
|
|
|
Implemented complete support for test target.
You can now `make test' on any port to run test sequence, no-op by default.
If a port defines TEST_TARGET, it'll run sub-make with specified target,
usually `check' or `test', useful if upstream supports that. The port may
instead define custom do-test target, as well as usual satellite targets:
{pre,do,post}-test, {pre,do,post}-test-OPT, {pre,do,post}-test-OPT-off
`make test' builds and stages port first, so test may use both WRKDIR and
STAGEDIR, and both BUILD and RUN depends are available for test target.
Additionally, TEST_DEPENDS is now properly supported and may be used to
define additional depends specifically for testing.
Framework may define default tests for specific cases. For instance,
perl5.mk and cran.mk already provide default test target on their own.
This commit also converts my ports which have tests to this new framework.
Approved by: portmgr (bapt)
Differential Revision: D3680
2015-09-28 17:20:42 +00:00
|
|
|
.if !target(do-test)
|
2013-12-28 10:28:40 +00:00
|
|
|
R_POSTCMD_CHECK_OPTIONS?= --timings
|
|
|
|
|
|
|
|
.if !exists(${LOCALBASE}/bin/pdflatex)
|
2016-02-13 14:41:46 +00:00
|
|
|
R_POSTCMD_CHECK_OPTIONS+= --no-manual --no-build-vignettes
|
2013-12-28 10:28:40 +00:00
|
|
|
.endif
|
|
|
|
|
Implemented complete support for test target.
You can now `make test' on any port to run test sequence, no-op by default.
If a port defines TEST_TARGET, it'll run sub-make with specified target,
usually `check' or `test', useful if upstream supports that. The port may
instead define custom do-test target, as well as usual satellite targets:
{pre,do,post}-test, {pre,do,post}-test-OPT, {pre,do,post}-test-OPT-off
`make test' builds and stages port first, so test may use both WRKDIR and
STAGEDIR, and both BUILD and RUN depends are available for test target.
Additionally, TEST_DEPENDS is now properly supported and may be used to
define additional depends specifically for testing.
Framework may define default tests for specific cases. For instance,
perl5.mk and cran.mk already provide default test target on their own.
This commit also converts my ports which have tests to this new framework.
Approved by: portmgr (bapt)
Differential Revision: D3680
2015-09-28 17:20:42 +00:00
|
|
|
do-test:
|
2016-08-26 20:30:18 +00:00
|
|
|
@${FIND} ${WRKSRC} \( -name '*.o' -o -name '*.so' \) -delete
|
2013-12-28 10:28:40 +00:00
|
|
|
@cd ${WRKDIR} ; ${SETENV} ${MAKE_ENV} _R_CHECK_FORCE_SUGGESTS_=FALSE \
|
|
|
|
${R_COMMAND} ${R_PRECMD_CHECK_OPTIONS} CMD check \
|
|
|
|
${R_POSTCMD_CHECK_OPTIONS} ${PORTNAME}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !target(do-install)
|
|
|
|
R_POSTCMD_INSTALL_OPTIONS+= -l ${STAGEDIR}${PREFIX}/${R_LIB_DIR}
|
|
|
|
R_POSTCMD_INSTALL_OPTIONS+= --install-tests
|
|
|
|
|
|
|
|
.if defined(NOPORTDOCS)
|
|
|
|
R_POSTCMD_INSTALL_OPTIONS+= --no-docs --no-html
|
|
|
|
.endif
|
|
|
|
|
|
|
|
do-install:
|
|
|
|
@${MKDIR} ${STAGEDIR}${PREFIX}/${R_LIB_DIR}
|
|
|
|
@cd ${WRKDIR} ; ${SETENV} ${MAKE_ENV} ${R_COMMAND} \
|
|
|
|
${R_PRECMD_INSTALL_OPTIONS} CMD INSTALL \
|
|
|
|
${R_POSTCMD_INSTALL_OPTIONS} ${PORTNAME}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if ${cran_ARGS:Mauto-plist}
|
Rewrite the target ordering code.
The targets now have priority assigned to them, and, when the dependency
ordering magic is done at the end of bsd.port.mk, they are sorted
according to their priority.
This allows USES to add targets easily and have them run whenever they
want without touching bsd.port.mk.
To add a target that runs just before post-configure run, do:
_USES_configure+= 695:my-post-configure
my-post-configure:
do something
To fine tune when the target is ran, look at the values in the *_SEQ
variables at the end of bsd.port.mk, and the other USES.
Allow ports Makefiles to override the priority of targets with the
TARGET_ORDER_OVERRIDE variable. For example, to get post-install
running earlier, (its default is 700) do:
TARGET_ORDER_OVERRIDE= 650:post-install
While there, add options target helpers for the do-* targets when they
exist.
Reviewed by: antoine, bapt
Exp-run by: antoine
Sponsored by: Absolight
Differential Revision: https://reviews.freebsd.org/D3099
2015-08-17 13:31:25 +00:00
|
|
|
_USES_install+= 750:cran-auto-plist
|
|
|
|
cran-auto-plist:
|
2013-12-28 10:28:40 +00:00
|
|
|
@${FIND} -ds ${STAGEDIR}${PREFIX}/${R_MOD_DIR} \( -type f -or -type l \) -print | \
|
|
|
|
${SED} -E -e 's,^${STAGEDIR}${PREFIX}/?,,' >> ${TMPPLIST}
|
|
|
|
.endif
|
|
|
|
|
2016-06-18 17:46:30 +00:00
|
|
|
.if ${cran_ARGS:Mcompiles}
|
2016-08-17 15:42:23 +00:00
|
|
|
_USES_install+= 755:cran-strip
|
|
|
|
cran-strip:
|
|
|
|
${FIND} ${STAGEDIR}${PREFIX}/${R_MOD_DIR} -name '*.so' -exec ${STRIP_CMD} {} +
|
2016-06-18 17:46:30 +00:00
|
|
|
.include "${PORTSDIR}/math/R/compiler.mk"
|
2016-08-17 15:42:23 +00:00
|
|
|
.include "${USESDIR}/fortran.mk"
|
2016-06-18 17:46:30 +00:00
|
|
|
.endif
|
|
|
|
|
2013-12-28 10:28:40 +00:00
|
|
|
.endif #_INCLUDE_USES_CRAN_MK
|