R-packages.eclass: use edo for all the commands

Signed-off-by: Alessandro Barbieri <lssndrbarbieri@gmail.com>
This commit is contained in:
Alessandro Barbieri
2022-05-31 19:52:57 +02:00
parent f005022931
commit f16ca432c7

View File

@@ -12,7 +12,7 @@
# Alessandro Barbieri <lssndrbarbieri@gmail.com> # Alessandro Barbieri <lssndrbarbieri@gmail.com>
# @SUPPORTED_EAPIS: 7 # @SUPPORTED_EAPIS: 7
inherit eutils optfeature toolchain-funcs inherit edo eutils optfeature toolchain-funcs
case ${EAPI} in case ${EAPI} in
7) ;; 7) ;;
@@ -37,9 +37,9 @@ BDEPEND="sys-apps/pkgcore"
# <dest> will contain symlinks to everything in <source> # <dest> will contain symlinks to everything in <source>
_movelink() { _movelink() {
if [[ -e "${1}" ]]; then if [[ -e "${1}" ]]; then
local rp1="$(realpath ${1})" || die local rp1="$(edo realpath ${1})"
mv "${rp1}" "${2}" || die edo mv "${rp1}" "${2}"
cp -rsf "${2}" "${rp1}" || die edo cp -rsf "${2}" "${rp1}"
fi fi
} }
@@ -49,7 +49,7 @@ _movelink() {
R-packages_src_unpack() { R-packages_src_unpack() {
unpack ${A} unpack ${A}
if [[ -d "${PN//_/.}" ]] && [[ ! -d "${P}" ]]; then if [[ -d "${PN//_/.}" ]] && [[ ! -d "${P}" ]]; then
mv "${PN//_/.}" "${P}" || die edo mv "${PN//_/.}" "${P}"
fi fi
} }
@@ -57,9 +57,9 @@ R-packages_src_unpack() {
# @DESCRIPTION: # @DESCRIPTION:
# function to remove unwanted files from the sources # function to remove unwanted files from the sources
R-packages_src_prepare() { R-packages_src_prepare() {
rm -f LICENSE || die edo rm -f LICENSE
default default
mkdir -p "${T}/R" || die edo mkdir -p "${T}/R"
} }
# @FUNCTION: R-packages_src_configure # @FUNCTION: R-packages_src_configure
@@ -89,7 +89,7 @@ R-packages_src_compile() {
LDFLAGS=${LDFLAGS// /\\ } \ LDFLAGS=${LDFLAGS// /\\ } \
MAKEOPTS=${MAKEOPTS// /\\ } \ MAKEOPTS=${MAKEOPTS// /\\ } \
" \ " \
R CMD INSTALL . -d -l "${T}/R" "--byte-compile" || die edo R CMD INSTALL . -d -l "${T}/R" "--byte-compile"
} }
@@ -99,35 +99,35 @@ R-packages_src_compile() {
# documentation and examples to docsdir, symlinked back to R site-library (to allow access from within R) # documentation and examples to docsdir, symlinked back to R site-library (to allow access from within R)
# everything else to R site-library # everything else to R site-library
R-packages_src_install() { R-packages_src_install() {
pushd "${T}/R/${PN//_/.}" || die edo pushd "${T}/R/${PN//_/.}"
local DOCS_DIR="/usr/share/doc/${PF}" local DOCS_DIR="/usr/share/doc/${PF}"
mkdir -p "${ED}/${DOCS_DIR}" || die edo mkdir -p "${ED}/${DOCS_DIR}"
for i in NEWS.md README.md DESCRIPTION examples CITATION INDEX NEWS WORDLIST News.Rd ; do for i in NEWS.md README.md DESCRIPTION examples CITATION INDEX NEWS WORDLIST News.Rd ; do
_movelink "${i}" "${ED}${DOCS_DIR}/${i}" || die edo _movelink "${i}" "${ED}${DOCS_DIR}/${i}"
docompress -x "${DOCS_DIR}/${i}" docompress -x "${DOCS_DIR}/${i}"
done done
if [[ -e html ]]; then if [[ -e html ]]; then
_movelink html "${ED}${DOCS_DIR}/html" || die edo _movelink html "${ED}${DOCS_DIR}/html"
docompress -x "${DOCS_DIR}/html" docompress -x "${DOCS_DIR}/html"
fi fi
if [[ -e doc ]]; then if [[ -e doc ]]; then
pushd doc || die edo pushd doc
for i in * ; do for i in * ; do
_movelink "${i}" "${ED}${DOCS_DIR}/${i}" || die edo _movelink "${i}" "${ED}${DOCS_DIR}/${i}"
docompress -x "${DOCS_DIR}/${i}" docompress -x "${DOCS_DIR}/${i}"
done done
popd || die edo popd
fi fi
if [[ -e doc/html ]]; then if [[ -e doc/html ]]; then
docompress -x "${DOCS_DIR}/html" docompress -x "${DOCS_DIR}/html"
fi fi
docompress -x "${DOCS_DIR}" docompress -x "${DOCS_DIR}"
rm -rf tests test || die edo rm -rf tests test
insinto "/usr/$(get_libdir)/R/site-library" insinto "/usr/$(get_libdir)/R/site-library"
doins -r "${T}/R/${PN//_/.}" doins -r "${T}/R/${PN//_/.}"
@@ -139,7 +139,7 @@ R-packages_src_install() {
R-packages_pkg_postinst() { R-packages_pkg_postinst() {
if [[ -v SUGGESTED_PACKAGES ]]; then if [[ -v SUGGESTED_PACKAGES ]]; then
for p in ${SUGGESTED_PACKAGES} ; do for p in ${SUGGESTED_PACKAGES} ; do
pexist=$(pquery -n1 "${p}" 2>/dev/null) || die pexist=$(edo pquery -n1 "${p}" 2>/dev/null)
if [[ -n "${pexist}" ]]; then if [[ -n "${pexist}" ]]; then
optfeature "having the upstream suggested package" "${p}" optfeature "having the upstream suggested package" "${p}"
fi fi