| 1 |
# Copyright 1999-2012 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/app-text/xdvik/xdvik-22.84.16.ebuild,v 1.17 2012/09/15 09:36:49 naota Exp $
|
| 4 |
|
| 5 |
EAPI=3
|
| 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 |
KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 sh sparc x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
|
| 13 |
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/motif-2.3:0 )
|
| 22 |
!motif? (
|
| 23 |
neXt? ( x11-libs/neXtaw )
|
| 24 |
!neXt? (
|
| 25 |
Xaw3d? ( x11-libs/libXaw3d )
|
| 26 |
!Xaw3d? ( x11-libs/libXaw )
|
| 27 |
)
|
| 28 |
)
|
| 29 |
virtual/latex-base
|
| 30 |
!<app-text/texlive-2007"
|
| 31 |
DEPEND="sys-devel/flex
|
| 32 |
virtual/yacc
|
| 33 |
${RDEPEND}"
|
| 34 |
TEXMF_PATH=/usr/share/texmf
|
| 35 |
S=${WORKDIR}/${P}/texk/xdvik
|
| 36 |
|
| 37 |
src_prepare() {
|
| 38 |
epatch "${FILESDIR}"/${P}-open-mode.patch \
|
| 39 |
"${FILESDIR}"/${P}-cvararg.patch \
|
| 40 |
"${FILESDIR}"/${P}-parallel_make.patch
|
| 41 |
has_version '>=app-text/texlive-core-2009' && epatch "${FILESDIR}"/${P}-kpathsea_version.patch
|
| 42 |
# Make sure system kpathsea headers are used
|
| 43 |
cd "${WORKDIR}/${P}/texk/kpathsea"
|
| 44 |
for i in *.h ; do echo "#include_next \"$i\"" > $i; done
|
| 45 |
}
|
| 46 |
|
| 47 |
src_configure() {
|
| 48 |
cd "${WORKDIR}/${P}"
|
| 49 |
|
| 50 |
tc-export CC AR RANLIB
|
| 51 |
|
| 52 |
local toolkit
|
| 53 |
|
| 54 |
if use motif ; then
|
| 55 |
toolkit="motif"
|
| 56 |
use neXt && ewarn "neXt USE flag ignored (superseded by motif)"
|
| 57 |
use Xaw3d && ewarn "Xaw3d USE flag ignored (superseded by motif)"
|
| 58 |
elif use neXt ; then
|
| 59 |
toolkit="neXtaw"
|
| 60 |
use Xaw3d && ewarn "Xaw3d USE flag ignored (superseded by neXt)"
|
| 61 |
elif use Xaw3d ; then
|
| 62 |
toolkit="xaw3d"
|
| 63 |
else
|
| 64 |
toolkit="xaw"
|
| 65 |
fi
|
| 66 |
|
| 67 |
econf --disable-multiplatform \
|
| 68 |
--enable-t1lib \
|
| 69 |
--enable-gf \
|
| 70 |
--with-system-t1lib \
|
| 71 |
--with-system-kpathsea \
|
| 72 |
--with-kpathsea-include="${EPREFIX}"/usr/include/kpathsea \
|
| 73 |
--with-xdvi-x-toolkit="${toolkit}"
|
| 74 |
}
|
| 75 |
|
| 76 |
src_compile() {
|
| 77 |
emake kpathsea_dir="${EPREFIX}/usr/include/kpathsea" texmf="${EPREFIX}${TEXMF_PATH}" || die
|
| 78 |
use emacs && elisp-compile xdvi-search.el
|
| 79 |
}
|
| 80 |
|
| 81 |
src_install() {
|
| 82 |
einstall kpathsea_dir="${EPREFIX}/usr/include/kpathsea" texmf="${ED}${TEXMF_PATH}" || die "install failed"
|
| 83 |
|
| 84 |
dodir /etc/texmf/xdvi /etc/X11/app-defaults
|
| 85 |
mv "${ED}${TEXMF_PATH}/xdvi/XDvi" "${ED}etc/X11/app-defaults" || die "failed to move config file"
|
| 86 |
dosym {/etc/X11/app-defaults,"${TEXMF_PATH}/xdvi"}/XDvi || die "failed to symlink config file"
|
| 87 |
for i in $(find "${ED}${TEXMF_PATH}/xdvi" -maxdepth 1 -type f) ; do
|
| 88 |
mv ${i} "${ED}etc/texmf/xdvi" || die "failed to move $i"
|
| 89 |
dosym {/etc/texmf,"${TEXMF_PATH}"}/xdvi/$(basename ${i}) || die "failed to symlink $i"
|
| 90 |
done
|
| 91 |
|
| 92 |
dodoc BUGS FAQ README.* || die "dodoc failed"
|
| 93 |
|
| 94 |
use emacs && elisp-install tex-utils *.el *.elc
|
| 95 |
|
| 96 |
doicon "${FILESDIR}"/${PN}.xpm
|
| 97 |
make_desktop_entry xdvi "XDVI" xdvik "Graphics;Viewer"
|
| 98 |
echo "MimeType=application/x-dvi;" >> "${ED}"usr/share/applications/xdvi-"${PN}".desktop
|
| 99 |
}
|
| 100 |
|
| 101 |
pkg_postinst() {
|
| 102 |
if use emacs; then
|
| 103 |
elog "Add"
|
| 104 |
elog " (add-to-list 'load-path \"${EPREFIX}${SITELISP}/tex-utils\")"
|
| 105 |
elog " (require 'xdvi-search)"
|
| 106 |
elog "to your ~/.emacs file"
|
| 107 |
fi
|
| 108 |
}
|