1 |
# Copyright 1999-2013 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.85-r1.ebuild,v 1.18 2013/04/22 08:03:47 ago Exp $ |
4 |
|
5 |
EAPI=4 |
6 |
inherit eutils flag-o-matic elisp-common toolchain-funcs multilib |
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 ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~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 |
dev-libs/kpathsea" |
30 |
DEPEND="sys-devel/flex |
31 |
virtual/yacc |
32 |
${RDEPEND}" |
33 |
RDEPEND="${RDEPEND} |
34 |
virtual/latex-base |
35 |
!<app-text/texlive-2007" |
36 |
TEXMF_PATH=/usr/share/texmf |
37 |
S=${WORKDIR}/${P}/texk/xdvik |
38 |
|
39 |
src_prepare() { |
40 |
epatch "${FILESDIR}/${P}-mksedscript.patch" \ |
41 |
"${FILESDIR}/${P}-mksedscript_gentoo.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 |
local toolkit |
49 |
|
50 |
if use motif ; then |
51 |
toolkit="motif" |
52 |
use neXt && ewarn "neXt USE flag ignored (superseded by motif)" |
53 |
use Xaw3d && ewarn "Xaw3d USE flag ignored (superseded by motif)" |
54 |
elif use neXt ; then |
55 |
toolkit="neXtaw" |
56 |
use Xaw3d && ewarn "Xaw3d USE flag ignored (superseded by neXt)" |
57 |
elif use Xaw3d ; then |
58 |
toolkit="xaw3d" |
59 |
else |
60 |
toolkit="xaw" |
61 |
fi |
62 |
|
63 |
econf \ |
64 |
--with-system-t1lib \ |
65 |
--with-system-kpathsea \ |
66 |
--with-kpathsea-include="${EPREFIX}"/usr/include/kpathsea \ |
67 |
--with-xdvi-x-toolkit="${toolkit}" \ |
68 |
--x-includes="${EPREFIX}"/usr/include \ |
69 |
--x-libraries="${EPREFIX}"/usr/$(get_libdir) |
70 |
} |
71 |
|
72 |
src_compile() { |
73 |
emake kpathsea_dir="${EPREFIX}/usr/include/kpathsea" texmf="${EPREFIX}${TEXMF_PATH}" |
74 |
use emacs && elisp-compile xdvi-search.el |
75 |
} |
76 |
|
77 |
src_install() { |
78 |
emake DESTDIR="${D}" install |
79 |
|
80 |
dodir /etc/texmf/xdvi /usr/share/X11/app-defaults |
81 |
mv "${ED}${TEXMF_PATH}/xdvi/XDvi" "${ED}usr/share/X11/app-defaults" || die "failed to move config file" |
82 |
dosym {/usr/share/X11/app-defaults,"${TEXMF_PATH}/xdvi"}/XDvi |
83 |
for i in $(find "${ED}${TEXMF_PATH}/xdvi" -maxdepth 1 -type f) ; do |
84 |
mv ${i} "${ED}etc/texmf/xdvi" || die "failed to move $i" |
85 |
dosym {/etc/texmf,"${TEXMF_PATH}"}/xdvi/$(basename ${i}) |
86 |
done |
87 |
|
88 |
dodoc BUGS FAQ README.* |
89 |
|
90 |
use emacs && elisp-install tex-utils *.el *.elc |
91 |
|
92 |
doicon "${FILESDIR}"/${PN}.xpm |
93 |
make_desktop_entry xdvi "XDVI" xdvik "Graphics;Viewer" |
94 |
echo "MimeType=application/x-dvi;" >> "${ED}"usr/share/applications/xdvi-"${PN}".desktop |
95 |
} |
96 |
|
97 |
pkg_postinst() { |
98 |
if use emacs; then |
99 |
elog "Add" |
100 |
elog " (add-to-list 'load-path \"${EPREFIX}${SITELISP}/tex-utils\")" |
101 |
elog " (require 'xdvi-search)" |
102 |
elog "to your ~/.emacs file" |
103 |
fi |
104 |
} |