| 1 |
# Copyright 1999-2012 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/sci-visualization/gnuplot/gnuplot-4.4.4-r1.ebuild,v 1.5 2012/02/16 18:01:05 phajdan.jr Exp $
|
| 4 |
|
| 5 |
EAPI=4
|
| 6 |
|
| 7 |
inherit elisp-common multilib wxwidgets
|
| 8 |
|
| 9 |
DESCRIPTION="Command-line driven interactive plotting program"
|
| 10 |
HOMEPAGE="http://www.gnuplot.info/"
|
| 11 |
|
| 12 |
if [[ -z ${PV%%*9999} ]]; then
|
| 13 |
inherit autotools cvs
|
| 14 |
ECVS_SERVER="gnuplot.cvs.sourceforge.net:/cvsroot/gnuplot"
|
| 15 |
ECVS_MODULE="gnuplot"
|
| 16 |
ECVS_BRANCH="branch-4-4-stable"
|
| 17 |
ECVS_USER="anonymous"
|
| 18 |
ECVS_CVS_OPTIONS="-dP"
|
| 19 |
MY_P="${PN}"
|
| 20 |
SRC_URI=""
|
| 21 |
else
|
| 22 |
MY_P="${P/_/-}"
|
| 23 |
SRC_URI="mirror://sourceforge/gnuplot/${MY_P}.tar.gz"
|
| 24 |
fi
|
| 25 |
|
| 26 |
LICENSE="gnuplot GPL-2"
|
| 27 |
SLOT="0"
|
| 28 |
KEYWORDS="~alpha amd64 ~arm hppa ~ia64 ppc ~ppc64 ~s390 ~sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
|
| 29 |
IUSE="cairo doc emacs examples +gd ggi latex lua plotutils readline svga thin-splines wxwidgets X xemacs"
|
| 30 |
RESTRICT="wxwidgets? ( test )"
|
| 31 |
|
| 32 |
RDEPEND="
|
| 33 |
cairo? (
|
| 34 |
x11-libs/cairo
|
| 35 |
x11-libs/pango )
|
| 36 |
emacs? ( virtual/emacs )
|
| 37 |
gd? ( media-libs/gd[png] )
|
| 38 |
ggi? ( media-libs/libggi )
|
| 39 |
latex? (
|
| 40 |
virtual/latex-base
|
| 41 |
lua? (
|
| 42 |
dev-tex/pgf
|
| 43 |
>=dev-texlive/texlive-latexrecommended-2008-r2 ) )
|
| 44 |
lua? ( dev-lang/lua )
|
| 45 |
plotutils? ( media-libs/plotutils )
|
| 46 |
readline? ( sys-libs/readline )
|
| 47 |
svga? ( media-libs/svgalib )
|
| 48 |
wxwidgets? (
|
| 49 |
x11-libs/wxGTK:2.8[X]
|
| 50 |
x11-libs/cairo
|
| 51 |
x11-libs/pango
|
| 52 |
x11-libs/gtk+:2 )
|
| 53 |
X? ( x11-libs/libXaw )
|
| 54 |
xemacs? (
|
| 55 |
app-editors/xemacs
|
| 56 |
app-xemacs/xemacs-base )"
|
| 57 |
DEPEND="${RDEPEND}
|
| 58 |
dev-util/pkgconfig
|
| 59 |
doc? (
|
| 60 |
virtual/latex-base
|
| 61 |
dev-texlive/texlive-latexextra
|
| 62 |
app-text/ghostscript-gpl )
|
| 63 |
!emacs? ( xemacs? ( app-xemacs/texinfo ) )"
|
| 64 |
|
| 65 |
S="${WORKDIR}/${MY_P}"
|
| 66 |
|
| 67 |
GP_VERSION="${PV%.*}"
|
| 68 |
E_SITEFILE="50${PN}-gentoo.el"
|
| 69 |
TEXMF="${EPREFIX}/usr/share/texmf-site"
|
| 70 |
|
| 71 |
src_prepare() {
|
| 72 |
epatch "${FILESDIR}/${P}-tikz.patch"
|
| 73 |
|
| 74 |
if [[ -z ${PV%%*9999} ]]; then
|
| 75 |
local dir
|
| 76 |
for dir in config demo m4 term tutorial; do
|
| 77 |
emake -C "$dir" -f Makefile.am.in Makefile.am
|
| 78 |
done
|
| 79 |
eautoreconf
|
| 80 |
fi
|
| 81 |
|
| 82 |
# Add special version identification as required by provision 2
|
| 83 |
# of the gnuplot license
|
| 84 |
sed -i -e "1s/.*/& (Gentoo revision ${PR})/" PATCHLEVEL || die
|
| 85 |
}
|
| 86 |
|
| 87 |
src_configure() {
|
| 88 |
if ! use latex; then
|
| 89 |
sed -i -e '/SUBDIRS/s/LaTeX//' share/Makefile.in || die
|
| 90 |
fi
|
| 91 |
|
| 92 |
if use wxwidgets; then
|
| 93 |
WX_GTK_VER="2.8"
|
| 94 |
need-wxwidgets unicode
|
| 95 |
fi
|
| 96 |
|
| 97 |
local myconf
|
| 98 |
myconf="${myconf} --without-lisp-files"
|
| 99 |
myconf="${myconf} --without-pdf"
|
| 100 |
myconf="${myconf} --with-texdir=${TEXMF}/tex/latex/${PN}"
|
| 101 |
myconf="${myconf} $(use_with cairo)"
|
| 102 |
myconf="${myconf} $(use_with doc tutorial)"
|
| 103 |
myconf="${myconf} $(use_with gd)"
|
| 104 |
myconf="${myconf} $(use_with ggi ggi ${EPREFIX}/usr/$(get_libdir))"
|
| 105 |
myconf="${myconf} $(use_with ggi xmi ${EPREFIX}/usr/$(get_libdir))"
|
| 106 |
myconf="${myconf} $(use_with lua)"
|
| 107 |
myconf="${myconf} $(use_with plotutils plot "${EPREFIX}"/usr/$(get_libdir))"
|
| 108 |
myconf="${myconf} $(use_with svga linux-vga)"
|
| 109 |
myconf="${myconf} $(use_enable thin-splines)"
|
| 110 |
myconf="${myconf} $(use_enable wxwidgets)"
|
| 111 |
myconf="${myconf} $(use_with X x)"
|
| 112 |
use readline \
|
| 113 |
&& myconf="${myconf} --with-readline=gnu" \
|
| 114 |
|| myconf="${myconf} --with-readline=builtin"
|
| 115 |
|
| 116 |
econf ${myconf} \
|
| 117 |
DIST_CONTACT="http://bugs.gentoo.org/" \
|
| 118 |
EMACS=$(usev emacs || usev xemacs || echo no)
|
| 119 |
|
| 120 |
if use xemacs; then
|
| 121 |
einfo "Configuring gnuplot-mode for XEmacs ..."
|
| 122 |
use emacs && cp -Rp lisp lisp-xemacs || ln -s lisp lisp-xemacs
|
| 123 |
cd "${S}/lisp-xemacs"
|
| 124 |
econf --with-lispdir="${EPREFIX}/usr/lib/xemacs/site-packages/${PN}" EMACS=xemacs
|
| 125 |
fi
|
| 126 |
|
| 127 |
if use emacs; then
|
| 128 |
einfo "Configuring gnuplot-mode for GNU Emacs ..."
|
| 129 |
cd "${S}/lisp"
|
| 130 |
econf --with-lispdir="${EPREFIX}${SITELISP}/${PN}" EMACS=emacs
|
| 131 |
fi
|
| 132 |
}
|
| 133 |
|
| 134 |
src_compile() {
|
| 135 |
# Prevent access violations, see bug 201871
|
| 136 |
VARTEXFONTS="${T}/fonts"
|
| 137 |
|
| 138 |
# This is a hack to avoid sandbox violations when using the Linux console.
|
| 139 |
# Creating the DVI and PDF tutorials require /dev/svga to build the
|
| 140 |
# example plots.
|
| 141 |
addwrite /dev/svga:/dev/mouse:/dev/tts/0
|
| 142 |
|
| 143 |
emake all info
|
| 144 |
|
| 145 |
if use xemacs; then
|
| 146 |
cd "${S}/lisp-xemacs"
|
| 147 |
emake
|
| 148 |
fi
|
| 149 |
|
| 150 |
if use emacs; then
|
| 151 |
cd "${S}/lisp"
|
| 152 |
emake
|
| 153 |
fi
|
| 154 |
|
| 155 |
if use doc; then
|
| 156 |
# Avoid sandbox violation in epstopdf/ghostscript
|
| 157 |
addpredict /var/cache/fontconfig
|
| 158 |
cd "${S}/docs"
|
| 159 |
emake pdf
|
| 160 |
cd "${S}/tutorial"
|
| 161 |
emake pdf
|
| 162 |
|
| 163 |
if use emacs || use xemacs; then
|
| 164 |
cd "${S}/lisp"
|
| 165 |
emake pdf
|
| 166 |
fi
|
| 167 |
fi
|
| 168 |
}
|
| 169 |
|
| 170 |
src_install () {
|
| 171 |
emake DESTDIR="${D}" install
|
| 172 |
|
| 173 |
if use xemacs; then
|
| 174 |
cd "${S}/lisp-xemacs"
|
| 175 |
emake DESTDIR="${D}" install
|
| 176 |
fi
|
| 177 |
|
| 178 |
if use emacs; then
|
| 179 |
cd "${S}/lisp"
|
| 180 |
emake DESTDIR="${D}" install
|
| 181 |
# info-look* is included with >=emacs-21
|
| 182 |
rm -f "${ED}${SITELISP}/${PN}"/info-look*
|
| 183 |
|
| 184 |
# Gentoo emacs site-lisp configuration
|
| 185 |
echo "(add-to-list 'load-path \"@SITELISP@\")" > ${E_SITEFILE}
|
| 186 |
sed '/^;; move/,+3 d' dotemacs >> ${E_SITEFILE} || die
|
| 187 |
elisp-site-file-install ${E_SITEFILE} || die
|
| 188 |
fi
|
| 189 |
|
| 190 |
cd "${S}"
|
| 191 |
dodoc BUGS ChangeLog NEWS PGPKEYS PORTING README* TODO
|
| 192 |
newdoc term/PostScript/README README-ps
|
| 193 |
newdoc term/js/README README-js
|
| 194 |
use lua && newdoc term/lua/README README-lua
|
| 195 |
|
| 196 |
if use examples; then
|
| 197 |
# Demo files
|
| 198 |
insinto /usr/share/${PN}/${GP_VERSION}
|
| 199 |
doins -r demo
|
| 200 |
rm -f "${ED}"/usr/share/${PN}/${GP_VERSION}/demo/Makefile*
|
| 201 |
rm -f "${ED}"/usr/share/${PN}/${GP_VERSION}/demo/binary*
|
| 202 |
fi
|
| 203 |
if use doc; then
|
| 204 |
# Manual
|
| 205 |
dodoc docs/gnuplot.pdf
|
| 206 |
# Tutorial
|
| 207 |
dodoc tutorial/{tutorial.dvi,tutorial.pdf}
|
| 208 |
# FAQ
|
| 209 |
dodoc FAQ.pdf
|
| 210 |
# Documentation for making PostScript files
|
| 211 |
docinto psdoc
|
| 212 |
dodoc docs/psdoc/{*.doc,*.tex,*.ps,*.gpi,README}
|
| 213 |
fi
|
| 214 |
|
| 215 |
if use emacs || use xemacs; then
|
| 216 |
docinto emacs
|
| 217 |
dodoc lisp/ChangeLog lisp/README
|
| 218 |
use doc && dodoc lisp/gpelcard.pdf
|
| 219 |
fi
|
| 220 |
}
|
| 221 |
|
| 222 |
pkg_postinst() {
|
| 223 |
use emacs && elisp-site-regen
|
| 224 |
use latex && texmf-update
|
| 225 |
|
| 226 |
elog "Gnuplot no longer links against pdflib, see the ChangeLog for"
|
| 227 |
elog "details. You can use the \"pdfcairo\" terminal for PDF output."
|
| 228 |
use cairo || elog "It is available with USE=\"cairo\"."
|
| 229 |
|
| 230 |
if use svga; then
|
| 231 |
echo
|
| 232 |
elog "In order to enable ordinary users to use SVGA console graphics"
|
| 233 |
elog "gnuplot needs to be set up as setuid root. Please note that"
|
| 234 |
elog "this is usually considered to be a security hazard."
|
| 235 |
elog "As root, manually \"chmod u+s /usr/bin/gnuplot\"."
|
| 236 |
fi
|
| 237 |
if use gd; then
|
| 238 |
echo
|
| 239 |
elog "For font support in png/jpeg/gif output, you may have to"
|
| 240 |
elog "set the GDFONTPATH and GNUPLOT_DEFAULT_GDFONT environment"
|
| 241 |
elog "variables. See the FAQ file in /usr/share/doc/${PF}/"
|
| 242 |
elog "for more information."
|
| 243 |
fi
|
| 244 |
}
|
| 245 |
|
| 246 |
pkg_postrm() {
|
| 247 |
use emacs && elisp-site-regen
|
| 248 |
use latex && texmf-update
|
| 249 |
}
|