summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorBenda Xu <heroxbd@gentoo.org>2013-09-30 22:32:58 +0900
committerBenda Xu <heroxbd@gentoo.org>2013-09-30 22:32:58 +0900
commitca8b722d736e84e4a21b7555b1ca0a905cb7693f (patch)
treefef91ff96d8fc8718265f73c7f36fe01b3a54f22 /eclass
parentclean up profiles (diff)
downloadandroid-ca8b722d736e84e4a21b7555b1ca0a905cb7693f.tar.gz
android-ca8b722d736e84e4a21b7555b1ca0a905cb7693f.tar.bz2
android-ca8b722d736e84e4a21b7555b1ca0a905cb7693f.zip
RAP update, for profiles and glibc
Diffstat (limited to 'eclass')
-rw-r--r--eclass/R-packages.eclass50
-rw-r--r--eclass/toolchain.eclass4
2 files changed, 54 insertions, 0 deletions
diff --git a/eclass/R-packages.eclass b/eclass/R-packages.eclass
new file mode 100644
index 0000000..8544e70
--- /dev/null
+++ b/eclass/R-packages.eclass
@@ -0,0 +1,50 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+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}"
+
+S="${WORKDIR}"
+
+R-packages_src_unpack() {
+ unpack ${A}
+ mv ${PN//_/.} ${P}
+}
+
+R-packages_src_prepare() {
+ cd ${P}
+ epatch_user
+}
+
+R-packages_src_compile() {
+ MAKEFLAGS="CFLAGS=${CFLAGS// /\\ } CXXFLAGS=${CXXFLAGS// /\\ } FFLAGS=${FFLAGS// /\\ } FCFLAGS=${FCFLAGS// /\\ } LDFLAGS=${LDFLAGS// /\\ }" \
+ R CMD INSTALL ${S}/${P} -l . $(use byte-compile && echo "--byte-compile")
+}
+
+R-packages_src_install() {
+ insinto /usr/$(get_libdir)/R/site-library
+ doins -r ${PN//_/.}
+}
+
+R-packages_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
+}
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 77fa3e4..55d9890 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1228,6 +1228,10 @@ gcc_do_configure() {
# use sysroot of toolchain to get currect include and library at
# compile time
confgcc+=( --with-sysroot="${EPREFIX}" )
+
+ # when doing cross compiling native for target, the build sysroot
+ # should be pointed to SYSROOT of the cross compiler.
+ tc-is-cross-compiler && confgcc+=( --with-build-sysroot="${ROOT}" )
fi
fi
# __cxa_atexit is "essential for fully standards-compliant handling of