1e8fdb26de
The category 'R' is used to denote R packages, just as 'perl5' and 'python' are used in other cases. To ensure consistency, add that to CATEGORIES in Makefile.extension rather than in each individual R package. This was discussed in http://mail-index.netbsd.org/tech-pkg/2019/08/02/msg021711.html.
65 lines
1.9 KiB
Text
65 lines
1.9 KiB
Text
# $NetBSD: Makefile.extension,v 1.24 2019/08/07 21:54:34 brook 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,
|
|
|
|
.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-install:
|
|
${PKGSRC_SETENV} ${INSTALL_ENV} ${MAKE_ENV} ${LOCALBASE}/bin/R \
|
|
CMD INSTALL ${R_PKG_INSTALL_ARGS} ${WRKDIR}/${R_PKGNAME}
|
|
|
|
.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"
|