aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Gilroy <michael.gilroy24@gmail.com>2017-06-13 09:22:49 -0600
committerGitHub <noreply@github.com>2017-06-13 09:22:49 -0600
commit3f3a7ae095dfdefe604a61fa0fbc6b61cd4be96d (patch)
tree1a5f57f4e017b0068d97389589022fdbfd84b422
parentmade mpi-select framework (diff)
parentmore stable version of mpi-providers.eclass (diff)
downloadgentoo-mpi-3f3a7ae095dfdefe604a61fa0fbc6b61cd4be96d.tar.gz
gentoo-mpi-3f3a7ae095dfdefe604a61fa0fbc6b61cd4be96d.tar.bz2
gentoo-mpi-3f3a7ae095dfdefe604a61fa0fbc6b61cd4be96d.zip
Merge pull request #1 from gilroy/dev
Dev
-rw-r--r--eclass/mpi-providers.eclass44
-rw-r--r--eclass/multilib-minimal.eclass124
2 files changed, 138 insertions, 30 deletions
diff --git a/eclass/mpi-providers.eclass b/eclass/mpi-providers.eclass
index 904fc60..405d025 100644
--- a/eclass/mpi-providers.eclass
+++ b/eclass/mpi-providers.eclass
@@ -16,46 +16,30 @@ SLOT="${PVR}"
# @ECLASS-FUNCTION: mpi-providers_safe_mv
# @DESCRIPTION:
-# $mpi-providers_save_mv < installation directory (usually EPREFIX)>
+# Safely moves installation directory to /usr/lib/mpi/$PN-PVR. Documentation is stored in the usual location.
mpi-providers_safe_mv() {
## MOVE EVERYTHING BUT DOCS TO /usr/lib/mpi/${PN}-${PVR}
## MOVE REMAINING CONTENTS FROM /etc/* TO /etc/${PN}-${PVR}
- local TMP="${T}"/"${PN}"
-
- # move anything remaining in /etc to /etc/${PN}-${PVR}
- mkdir -p "${TMP}"/etc
- mkdir -p "${ED}"/etc/"${PN}"-"${PVR}"
- rsync --remove-source-files -a "${ED}"/etc/* \
- "${TMP}"/etc/. || die "rsync failed"
- rsync --remove-source-files -a "${TMP}"/etc/* \
- "${ED}"/etc/"${PN}"-"${PVR}" || die "rsync failed"
-
- # move /usr/share/doc to temporary docs directory
- mkdir -p "${T}"/"${PN}"/DOCS
- local DOCS="${ED}"/usr/share/doc
- rsync --remove-source-files -a "${DOCS}"/* \
- "${TMP}"/DOCS/. || die "rsync failed"
- rsync --remove-source-files -a "${ED}"/* \
- "${TMP}"/. || die "rsync failed"
+ local mpi_root="${ED}/usr/$(get_libdir)/mpi/${PN}-${PVR}"
- # move docs from tmp, everything else to /usr/lib/mpi/${PN}-${PVR}
- mkdir -p "${ED}"/usr/$(get_libdir)/mpi/"${PN}"-"${PVR}"
- local MPI_DIR="${ED}"/usr/$(get_libdir)/mpi/"${PN}"-"${PVR}"
- mkdir -p "${DOCS}"
- rsync --remove-source-files -a "${TMP}"/DOCS/* \
- "${DOCS}"/. || die "rsync failed"
- rsync --remove-source-files -a "${TMP}"/* \
- "${MPI_DIR}"/. || die "rsync failed"
-
- # clean up
- rm -rf "${TMP}"
+ # move to temp directory
+ mv "${ED}" "${T}/install" || die "mv failed"
+ mkdir -p "${mpi_root}"
+ # move from temp to final destination
+ mv "${T}/install" "${mpi_root}" || die "mv failed"
+
+ mv "${mpi_root}/usr/share/doc" "${ED}" || die "mv failed"
+
+ cd "${mpi_root}/etc"
+ find -O3 -mindepth 1 -maxdepth 1 ! -path "./${PF}*" -execdir cp -a -t "${PF}" '{}' \+
+
}
# @ECLASS-FUNCTION: mpi-providers_sysconfdir
# @DESCRIPTION:
# Sets --syconfdir econf flag to a directory in /etc unique to that particular MPI build
mpi-providers_sysconfdir() {
- echo "${EPREFIX}"/etc/"${PN}"-"${PVR}"
+ echo "${EPREFIX}/etc/${PN}-${PVR}"
}
diff --git a/eclass/multilib-minimal.eclass b/eclass/multilib-minimal.eclass
new file mode 100644
index 0000000..de46762
--- /dev/null
+++ b/eclass/multilib-minimal.eclass
@@ -0,0 +1,124 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: multilib-minimal.eclass
+# @MAINTAINER:
+# Multilib team <multilib@gentoo.org>
+# @BLURB: wrapper for multilib builds providing convenient multilib_src_* functions
+# @DESCRIPTION:
+#
+# src_configure, src_compile, src_test and src_install are exported.
+#
+# Use multilib_src_* instead of src_* which runs this phase for
+# all enabled ABIs.
+#
+# multilib-minimal should _always_ go last in inherit order!
+#
+# If you want to use in-source builds, then you must run
+# multilib_copy_sources at the end of src_prepare!
+# Also make sure to set correct variables such as
+# ECONF_SOURCE=${S}
+#
+# If you need generic install rules, use multilib_src_install_all function.
+
+
+# EAPI=4 is required for meaningful MULTILIB_USEDEP.
+case ${EAPI:-0} in
+ 4|5|6) ;;
+ *) die "EAPI=${EAPI} is not supported" ;;
+esac
+
+
+[[ ${EAPI} == [45] ]] && inherit eutils
+inherit multilib-build
+
+EXPORT_FUNCTIONS src_configure src_compile src_test src_install
+
+
+multilib-minimal_src_configure() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ multilib-minimal_abi_src_configure() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ mkdir -p "${BUILD_DIR}" || die
+ pushd "${BUILD_DIR}" >/dev/null || die
+ if declare -f multilib_src_configure >/dev/null ; then
+ multilib_src_configure
+ else
+ default_src_configure
+ fi
+ popd >/dev/null || die
+ }
+
+ multilib_foreach_abi multilib-minimal_abi_src_configure
+}
+
+multilib-minimal_src_compile() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ multilib-minimal_abi_src_compile() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ pushd "${BUILD_DIR}" >/dev/null || die
+ if declare -f multilib_src_compile >/dev/null ; then
+ multilib_src_compile
+ else
+ default_src_compile
+ fi
+ popd >/dev/null || die
+ }
+
+ multilib_foreach_abi multilib-minimal_abi_src_compile
+}
+
+multilib-minimal_src_test() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ multilib-minimal_abi_src_test() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ pushd "${BUILD_DIR}" >/dev/null || die
+ if declare -f multilib_src_test >/dev/null ; then
+ multilib_src_test
+ else
+ default_src_test
+ fi
+ popd >/dev/null || die
+ }
+
+ multilib_foreach_abi multilib-minimal_abi_src_test
+}
+
+multilib-minimal_src_install() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ multilib-minimal_abi_src_install() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ pushd "${BUILD_DIR}" >/dev/null || die
+ if declare -f multilib_src_install >/dev/null ; then
+ multilib_src_install
+ else
+ # default_src_install will not work here as it will
+ # break handling of DOCS wrt #468092
+ # so we split up the emake and doc-install part
+ # this is synced with __eapi4_src_install
+ if [[ -f Makefile || -f GNUmakefile || -f makefile ]] ; then
+ emake DESTDIR="${D}" install
+ fi
+ fi
+
+ multilib_prepare_wrappers
+ multilib_check_headers
+ popd >/dev/null || die
+ }
+ multilib_foreach_abi multilib-minimal_abi_src_install
+ multilib_install_wrappers
+
+ if declare -f multilib_src_install_all >/dev/null ; then
+ multilib_src_install_all
+ else
+ einstalldocs
+ fi
+}