summaryrefslogtreecommitdiff
blob: e2e3c34c44f0c1195591ea57ce80c6a9dc13f6f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-text/xdvik/xdvik-22.40y-r2.ebuild,v 1.17 2007/07/22 10:24:39 calchan Exp $

inherit eutils

IUSE="cjk libwww"

MY_P="${P}1"
XDVIK_JP="${MY_P}-j1.21"
S="${WORKDIR}/${MY_P}"

DESCRIPTION="DVI previewer for X Window System"
SRC_URI="mirror://sourceforge/xdvi/${MY_P}.tar.gz
	cjk? ( http://www.nn.iij4u.or.jp/~tutimura/tex/${XDVIK_JP}.patch.gz )"
HOMEPAGE="http://sourceforge.net/projects/xdvi/"

KEYWORDS="x86 alpha amd64 arm hppa ia64 ppc ppc64 -ppc-macos sparc"
SLOT="0"
LICENSE="GPL-2"

DEPEND=">=media-libs/t1lib-1.3
	x11-libs/libXpm
	x11-libs/libXmu
	virtual/tetex
	cjk? ( >=media-libs/freetype-2 )
	libwww? ( >=net-libs/libwww-5.3.2-r1 )
	!app-text/texlive
	!>app-text/tetex-3
	!>app-text/ptex-3.1.8"

src_unpack () {

	unpack ${MY_P}.tar.gz
	cd ${S}
	epatch ${FILESDIR}/xdvi-xorg-7.0.patch
	epatch ${FILESDIR}/xdvizilla.patch
	if use cjk ; then
		epatch ${DISTDIR}/${XDVIK_JP}.patch.gz
		epatch ${FILESDIR}/${P}-dvi-draw-conflicting-types.patch
		sed -i -e "/\/usr\/local/s:^:%:g" \
			-e "/kochi-.*-subst/s:%::g" \
			-e "s:/usr/local:/usr:g" \
			-e "s:/usr/X11R6/lib/X11/fonts/truetype:/usr/share/fonts/kochi-substitute:g" \
			${S}/texk/xdvik/vfontmap.freetype || die
	fi
}

src_compile () {

	local myconf

	if use cjk ; then
		 export CPPFLAGS="${CPPFLAGS} -I/usr/include/freetype2"
		 myconf="${myconf} --with-vflib=vf2ft"
	fi

	econf --enable-xdvietcdir=/usr/share/texmf/xdvi \
		--disable-multiplatform \
		--with-system-t1lib \
		`use_with libwww system-wwwlib` \
		${myconf} || die "econf failed"

	cd texk/xdvik
	make || die
}

src_install () {

	dodir /usr/share/texmf/xdvi
	dodir /usr/share/man/man1

	cd ${S}/texk/xdvik
	einstall texmf=${D}/usr/share/texmf \
		XDVIETCDIR=${D}/usr/share/texmf/xdvi \
		|| die "install failed"

	dodoc ANNOUNCE BUGS FAQ README.*
	if use cjk; then
		dodoc CHANGES.xdvik-jp
		docinto READMEs
		dodoc READMEs/*
	fi
}