commit:     4e1d7e84973a548a8040739984c4bd467d6f7838
Author:     David Roman <davidroman96 <AT> gmail <DOT> com>
AuthorDate: Thu Aug  3 07:32:41 2023 +0000
Commit:     Florian Schmaus <flow <AT> gentoo <DOT> org>
CommitDate: Fri Aug  4 07:25:55 2023 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=4e1d7e84

R-packages.eclass: fix package installation

Instead of creating a symlink R/site-library -> /usr/share/doc
do it otherwise, linking /usr/share/doc -> R/site-library.
This way if nodoc is enabled symlinks won't be broken.

Signed-off-by: David Roman <droman <AT> ifae.es>
Closes: https://github.com/gentoo/guru/pull/102
Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>

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

diff --git a/eclass/R-packages.eclass b/eclass/R-packages.eclass
index ed63cff46f..6dac19a161 100644
--- a/eclass/R-packages.eclass
+++ b/eclass/R-packages.eclass
@@ -68,9 +68,11 @@ _movelink() {
        local source=${1}
        local dest=${2}
        if [[ -e "${source}" ]]; then
-               local rp_source="$(realpath ${source} || die)"
-               mv "${rp_source}" "${dest}" || die
-               cp -rsf "${dest}" "${rp_source}" || die
+               local rdir=/usr/$(get_libdir)/R/site-library/${CRAN_PN}
+               local rp_source="${rdir}/${source}"
+               insinto ${rdir}
+               doins -r ${source}
+               ln -s "${rp_source}" "${dest}" || die
        fi
 }
 
@@ -162,11 +164,7 @@ R-packages_src_install() {
        fi
 
        if [[ -e doc ]]; then
-               pushd doc || die
-               for i in *; do
-                       _movelink "${i}" "${EDOCDIR}/${i}"
-               done
-               popd || die
+               _movelink doc "${EDOCDIR}"/doc
        fi
 
        rm -f LICENSE || die

Reply via email to