[BACK]Return to Makefile.extension CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / math / R

File: [cvs.NetBSD.org] / pkgsrc / math / R / Makefile.extension (download)

Revision 1.26, Sat Nov 2 16:16:18 2019 UTC (3 months, 3 weeks ago) by rillig
Branch: MAIN
CVS Tags: pkgsrc-2019Q4-base, pkgsrc-2019Q4, HEAD
Changes since 1.25: +8 -8 lines

math: align variable assignments

pkglint -Wall -F --only aligned -r

Manual correction in R/Makefile.extension for the MASTER_SITES
continuation line.

# $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"