public inbox for gentoo-science@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-science] Re: new eclass to install R modules, such as Rcpp.
       [not found] <CAOfEGX+oJUxkc=drxhBQ5Nv4mj7bKvsFpTL6dh7eEAjBW_yDjA@mail.gmail.com>
@ 2018-01-13  4:06 ` Benda Xu
       [not found]   ` <CAOfEGXLq7+=w=Uu9jc6uLfc9wmPmpZhJEAnGzsWqa7Udya_Bzw@mail.gmail.com>
  0 siblings, 1 reply; 2+ messages in thread
From: Benda Xu @ 2018-01-13  4:06 UTC (permalink / raw
  To: Marco Clocchiatti; +Cc: gentoo-science

Hi Marco,

Let's move the discussion to the gentoo-science public mailing list.

Replied below.

Marco Clocchiatti <ziapannocchia@gmail.com> writes:

> In gentoo there is no way to install R modules, such as Rcpp
> http://rcpp.org.
>
> I think it should be easy to prepare an ebuild to do the trick.
> perhaps, the best way should be to have a specific eclass.
> The following lines may be sufficent to prepare a basic Rutils.eclass
> to install R modules:
>
> ...
> cloc3Lnv ~ # cat /usr/local/portage/eclass/Rutils.eclass |grep -v ^#|grep -v ^$
> EXPORT_FUNCTIONS src_unpack src_compile src_install
> DEPEND="dev-lang/R"
> Rutils_src_unpack() {
> 	mkdir -p "$S"
> }
> Rutils_src_compile() {
> 	CMD="install.packages(pkgs='${PN}',repos='${CRAN_REPO_URI}', lib='${S}')"
> 	/usr/bin/R -q -e "$CMD"
> }
> Rutils_src_install() {
> 	R_LIBRARY="${ED}/usr/lib/R/library"
> 	mkdir -p "$R_LIBRARY"
> 	mv "${PN}" "${R_LIBRARY}"
> }
> ...
>
> This eclass may be used by ebuilds in this way:
>
> ...
> cloc3Lnv ~ # cat /usr/local/portage/sci-misc/Rcpp/Rcpp-9999.ebuild
> |grep -v ^#|grep -v ^$
> EAPI=6
> inherit Rutils
> DESCRIPTION="Seamless R and C++ Integration"
> HOMEPAGE="http://rcpp.org"
> SRC_URI=""
> CRAN_REPO_URI="https://ftp.gwdg.de/pub/misc/cran"
> LICENSE="GPL-2"
> SLOT="0"
> KEYWORDS="~amd64 ~x86"
> IUSE=""
> DEPEND="
> "
> RDEPEND="${CDEPEND}
> "
>
> Please consider the opportunity to add a Rutils.eclass to portage.

Thanks for the suggestion!  That's what we are doing in R_Overlay,

  https://wiki.gentoo.org/wiki/Project:Science/Overlay

It is available via layman.  It has an eclass very similar to your
proposal.

  https://github.com/gentoo-mirror/R_Overlay/blob/master/eclass/R-packages.eclass

The R_Overlay is automatically generated from CRAN and BIOC.

Cheers,
Benda


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [gentoo-science] Re: new eclass to install R modules, such as Rcpp.
       [not found]   ` <CAOfEGXLq7+=w=Uu9jc6uLfc9wmPmpZhJEAnGzsWqa7Udya_Bzw@mail.gmail.com>
@ 2018-01-16  7:53     ` Benda Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Benda Xu @ 2018-01-16  7:53 UTC (permalink / raw
  To: Marco Clocchiatti; +Cc: gentoo-science

Hi Marco,

Marco Clocchiatti <ziapannocchia@gmail.com> writes:

> wonderfull.
>
> your eclass is surely better than mine, but I found a little difference.
> your ebuilds for R packages need a specific SRC_URI, while mine eclass
> finds automatically the current version of the package by itself.

It looks like your eclass is downloading from CRAN in
Rutils_src_compile().  For the sake of reproducible builds, ebuilds
should use local files during the build:

   https://devmanual.gentoo.org/ebuild-writing/functions/index.html

Is it possible to instruct R install.package() to "fetch only", or
"print download URL"?

> I don't know if this is a good or a bad feature, but I think may it be
> usefull to implement a -9999.ebuild version of the package.

The -9999.ebuild has a special meaning of 'live' ebuild that the source
is a version-controlled repository.  The devmanual discuss the cvs case:

   https://devmanual.gentoo.org/ebuild-writing/functions/src_unpack/cvs-sources/index.html#disadvantages-of-cvs-sources

CRAN is not a version-controlled repository.  It's packages are
versioned and released.  Therefore I prefer creating versioned ebuilds
to the live ones.


Thanks for your eclass, it is a very neat write-up.

Yours,
Benda


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-01-16  7:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CAOfEGX+oJUxkc=drxhBQ5Nv4mj7bKvsFpTL6dh7eEAjBW_yDjA@mail.gmail.com>
2018-01-13  4:06 ` [gentoo-science] Re: new eclass to install R modules, such as Rcpp Benda Xu
     [not found]   ` <CAOfEGXLq7+=w=Uu9jc6uLfc9wmPmpZhJEAnGzsWqa7Udya_Bzw@mail.gmail.com>
2018-01-16  7:53     ` Benda Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox