commit:     fcc3d7d78eda6e965820a39b9bbcb062cbd1549d
Author:     Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
AuthorDate: Tue Oct  5 21:23:30 2021 +0000
Commit:     Theo Anderson <telans <AT> posteo <DOT> de>
CommitDate: Tue Oct  5 21:24:13 2021 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=fcc3d7d7

R-packages.eclass: add SUGGESTED_PACKAGES optfeature

Signed-off-by: Alessandro Barbieri <lssndrbarbieri <AT> gmail.com>

 eclass/R-packages.eclass | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/eclass/R-packages.eclass b/eclass/R-packages.eclass
index a072e5cc2..6cbf9d7d3 100644
--- a/eclass/R-packages.eclass
+++ b/eclass/R-packages.eclass
@@ -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
+}

Reply via email to