blob: 79affc197918c1c5ff81f5ae56bc27b8ac886fdd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
# $NetBSD: Makefile.extension,v 1.26 2019/11/02 16:16:18 rillig Exp $
#
# This Makefile fragment is included by packages for R library packages.
#
# To use this Makefile fragment, simply:
#
# (1) define R_PKGNAME and R_PKGVER to the R package name and version
# for the package desired.
# (2) Include this Makefile fragment in the package Makefile
_VARGROUPS+= R
_PKG_VARS.R= R_PKGNAME R_PKGVER R_INST_DIRS
_USE_VARS.R= DISTNAME
_DEF_VARS.R= PKGNAME DIST_SUBDIR CATEGORIES HOMEPAGE \
INSTALL_TEMPLATES DEINSTALL_TEMPLATES
_IGN_VARS.R= INSTALLATION_DIRS MAKE_ENV INSTALL_ENV MASTER_SITES \
MASTER_SITE_R_CRAN WRKDIR R_LIB DESTDIR PREFIX WRKSRC \
R_PKG_INSTALL_ARGS R_HOMEPAGE_BASE CONFIGURE_ARGS \
GENERATE_PLIST OPSYS CHECK_FILES_SKIP
.if defined(DISTNAME)
R_PKGNAME?= ${DISTNAME:C/_.*//}
R_PKGVER?= ${DISTNAME:C/.*_//}
.else
DISTNAME?= ${R_PKGNAME}_${R_PKGVER}
.endif
PKGNAME?= R-${R_PKGNAME}-${R_PKGVER:S/-/./}
MASTER_SITES?= ${MASTER_SITE_R_CRAN:=contrib/} \
${MASTER_SITE_R_CRAN:=contrib/Archive/${R_PKGNAME}/}
DIST_SUBDIR?= R
CATEGORIES+= math R
HOMEPAGE?= https://CRAN.R-project.org/package=${R_PKGNAME}
WRKSRC= ${WRKDIR}/${R_PKGNAME}
INSTALLATION_DIRS= ${R_LIB}
INSTALL_ENV+= R_LIBS=
do-build:
do-test:
${RUN} cd ${WRKDIR} && ${PKGSRC_SETENV} ${MAKE_ENV} ${TEST_ENV} \
${PREFIX}/bin/R CMD check ${R_PKGNAME}
do-install:
${RUN} ${PKGSRC_SETENV} ${INSTALL_ENV} ${MAKE_ENV} \
${PREFIX}/bin/R CMD INSTALL ${R_PKG_INSTALL_ARGS} ${WRKSRC}
.include "../../mk/bsd.fast.prefs.mk"
.if ${OPSYS} == "Darwin"
.PHONY: fix-darwin-install-name
post-install: fix-darwin-install-name
fix-darwin-install-name:
${FIND} ${DESTDIR}${PREFIX} -name "*.so" | while read lib; do \
libname=`basename $${lib}`; \
libdir=`dirname $${lib} | sed -e 's,${DESTDIR},,'`; \
install_name_tool -id $${libdir}/$${libname} $${lib}; \
done
.endif
R_LIB= lib/R/library
R_INST_DIRS?= ${R_PKGNAME}
R_HOMEPAGE_BASE= http://cran.r-project.org/web/packages
R_PKG_INSTALL_ARGS= -l ${DESTDIR}${PREFIX}/${R_LIB}
.if defined(CONFIGURE_ARGS)
R_PKG_INSTALL_ARGS+= --configure-args='${CONFIGURE_ARGS}'
.endif
GENERATE_PLIST+= ( cd ${DESTDIR}${PREFIX}; for dir in ${R_INST_DIRS}; do \
${FIND} ${R_LIB}/$${dir} \( -type f -o -type l \) -print; done ) | ${SORT} -u;
INSTALL_TEMPLATES+= ../../math/R/files/pkg-index.tmpl
DEINSTALL_TEMPLATES+= ../../math/R/files/pkg-index.tmpl
CHECK_FILES_SKIP+= ${PREFIX}/${R_LIB}/R.css
.include "../../math/R/buildlink3.mk"
|