aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sci-chemistry/nmrpipe/ChangeLog8
-rw-r--r--sci-chemistry/nmrpipe/nmrpipe-7.5.2012.204.11.07.ebuild123
2 files changed, 77 insertions, 54 deletions
diff --git a/sci-chemistry/nmrpipe/ChangeLog b/sci-chemistry/nmrpipe/ChangeLog
index 87651f341..aff912adb 100644
--- a/sci-chemistry/nmrpipe/ChangeLog
+++ b/sci-chemistry/nmrpipe/ChangeLog
@@ -2,6 +2,14 @@
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
# $Header: $
+ 10 Aug 2012; Justin Lecher <jlec@gentoo.org>
+ nmrpipe-7.5.2012.204.11.07.ebuild:
+ Enhancing prefix support
+
+ 10 Aug 2012; Justin Lecher <jlec@gentoo.org>
+ nmrpipe-7.5.2012.204.11.07.ebuild:
+ Enhancing prefix support
+
31 Jul 2012; Justin Lecher <jlec@gentoo.org>
+files/7.5.2012.204.11.07-lib.patch, -files/7.3.2012.114.11.33-lib.patch,
-nmrpipe-7.3.2012.114.11.33.ebuild, +nmrpipe-7.5.2012.204.11.07.ebuild:
diff --git a/sci-chemistry/nmrpipe/nmrpipe-7.5.2012.204.11.07.ebuild b/sci-chemistry/nmrpipe/nmrpipe-7.5.2012.204.11.07.ebuild
index 7d84f8a4b..ad5cd8eb2 100644
--- a/sci-chemistry/nmrpipe/nmrpipe-7.5.2012.204.11.07.ebuild
+++ b/sci-chemistry/nmrpipe/nmrpipe-7.5.2012.204.11.07.ebuild
@@ -26,7 +26,7 @@ LICENSE="as-is"
KEYWORDS="-* ~amd64 ~x86 ~amd64-linux ~x86-linux"
IUSE=""
-RESTRICT="fetch"
+RESTRICT="fetch strip"
DEPEND="app-shells/tcsh"
RDEPEND="${DEPEND}
@@ -39,11 +39,12 @@ RDEPEND="${DEPEND}
sys-libs/ncurses
x11-apps/xset
x11-libs/libX11
- x11-libs/xview
+ || ( x11-libs/xview x11-libs/xview-bin )
amd64? (
app-emulation/emul-linux-x86-baselibs
app-emulation/emul-linux-x86-xlibs
- )"
+ )
+ prefix? ( dev-util/patchelf )"
S="${WORKDIR}"
@@ -89,38 +90,16 @@ src_unpack() {
}
src_prepare() {
+ local bin
epatch "${FILESDIR}"/${PV}-lib.patch
mv nmrbin.linux9/nmr{W,w}ish || die
-}
-
-src_install() {
- cat >> "${T}"/nmrWish <<- EOF
- #!${EPREFIX}/bin/csh -f
- setenv NMRBIN \${NMRBASE}/bin/
- setenv NMRLIB \${NMRBIN}/lib
- setenv AUXLIB \${NMRBIN}/openwin/lib
- setenv TCLPATH \${NMRBASE}/com
- setenv TCL_LIBRARY \${NMRBASE}/nmrtcl/tcl8.4
- setenv TK_LIBRARY \${NMRBASE}/nmrtcl/tk8.4
- setenv BLT_LIBRARY \${NMRBASE}/nmrtcl/blt2.4
- setenv NMRPIPE_TCL_LIB \${NMRBASE}/nmrtcl/tcl8.4
- setenv NMRPIPE_TK_LIB \${NMRBASE}/nmrtcl/tk8.4
- setenv NMRPIPE_BLT_LIB \${NMRBASE}/nmrtcl/blt2.4
-
- if (!(\$?LD_LIBRARY_PATH)) then
- setenv LD_LIBRARY_PATH \${NMRLIB}:\${AUXLIB}
- else
- setenv LD_LIBRARY_PATH \${NMRLIB}:\${LD_LIBRARY_PATH}:\${AUXLIB}
- endif
- nmrwish \$*
- EOF
-
- # Remove the symlinks for the archives and the installation scripts.
+ ebegin "Cleaning installation"
for i in ${A} ; do
rm -f ${i} || die "Failed to remove archive symlinks."
done
+
# Remove some of the bundled applications and libraries; they are provided by Gentoo instead.
# rm -r nmrbin.linux9/{lib/{libBLT24.so,libolgx.so*,libxview.so*,*.timestamp},*timestamp,xv,gnuplot*,rasmol*,nc,nedit} \
rm -rf nmrbin.linux9/{lib/*.timestamp,*timestamp,xv,gnuplot*,rasmol*,nc,nedit} \
@@ -137,6 +116,14 @@ src_install() {
# Remove unused binaries
rm -f {talos*,spartaplus,promega}/bin/*{linux,mac,sgi6x,winxp} pdb/misc/addSeg || die
+ # Some scripts are on the wrong place
+ cp -f nmrtxt/*.com com/
+ rm -f {acme,com}/{nmrproc,fid}.com || die
+
+ eend
+
+ ebegin "Fixing paths in scripts"
+
# Set the correct path to NMRPipe in the auxiliary scripts.
for i in $(find com/ dynamo/surface/misc/ nmrtxt/ talos/misc talosplus/com -type f); do
sed -e "s%/u/delaglio%${ENMRBASE}%" -i ${i} || die \
@@ -145,24 +132,6 @@ src_install() {
sed -i "s:${WORKDIR}:${ENMRBASE}:g" com/font.com || die
sed \
- -e "s:/opt/nmrpipe:${EPREFIX}/opt/nmrpipe:g" \
- "${FILESDIR}"/env-${PN}-new \
- > env-${PN}-new || die
- newenvd env-${PN}-new 40${PN} || die "Failed to install env file."
-
- # PREFIX stuff
- sed \
- -e "s: sh : ${EPREFIX}/bin/sh :g" \
- -e "s: csh : ${EPREFIX}/bin/csh :g" \
- -e "s: bash : ${EPREFIX}/bin/bash :g" \
- -e "s:appTerm -e:appTerm -e ${EPREFIX}/bin/csh:g" \
- -i com/* || die
-
- # Some scripts are on the wrong place
- cp -f nmrtxt/*.com com/
- rm -f {acme,com}/{nmrproc,fid}.com || die
-
- sed \
-e "s:!/bin:!${EPREFIX}/bin:g" \
-e "s:!/usr/bin:!${EPREFIX}/usr/bin:g" \
-e "s:!/usr/local/bin:!${EPREFIX}/usr/bin:g" \
@@ -170,19 +139,65 @@ src_install() {
-e "s: /usr/bin: ${EPREFIX}/usr/bin:g" \
-e "s: /usr/local/bin: ${EPREFIX}/usr/bin:g" \
-i $(find "${S}" \( -name *.tcl -o -name *.com -o -name *.ksh \) ) \
- -i {com/,nmrtxt/*.com,nmrtxt/nt/*.com,dynamo/tcl/,talos*/com/,dynamo/tcl/}* \
+ {com/,nmrtxt/*.com,nmrtxt/nt/*.com,dynamo/tcl/,talos*/com/,dynamo/tcl/}* \
nmrbin.linux9/{nmrDraw,xNotify} || die
+ eend
+
+ if use prefix; then
+ sed \
+ -e "s: sh : ${EPREFIX}/bin/sh :g" \
+ -e "s: csh : ${EPREFIX}/bin/csh :g" \
+ -e "s: bash : ${EPREFIX}/bin/bash :g" \
+ -e "s:appTerm -e:appTerm -e ${EPREFIX}/bin/csh:g" \
+ -i com/* || die
+
+ ebegin "Setting RPATH in binaries"
+ for bin in $(find nmrbin.linux9/ -type f -maxdepth 1); do
+ patchelf --set-rpath "${EPREFIX}"/usr/lib/ ${bin}
+ done
+ eend $?
+ fi
+}
+
+src_install() {
+ cat >> "${T}"/nmrWish <<- EOF
+ #!${EPREFIX}/bin/csh -f
+ setenv NMRBIN \${NMRBASE}/bin/
+ setenv NMRLIB \${NMRBIN}/lib
+ setenv AUXLIB \${NMRBIN}/openwin/lib
+ setenv TCLPATH \${NMRBASE}/com
+ setenv TCL_LIBRARY \${NMRBASE}/nmrtcl/tcl8.4
+ setenv TK_LIBRARY \${NMRBASE}/nmrtcl/tk8.4
+ setenv BLT_LIBRARY \${NMRBASE}/nmrtcl/blt2.4
+ setenv NMRPIPE_TCL_LIB \${NMRBASE}/nmrtcl/tcl8.4
+ setenv NMRPIPE_TK_LIB \${NMRBASE}/nmrtcl/tk8.4
+ setenv NMRPIPE_BLT_LIB \${NMRBASE}/nmrtcl/blt2.4
+
+ if (!(\$?LD_LIBRARY_PATH)) then
+ setenv LD_LIBRARY_PATH \${NMRLIB}:\${AUXLIB}
+ else
+ setenv LD_LIBRARY_PATH \${NMRLIB}:\${LD_LIBRARY_PATH}:\${AUXLIB}
+ endif
+
+ nmrwish \$*
+ EOF
+
+ sed \
+ -e "s:/opt/nmrpipe:${EPREFIX}/opt/nmrpipe:g" \
+ "${FILESDIR}"/env-${PN}-new \
+ > env-${PN}-new || die
+ newenvd env-${PN}-new 40${PN}
+
insinto ${NMRBASE}
- doins -r * || die "Failed to install application."
+ doins -r *
- dosym nmrbin.linux9 ${NMRBASE}/bin || die \
- "Failed to symlink binaries."
+ dosym nmrbin.linux9 ${NMRBASE}/bin
- # fperms does not chmod nmrwish
-# fperms -v 775 ${NMRBASE}/{talos/bin,nmrbin.linux9,com,dynamo/tcl}/* || die
- chmod -c 775 "${ED}"/${NMRBASE}/{talos*/bin/,sparta*/bin/,nmrbin.linux9/,com/,dynamo/tcl/,nmrtxt/*.com,talos*/com/,promega/bin/}* || die
+ ebegin "Fixing permissions"
+ chmod 775 "${ED}"/${NMRBASE}/{talos*/bin/,sparta*/bin/,nmrbin.linux9/,com/,dynamo/tcl/,nmrtxt/*.com,talos*/com/,promega/bin/}* || die
+ eend
exeinto ${NMRBASE}/nmrbin.linux9
- doexe "${T}"/nmrWish || die
+ doexe "${T}"/nmrWish
}