commit:     db4c48705c9059b1b3ce9d65f88dd5b5d0b86aea
Author:     Christoph Junghans <ottxor <AT> gentoo <DOT> org>
AuthorDate: Sun Sep  7 18:49:16 2014 +0000
Commit:     Christoph Junghans <ottxor <AT> gentoo <DOT> org>
CommitDate: Sun Sep  7 18:49:28 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=db4c4870

fix completion install

Package-Manager: portage-2.2.8-r1

---
 sci-chemistry/gromacs/ChangeLog               |  3 +++
 sci-chemistry/gromacs/gromacs-5.0.9999.ebuild | 17 +++++++++++++++--
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/sci-chemistry/gromacs/ChangeLog b/sci-chemistry/gromacs/ChangeLog
index bc8af30..baff1c7 100644
--- a/sci-chemistry/gromacs/ChangeLog
+++ b/sci-chemistry/gromacs/ChangeLog
@@ -2,6 +2,9 @@
 # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
 # $Header: $
 
+  07 Sep 2014; Christoph Junghans <[email protected]> gromacs-5.0.9999.ebuild:
+  fix completion install
+
   06 Sep 2014; Christoph Junghans <[email protected]> gromacs-5.0.9999.ebuild:
   sync with gx86
 

diff --git a/sci-chemistry/gromacs/gromacs-5.0.9999.ebuild 
b/sci-chemistry/gromacs/gromacs-5.0.9999.ebuild
index a30abac..7c341a7 100644
--- a/sci-chemistry/gromacs/gromacs-5.0.9999.ebuild
+++ b/sci-chemistry/gromacs/gromacs-5.0.9999.ebuild
@@ -213,9 +213,11 @@ src_compile() {
                einfo "Compiling for ${x} precision"
                BUILD_DIR="${WORKDIR}/${P}_${x}"\
                        cmake-utils_src_compile
-               # generate bash completion
+               # generate bash completion, not 100% necessary for
+               # rel ebuilds as bundled
                BUILD_DIR="${WORKDIR}/${P}_${x}"\
                        cmake-utils_src_compile completion
+               # not 100% necessary for rel ebuilds as available from website
                if use doc; then
                        BUILD_DIR="${WORKDIR}/${P}_${x}"\
                                cmake-utils_src_compile manual
@@ -241,13 +243,24 @@ src_install() {
                if use doc; then
                        newdoc "${WORKDIR}/${P}_${x}"/docs/manual/gromacs.pdf 
"${PN}-manual-${PV}.pdf"
                fi
-               newbashcomp 
"${WORKDIR}/${P}_${x}"/src/programs/completion/gmx-completion.bash gromacs
+               #release ebuild does this automatically
+               if [[ $PV = *9999* ]]; then
+                       cp 
"${WORKDIR}/${P}_${x}"/src/programs/completion/gmx-completion.bash 
"${ED}/usr/bin" || die
+                       echo "complete -o nospace -F _gmx_compl gmx" > 
"${ED}/usr/bin/gmx-completion-gmx.bash" || die
+               fi
                use mpi || continue
                BUILD_DIR="${WORKDIR}/${P}_${x}_mpi" \
                        cmake-utils_src_install
        done
        # drop unneeded stuff
        rm "${ED}"usr/bin/GMXRC* || die
+       #concatenate all gmx-completion*, starting with gmx-completion.bash 
(fct defs)
+       #little hacckery as some gmx-completion* newlines ,so cat won't work
+       for x in "${ED}"usr/bin/gmx-completion{,?*}.bash ; do
+               echo $(<${x})
+       done > "${T}"/gmx-bashcomp || die
+       newbashcomp "${T}"/gmx-bashcomp gromacs
+       rm "${ED}"usr/bin/gmx-completion{,?*}.bash || die
 
        readme.gentoo_create_doc
 }

Reply via email to