R-packages.eclass: add SUGGESTED_PACKAGES optfeature

Signed-off-by: Alessandro Barbieri <lssndrbarbieri@gmail.com>
This commit is contained in:
Alessandro Barbieri
2021-10-05 23:23:30 +02:00
parent 21553437e6
commit fcc3d7d78e

View File

@@ -1,9 +1,9 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
inherit eutils toolchain-funcs
inherit eutils optfeature toolchain-funcs
EXPORT_FUNCTIONS src_unpack src_prepare src_compile src_install
EXPORT_FUNCTIONS src_unpack src_prepare src_compile src_install pkg_postinst
SRC_URI="mirror://cran/src/contrib/${PN}_${PV}.tar.gz"
HOMEPAGE="https://cran.r-project.org/package=${PN}"
@@ -32,7 +32,6 @@ R-packages_src_prepare() {
default
}
R-packages_src_compile() {
MAKEFLAGS="AR=$(tc-getAR) CFLAGS=${CFLAGS// /\\ } CXXFLAGS=${CXXFLAGS// /\\ } FFLAGS=${FFLAGS// /\\ } FCFLAGS=${FCFLAGS// /\\ } LDFLAGS=${LDFLAGS// /\\ }" R CMD INSTALL . -l "${WORKDIR}" "--byte-compile" || die
}
@@ -62,3 +61,9 @@ R-packages_src_install() {
insinto "/usr/$(get_libdir)/R/site-library"
doins -r "${WORKDIR}/${PN//_/.}"
}
R-packages_pkg_postinst() {
if [ -v SUGGESTED_PACKAGES ]; then
optfeature "having the upstream suggested packages" "${SUGGESTED_PACKAGES}"
fi
}