Files
guru/dev-R/RcppEnsmallen/RcppEnsmallen-0.2.19.0.1-r1.ebuild
T

57 lines
1.4 KiB
Bash
Raw Normal View History

# Copyright 1999-2022 Gentoo Authors
2021-10-05 22:57:13 +02:00
# Distributed under the terms of the GNU General Public License v2
EAPI=7
2022-02-09 11:12:49 +05:00
inherit R-packages eapi8-dosym
2021-10-05 22:57:13 +02:00
2022-02-09 11:12:49 +05:00
MY_PV="$(ver_cut 2-4 ${PV})"
2021-10-05 22:57:13 +02:00
DESCRIPTION='Header-Only C++ Mathematical Optimization library for armadillo'
HOMEPAGE="
https://cran.r-project.org/package=RcppEnsmallen
https://github.com/coatless-rpkg/rcppensmallen
"
2021-10-05 22:57:13 +02:00
#SRC_URI="mirror://cran/src/contrib/RcppEnsmallen/RcppEnsmallen_${PV}.tar.gz"
2022-05-28 14:32:58 +02:00
SLOT="0/${PV}"
2021-10-05 22:57:13 +02:00
KEYWORDS="~amd64"
LICENSE='GPL-2+'
DEPEND="
>=dev-lang/R-3.3.0
dev-R/Rcpp
=sci-libs/ensmallen-${MY_PV}*:=
2021-10-05 22:57:13 +02:00
"
RDEPEND="
${DEPEND}
>=dev-R/RcppArmadillo-0.9.800.0.0
"
SUGGESTED_PACKAGES="
dev-R/knitr
dev-R/rmarkdown
2021-10-05 22:57:13 +02:00
"
src_prepare() {
2022-05-05 08:39:46 +02:00
R-packages_src_prepare
2022-02-09 11:12:49 +05:00
# remove bundled
2021-10-05 22:57:13 +02:00
rm -r inst/include/ensmallen_bits || die
rm inst/include/ensmallen.hpp || die
2022-02-09 11:12:49 +05:00
# link to sci-libs/ensmallen
ln -s "${ESYSROOT}"/usr/include/ensmallen_bits inst/include/ensmallen_bits || die
ln -s "${ESYSROOT}"/usr/include/ensmallen.hpp inst/include/ensmallen.hpp || die
2021-10-05 22:57:13 +02:00
}
src_install() {
R-packages_src_install
2022-02-09 11:12:49 +05:00
R_includedir="/usr/$(get_libdir)/R/site-library/${PN}/include"
dosym8 -r /usr/include/ensmallen.hpp "${R_includedir}/ensmallen.hpp"
# portage doesn't like symlinks to folders, symlink all the files then
rm -rf "${ED}/${R_includedir}"/ensmallen_bits/* || die
cp -rs "/usr/include/ensmallen_bits" "${ED}/${R_includedir}" || die
2021-10-05 22:57:13 +02:00
}