diff options
author | 2017-06-30 07:14:36 +0000 | |
---|---|---|
committer | 2017-06-30 07:14:36 +0000 | |
commit | 88ba5860d71d974768961348d70c447c05c59630 (patch) | |
tree | ac6a7dd22f36e75d005c286a8f646e1b34ce115c | |
parent | expanded to mpi-select-r1, for non-multibuild testing (diff) | |
download | gentoo-mpi-88ba5860d71d974768961348d70c447c05c59630.tar.gz gentoo-mpi-88ba5860d71d974768961348d70c447c05c59630.tar.bz2 gentoo-mpi-88ba5860d71d974768961348d70c447c05c59630.zip |
updated non multibuild-related eclass with src_* functions
-rw-r--r-- | eclass/mpi-select-r1.eclass | 104 |
1 files changed, 45 insertions, 59 deletions
diff --git a/eclass/mpi-select-r1.eclass b/eclass/mpi-select-r1.eclass index 829f848..b23c1c0 100644 --- a/eclass/mpi-select-r1.eclass +++ b/eclass/mpi-select-r1.eclass @@ -88,78 +88,64 @@ mpi_foreach_implementation() echo "${status}" } -# TODO: write src_configure/compile/test/ -mpi_src_configure() +mpi-select_get_implementation() { - debug-print-function "${FUNCNAME}" "${@}" - - mpi-select_abi_src_configure() - { - debug-print-function "${FUNCNAME}" "${@}" - pushd "${BUILD_DIR}" > /dev/null || die - if declare -f mpi_src_configure > /dev/null; then - mpi_src_configure - else - default_src_configure - fi - popd > /dev/null || die - } + echo "${PN}" +} + +mpi-select_bindir() +{ + echo "${D}/usr/bin/${PF}/" +} - mpi_foreach_implementation mpi-select_abi_src_configure +mpi-select_libdir() +{ + echo "${D}/usr/$(get_libdir)/${PF}/" +} + +mpi-select_etcdir() +{ + echo "${D}/etc/${PF}/" +} + +mpi_src_configure() +{ + # hmmm how to handle econf flags.... + default } mpi_src_compile() { - debug-print-function "${FUNCNAME}" "${@}" - - mpi-select_abi_src_compile() - { - debug-print-function "${FUNCNAME}" "${@}" - pushd "${BUILD_DIR}" > /dev/null || die - if declare -f mpi_src_configure > /dev/null; then - mpi_src_compile - else - default_src_configure - fi - popd > /dev/null || die - } + local imp=$(mpi-select_get_implementation) - mpi_foreach_implementation mpi-select_abi_src_compile + if [[ "${imp}" == "mpich" ]]; then + einfo "hit mpich" + elif [[ "${imp}" == "openmpi" ]]; then + einfo "hit openmpi" + fi } mpi_src_test() { - debug-print-function "${FUNCNAME}" "${@}" - - mpi-select_abi_src_test() - { - debug-print-function "${FUNCNAME}" "${@}" - pushd "${BUILD_DIR}" > /dev/null || die - if declare -f mpi_src_configure > /dev/null; then - mpi_src_test - else - default_src_configure - fi - popd > /dev/null || die - } - - mpi_foreach_implementation mpi-select_abi_src_test + default } mpi_src_install() { - debug-print-function "${FUNCNAME}" "${@}" - - mpi-select_abi_src_install() - { - debug-print-function "${FUNCNAME}" "${@}" - pushd "${BUILD_DIR}" > /dev/null || die - if declare -f mpi_src_configure > /dev/null; then - mpi_src_install_ - else - default_src_configure - fi - popd > /dev/null || die - } - mpi_foreach_implementation mpi-select_abi_src_install + emake DESTDIR="${D}" install + + dodir $(mpi-select_bindir) + mv "${D}"/usr/bin/* $(mpi-select_bindir) + + dodir $(mpi-select_libdir) + mv "${D}"/usr/$(get_libdir)/* $(mpi-select_libdir) + + dodir $(mpi-select_etcdir) + local i + for i in "${D}/etc/"*; do + [ "${i}" == $(mpi-select_etcdir) ] && continue + mv "${i}" $(mpi-select_etcdir) + done + + find . -type d -empty -delete || die "could not delete empty directories" } |