From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id E881B138359 for ; Thu, 7 May 2020 11:13:57 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 34B52E0930; Thu, 7 May 2020 11:13:57 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 13A26E0930 for ; Thu, 7 May 2020 11:13:57 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8A87A34F592 for ; Thu, 7 May 2020 11:13:55 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 5B2F3226 for ; Thu, 7 May 2020 11:13:53 +0000 (UTC) From: "Andrew Ammerlaan" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andrew Ammerlaan" Message-ID: <1588808155.bdffb505eca41fccdac6625b586f7a7ed05159b4.andrewammerlaan@gentoo> Subject: [gentoo-commits] repo/proj/guru:master commit in: eclass/ X-VCS-Repository: repo/proj/guru X-VCS-Files: eclass/R-packages-guru.eclass X-VCS-Directories: eclass/ X-VCS-Committer: andrewammerlaan X-VCS-Committer-Name: Andrew Ammerlaan X-VCS-Revision: bdffb505eca41fccdac6625b586f7a7ed05159b4 X-VCS-Branch: master Date: Thu, 7 May 2020 11:13:53 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 192ed52c-9a52-4f63-a4d4-6bb8f13b07df X-Archives-Hash: d0b325eb637ee3e2c0abc317f6dec80f commit: bdffb505eca41fccdac6625b586f7a7ed05159b4 Author: Alessandro Barbieri gmail com> AuthorDate: Wed May 6 23:28:47 2020 +0000 Commit: Andrew Ammerlaan riseup net> CommitDate: Wed May 6 23:35:55 2020 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=bdffb505 new eclass for R packages, taken from the R_Overlay Signed-off-by: Alessandro Barbieri gmail.com> eclass/R-packages-guru.eclass | 54 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/eclass/R-packages-guru.eclass b/eclass/R-packages-guru.eclass new file mode 100644 index 0000000..e365b03 --- /dev/null +++ b/eclass/R-packages-guru.eclass @@ -0,0 +1,54 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +inherit eutils + +EXPORT_FUNCTIONS src_unpack src_prepare src_compile src_install pkg_postinst + +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="byte-compile" + +DEPEND="dev-lang/R" +RDEPEND="${DEPEND}" + +R-packages-guru_src_unpack() { + unpack ${A} + if [[ -d "${PN//_/.}" ]] && [[ ! -d "${P}" ]]; then + mv ${PN//_/.} "${P}" + fi +} + +if has "${EAPI:-0}" 0 1 2 3 4 5; then + R-packages-guru_src_prepare() { + epatch_user + } +else + R-packages-guru_src_prepare() { + default + } +fi + +R-packages-guru_src_compile() { + MAKEFLAGS="CFLAGS=${CFLAGS// /\\ } CXXFLAGS=${CXXFLAGS// /\\ } FFLAGS=${FFLAGS// /\\ } FCFLAGS=${FCFLAGS// /\\ } LDFLAGS=${LDFLAGS// /\\ }" \ + R CMD INSTALL . -l "${WORKDIR}" $(use byte-compile && echo "--byte-compile") +} + +R-packages-guru_src_install() { + insinto /usr/$(get_libdir)/R/site-library + doins -r "${WORKDIR}"/${PN//_/.} +} + +R-packages-guru_pkg_postinst() { + if [[ "${_UNRESOLVABLE_PACKAGES:-}" ]]; then + # _UNRESOLVABLE_PACKAGES is only set if it has more than zero items + local _max=${#_UNRESOLVABLE_PACKAGES[*]} i= + + einfo "Dependency(-ies):" + for (( i=0; i<"${_max}"; i++ )); do + einfo "- ${_UNRESOLVABLE_PACKAGES[$i]}" + done + einfo 'are (is) suggested by upstream but could not be found.' + einfo 'Please install it manually from the R interpreter if you need it.' + fi +}