| 1 |
aballier |
1.1 |
# Copyright 1999-2012 Gentoo Foundation |
| 2 |
|
|
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
ulm |
1.4 |
# $Header: /var/cvsroot/gentoo-x86/app-text/xdvik/xdvik-22.85.ebuild,v 1.3 2012/05/09 15:07:10 aballier Exp $ |
| 4 |
aballier |
1.1 |
|
| 5 |
|
|
EAPI=4 |
| 6 |
|
|
inherit eutils flag-o-matic elisp-common toolchain-funcs |
| 7 |
|
|
|
| 8 |
|
|
DESCRIPTION="DVI previewer for X Window System" |
| 9 |
|
|
HOMEPAGE="http://xdvi.sourceforge.net/" |
| 10 |
|
|
SRC_URI="mirror://sourceforge/xdvi/${P}.tar.gz" |
| 11 |
|
|
|
| 12 |
aballier |
1.3 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~x64-solaris ~x86-solaris" |
| 13 |
aballier |
1.1 |
SLOT="0" |
| 14 |
|
|
LICENSE="GPL-2" |
| 15 |
|
|
IUSE="motif neXt Xaw3d emacs" |
| 16 |
|
|
|
| 17 |
|
|
RDEPEND=">=media-libs/t1lib-5.0.2 |
| 18 |
|
|
x11-libs/libXmu |
| 19 |
|
|
x11-libs/libXp |
| 20 |
|
|
x11-libs/libXpm |
| 21 |
|
|
motif? ( >=x11-libs/openmotif-2.3:0 ) |
| 22 |
|
|
!motif? ( neXt? ( x11-libs/neXtaw ) |
| 23 |
|
|
!neXt? ( Xaw3d? ( x11-libs/libXaw3d ) ) ) |
| 24 |
|
|
dev-libs/kpathsea" |
| 25 |
|
|
DEPEND="sys-devel/flex |
| 26 |
|
|
virtual/yacc |
| 27 |
|
|
${RDEPEND}" |
| 28 |
|
|
RDEPEND="${RDEPEND} |
| 29 |
|
|
virtual/latex-base |
| 30 |
|
|
!<app-text/texlive-2007" |
| 31 |
|
|
TEXMF_PATH=/usr/share/texmf |
| 32 |
|
|
S=${WORKDIR}/${P}/texk/xdvik |
| 33 |
|
|
|
| 34 |
|
|
src_prepare() { |
| 35 |
aballier |
1.2 |
epatch "${FILESDIR}/${P}-mksedscript.patch" \ |
| 36 |
|
|
"${FILESDIR}/${P}-mksedscript_gentoo.patch" |
| 37 |
aballier |
1.1 |
# Make sure system kpathsea headers are used |
| 38 |
|
|
cd "${WORKDIR}/${P}/texk/kpathsea" |
| 39 |
|
|
for i in *.h ; do echo "#include_next \"$i\"" > $i; done |
| 40 |
|
|
} |
| 41 |
|
|
|
| 42 |
|
|
src_configure() { |
| 43 |
|
|
local toolkit |
| 44 |
|
|
|
| 45 |
|
|
if use motif ; then |
| 46 |
|
|
toolkit="motif" |
| 47 |
|
|
elif use neXt ; then |
| 48 |
|
|
toolkit="neXtaw" |
| 49 |
|
|
elif use Xaw3d ; then |
| 50 |
|
|
toolkit="xaw3d" |
| 51 |
|
|
else |
| 52 |
|
|
toolkit="xaw" |
| 53 |
|
|
fi |
| 54 |
|
|
|
| 55 |
|
|
econf \ |
| 56 |
|
|
--with-system-t1lib \ |
| 57 |
|
|
--with-system-kpathsea \ |
| 58 |
|
|
--with-kpathsea-include="${EPREFIX}"/usr/include/kpathsea \ |
| 59 |
|
|
--with-xdvi-x-toolkit="${toolkit}" |
| 60 |
|
|
} |
| 61 |
|
|
|
| 62 |
|
|
src_compile() { |
| 63 |
|
|
emake kpathsea_dir="${EPREFIX}/usr/include/kpathsea" texmf="${EPREFIX}${TEXMF_PATH}" |
| 64 |
|
|
use emacs && elisp-compile xdvi-search.el |
| 65 |
|
|
} |
| 66 |
|
|
|
| 67 |
|
|
src_install() { |
| 68 |
|
|
emake DESTDIR="${D}" install |
| 69 |
|
|
|
| 70 |
|
|
dodir /etc/texmf/xdvi /etc/X11/app-defaults |
| 71 |
|
|
mv "${ED}${TEXMF_PATH}/xdvi/XDvi" "${ED}etc/X11/app-defaults" || die "failed to move config file" |
| 72 |
|
|
dosym {/etc/X11/app-defaults,"${TEXMF_PATH}/xdvi"}/XDvi |
| 73 |
|
|
for i in $(find "${ED}${TEXMF_PATH}/xdvi" -maxdepth 1 -type f) ; do |
| 74 |
|
|
mv ${i} "${ED}etc/texmf/xdvi" || die "failed to move $i" |
| 75 |
|
|
dosym {/etc/texmf,"${TEXMF_PATH}"}/xdvi/$(basename ${i}) |
| 76 |
|
|
done |
| 77 |
|
|
|
| 78 |
|
|
dodoc BUGS FAQ README.* |
| 79 |
|
|
|
| 80 |
|
|
use emacs && elisp-install tex-utils *.el *.elc |
| 81 |
|
|
|
| 82 |
|
|
doicon "${FILESDIR}"/${PN}.xpm |
| 83 |
|
|
make_desktop_entry xdvi "XDVI" xdvik "Graphics;Viewer" |
| 84 |
|
|
echo "MimeType=application/x-dvi;" >> "${ED}"usr/share/applications/xdvi-"${PN}".desktop |
| 85 |
|
|
} |
| 86 |
|
|
|
| 87 |
|
|
pkg_postinst() { |
| 88 |
|
|
if use emacs; then |
| 89 |
|
|
elog "Add" |
| 90 |
|
|
elog " (add-to-list 'load-path \"${EPREFIX}${SITELISP}/tex-utils\")" |
| 91 |
|
|
elog " (require 'xdvi-search)" |
| 92 |
|
|
elog "to your ~/.emacs file" |
| 93 |
|
|
fi |
| 94 |
|
|
} |