| 1 |
# Copyright 1999-2013 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/sci-visualization/gri/gri-2.12.23.ebuild,v 1.6 2012/08/01 23:39:06 bicatali Exp $
|
| 4 |
|
| 5 |
EAPI=4
|
| 6 |
|
| 7 |
inherit eutils elisp-common
|
| 8 |
|
| 9 |
DESCRIPTION="Language for scientific graphics programming"
|
| 10 |
HOMEPAGE="http://gri.sourceforge.net/"
|
| 11 |
SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
|
| 12 |
|
| 13 |
LICENSE="GPL-2"
|
| 14 |
SLOT="0"
|
| 15 |
KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux"
|
| 16 |
IUSE="doc emacs examples"
|
| 17 |
|
| 18 |
DEPEND="
|
| 19 |
>=sci-libs/netcdf-4
|
| 20 |
virtual/latex-base
|
| 21 |
|| ( media-gfx/imagemagick[png] media-gfx/graphicsmagick[png,imagemagick] )
|
| 22 |
app-text/ghostscript-gpl
|
| 23 |
emacs? ( virtual/emacs )"
|
| 24 |
RDEPEND="${DEPEND}"
|
| 25 |
|
| 26 |
SITEFILE="50gri-gentoo.el"
|
| 27 |
|
| 28 |
src_prepare() {
|
| 29 |
epatch \
|
| 30 |
"${FILESDIR}"/${PN}-2.12.18-postscript.patch \
|
| 31 |
"${FILESDIR}"/${P}-perl-5.16.patch
|
| 32 |
# Makefile.am contains a call to the missing script that triggers gentoo qa
|
| 33 |
sed -i -e 's|${SHELL} ../missing --run tex|tex|g' \
|
| 34 |
doc/Makefile.in || die
|
| 35 |
sed \
|
| 36 |
-e "/system/d" \
|
| 37 |
-i doc/tst_suite/tst_rpn.gri || die
|
| 38 |
}
|
| 39 |
|
| 40 |
src_compile() {
|
| 41 |
# gentoo bug #302621
|
| 42 |
use hdf5 && has_version sci-libs/hdf5[mpi] && \
|
| 43 |
export CXX=mpicxx CC=mpicc
|
| 44 |
VARTEXFONTS="${T}/fonts" emake
|
| 45 |
use emacs && elisp-compile src/*.el
|
| 46 |
}
|
| 47 |
|
| 48 |
src_install() {
|
| 49 |
default
|
| 50 |
# license text not necessary
|
| 51 |
rm "${ED}"/usr/share/gri/doc/license.txt || die
|
| 52 |
|
| 53 |
# install target installs it always and in the wrong location
|
| 54 |
# remove it here and call elisp-install in case of USE=emacs below
|
| 55 |
rm -rf "${ED}"/usr/share/emacs || die
|
| 56 |
|
| 57 |
if ! use doc; then
|
| 58 |
sed -i -e "s/Manual at.*//" "${ED}"/usr/share/gri/startup.msg || die
|
| 59 |
rm "${ED}"/usr/share/gri/doc/{cmd,}refcard.ps || die
|
| 60 |
rm -rf "${ED}"/usr/share/gri/doc/html || die
|
| 61 |
fi
|
| 62 |
if ! use examples; then
|
| 63 |
sed -i -e "s/Examples at.*//" "${ED}"/usr/share/gri/startup.msg || die
|
| 64 |
rm -rf "${ED}"/usr/share/gri/doc/examples || die
|
| 65 |
fi
|
| 66 |
#move docs to the proper place
|
| 67 |
use doc || use examples && \
|
| 68 |
mv -f "${ED}"/usr/share/gri/doc/* "${ED}"/usr/share/doc/${PF}
|
| 69 |
rm -rf "${ED}"/usr/share/gri/doc || die
|
| 70 |
|
| 71 |
if use emacs; then
|
| 72 |
cd src
|
| 73 |
elisp-install ${PN} *.{el,elc}
|
| 74 |
elisp-site-file-install "${FILESDIR}/${SITEFILE}"
|
| 75 |
fi
|
| 76 |
}
|
| 77 |
|
| 78 |
pkg_postinst() {
|
| 79 |
use emacs && elisp-site-regen
|
| 80 |
}
|
| 81 |
|
| 82 |
pkg_postrm() {
|
| 83 |
use emacs && elisp-site-regen
|
| 84 |
}
|